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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Verify Backups using T-SQL

Author  Topic 

Tracey
Starting Member

40 Posts

Posted - 2004-07-20 : 20:41:08
Hello Everyone,
I am doing Database Backups using T-SQL. Is there anyway to Verify the Backup as in Database Backup Wizards.

Thank you

Tracey

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-20 : 20:49:50
This isn't an option in the BACKUP statement. Enterprise Manager runs a RESTORE VERIFYONLY after the backup to verify it if you choose this option. You can easily add that to your T-SQL.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

Tracey
Starting Member

40 Posts

Posted - 2004-07-20 : 21:15:59
Thanks derrick

Tracey
Go to Top of Page

Tracey
Starting Member

40 Posts

Posted - 2004-07-20 : 22:08:47
Another Q,
I have created a permanent Backup devices for each database, i want to store only last 2 days of backup file in the backup device. I tried all those Expiry date,Retain days, skip blah blah options, but cant get it work.
any help would be greatly appreciated

Ty, Tracey
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-20 : 23:14:32
Most people here prefer to have only one day in each backup file or device. Personally, I use files using the WITH DISK = '\\server\share\backupfile_full_20040601.bak' option. I then move each day to tape and erase anything older than 2 days. To do what you are trying to do, you need to test for every other day and use the WITH INIT file every other day. If you store the name of your backup files in a table, or justcreate a table to backups, you can just refer to that to INIT every other day.

Just as an fyi, you might want to look at Tara's blog a: http://weblogs.sqlteam.com/tarad .

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

Tracey
Starting Member

40 Posts

Posted - 2004-07-21 : 01:04:01
Thanks Derrick,
One more Q, :)
Is there anyway to list the last 5 date and time when the SQL Server Service is Stopped and Started.
Thanks
Tracey
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-21 : 01:33:06
The last few SQL Server Logs will be visible, in Enterprise Manager (Management : SQL Server Logs), with the date that SQL started (and the bottom of each log will show the time of a proper shutdown (i.e. not for a power cut), but that probbly doesn't get you what you want.

You could make a Stored Procedure in Master, and set it to Execute on startup - that could store the Startup time in a table

sp_procoption MySProc, startup, true

Perhaps the data you need is in MSDB somewhere ...

Kristen
Go to Top of Page
   

- Advertisement -