BACKUP LOG QRSDB WITH NO_LOG
DBCC SHRINKFILE('QRSDB_DATA', 1)
DBCC SHRINKFILE('QRSDB_Log', 1)
以下為由SQL Query Analyzer執行WINDOW指令範例
declare @cmd varchar(255)
set @cmd = 'net use \\AP-SERVER samtek /user:administrator'
exec master..xp_cmdshell @cmd
set @cmd = 'DEL /Q \\AP-SERVER\DB_BAK\*.*'
exec master..xp_cmdshell @cmd
set @cmd = 'XCopy /S /K /Y /F D:\DB_BAK\*.* \\AP-SERVER\\DB_Bak\'
exec master..xp_cmdshell @cmd
note:1.執行檔須放在SQL SERVER主機下
2.可將SQL SCRIPT放入SQL排程內定期執行
沒有留言:
張貼留言