Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqlserverdba
Yak Posting Veteran
53 Posts |
Posted - 2010-05-24 : 17:38:58
|
Hi,I want to have SQLSERVER2005/Windows 2003R1 database backup daily go to tape.I've scheduled backup and going on disk. I want to push on tape ONLY latest backup to tape.Does anyone has any script or any utility etc?Thanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2010-05-24 : 17:44:03
|
You need to work with the tape backup team to sweep the file to tape. There isn't a script that you'd run on the SQL side. The tape backup software should be able to handle only the deltas, so it should only touch files that haven't been backed up to tape yet. We have our tape backup software (Netbackup) backup only our backup directory, such as F:\Backup (and all of its subfolders and files). We exclude the MDF, LDF, and other non-backup files.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
|
|
sqlserverdba
Yak Posting Veteran
53 Posts |
Posted - 2010-05-24 : 17:54:54
|
Tape backup ONLY pickup folder like c:\backup. I can write script but that working is not workinh ob.like c:\backup =Daily backup where backup .BAk files location on disk.move c:\backup c:\old_bakup.mkdir c:\backup |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2010-05-24 : 18:28:11
|
Here's some code from one of my jobs that gets the latest file:DECLARE @path varchar(100), @whichFile varchar(1000), @cmd nvarchar(4000)CREATE TABLE #files(DirInfo VARCHAR(7000))SELECT @path = 'F:\Backup\dbName\'SELECT @cmd = 'dir "' + @remotePath + '*.BAK" /OD'INSERT INTO #filesEXEC master..xp_cmdshell @cmdSELECT @whichFile = SUBSTRING(DirInfo, LEN(DirInfo) - PATINDEX('% %', REVERSE(DirInfo)) + 2, LEN(DirInfo)) FROM #filesWHERE SUBSTRING(DirInfo, 1, 10) = (SELECT MAX(SUBSTRING(DirInfo, 1, 10)) FROM #files)Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
|
|
|
|
|
|
|