数据库迁移

数据库迁移

 

备份

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'

posted @ 2022-02-07 09:06  芝幽幽  阅读(26)  评论(0编辑  收藏  举报