数据库
首页 > 数据库> > 数据库迁移

数据库迁移

作者:互联网

数据库迁移

 

备份

BACKUP DATABASE Energy TO DISK = 'c:\databak\data.bak'
RESTORE FILELISTONLY FROM DISK = 'c:\databak\data.bak'

 

还原数据库
RESTORE DATABASE pro_data
FROM DISK ='c:\databak\data.bak' 
WITH MOVE 'Energy' TO 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\pro_data.mdf',
MOVE 'Energy_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\pro_data_log.ldf'

标签:数据库,bak,databak,Energy,迁移,DISK,data,pro
来源: https://www.cnblogs.com/ningyouyou/p/15866919.html