SQL Server在CentOS上的迁移步骤如下:
BACKUP DATABASE [数据库名] TO DISK = '/path/备份文件.bak' WITH INIT;
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2022.repo
sudo yum install -y mssql-server
sudo /opt/mssql/bin/mssql-conf setup # 配置SA密码等
sudo systemctl start mssql-server
/var/opt/mssql/data/):RESTORE DATABASE [数据库名] FROM DISK = '/path/备份文件.bak'
WITH MOVE '逻辑数据文件名' TO '/var/opt/mssql/data/数据库名.mdf',
MOVE '逻辑日志文件名' TO '/var/opt/mssql/data/数据库名.ldf';
注意事项:
bcp工具优化性能。