sql backup timex #sql #backup #timex

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql backup timex #sql #backup #timex相关的知识,希望对你有一定的参考价值。

-- TimeXkopia++ 
--\\192.168.200.45\live-sql\acc3-sqlbackup


RESTORE DATABASE Timex8_I_Test FROM DISK='Z:\jk\Timex8_I201701100100\Timex8_I201701100100.bak'
WITH
  MOVE 'Timex8_I' TO 'x:\jk\Timex8_I.mdf'
, MOVE 'Timex8_I_log' TO 'z:\jk\Timex8_I_log.ldf'





RESTORE DATABASE Timex8_I_Test FROM DISK='x:\jk\backup20170305'
WITH
  MOVE 'Timex8_I' TO 'x:\jk\Timex8_I.mdf'
, MOVE 'Timex8_I_log' TO 'z:\jk\Timex8_I_log.ldf'




--komplecik



BACKUP DATABASE Timex8_I
TO DISK = 'z:\jk\Timex8TempBackup'
go
RESTORE DATABASE Timex8_I_Test FROM DISK='z:\jk\Timex8TempBackup'
WITH
  MOVE 'Timex8_I' TO 'x:\jk\Timex8_I.mdf'
, MOVE 'Timex8_I_log' TO 'z:\jk\Timex8_I_log.ldf'
go


wersja z nowym plikiem:

	
RESTORE DATABASE Timex8_I_Test2 FROM DISK='f:\bckp\Timex8_I201903160531.bak'
WITH
  MOVE 'Timex8_I' TO 'f:\jk\Timex8_I.mdf'
, MOVE 'Timex8_I_2' TO 'f:\jk\Timex8_I_2.ndf'
, MOVE 'Timex8_I_log' TO 'f:\jk\Timex8_I_log.ldf'
,NORECOVERY
go
RESTORE DATABASE Timex8_I_Test2 FROM DISK='f:\bckp\Timex8_I201903200400diff.bak'
WITH
  MOVE 'Timex8_I' TO 'f:\jk\Timex8_I.mdf'
, MOVE 'Timex8_I_2' TO 'f:\jk\Timex8_I_2.ndf'
, MOVE 'Timex8_I_log' TO 'f:\jk\Timex8_I_log.ldf'
, RECOVERY
go

RESTORE DATABASE Timex8_I_Test FROM DISK='f:\bckp\Timex8TempBackup'
WITH
  MOVE 'Timex8_I' TO 'f:\jk2\Timex8_I.mdf'
, MOVE 'Timex8_I_2' TO 'f:\jk2\Timex8_I_2.ndf'
, MOVE 'Timex8_I_log' TO 'f:\jk2\Timex8_I_log.ldf'
go



ALTER DATABASE [Timex8_I_Test2] SET EMERGENCY;
GO
ALTER DATABASE [Timex8_I_Test2] set single_user
GO
DBCC CHECKDB ([Timex8_I_Test2], REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;
GO 
ALTER DATABASE [Timex8_I_Test2] set multi_user 
GO

以上是关于sql backup timex #sql #backup #timex的主要内容,如果未能解决你的问题,请参考以下文章

sql常用语法

sql tlog_backup.sql

sql oracle rman size backup.sql

删除30天以前的backup.sql

sql Estimate_Time_Completion_Backup_Restore

Docker MySQL 导入sql文件