cp /var/opt/mssql/data/xxx.mdf /data/sqlserver/
cp /var/opt/mssql/data/xxx_log.ldf /data/sqlserver/
ALTER DATABASE DUK_MKT MODIFY FILE(NAME=xxx, FILENAME='/data/sqlserver/xxx.mdf');
ALTER DATABASE DUK_MKT MODIFY FILE(NAME=xxx_log, FILENAME='/data/sqlserver/xxx_log.ldf');
chmod 666 /data/sqlserver/xxx.mdf
chmod 666 /data/sqlserver/xxx_log.ldf
systemctl restart mssql-server
参考
https://learn.microsoft.com/zh-cn/sql/relational-databases/databases/move-system-databases?view=sql-server-ver16
https://learn.microsoft.com/zh-cn/sql/linux/sql-server-linux-start-stop-restart-sql-server-services?view=sql-server-ver16
https://www.cnblogs.com/longbky/p/12059664.html
发表评论