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)
 dbcc return value

Author  Topic 

wardsan
Starting Member

48 Posts

Posted - 2004-09-30 : 04:25:58
Folks,
we are attempting to use the EMC component TSIM for sql server backups. However, it is not possible to run consistency checks within this component. I thought of using isql from a script to run the dbcc but how can I build in a dependency to say that if the consistency check is ok, to go ahead with the backup. I cannot see any return on dbcc that act as a flag.
Also, this database will grow to 200GB, what is the most efficient way of running these checks? I have no idea how long a checkdb would take on a db this size
Can anybody help?

nr
SQLTeam MVY

12543 Posts

Posted - 2004-09-30 : 08:01:58
Depends on the system and wht it's doing but I would say a few hours.
I don't run dbcc checks on live systems (hang over from previous versions where it would corrupt the database).
I take the backup, restore it then run the dbcc checks on the restored copy.
I do this in a job - the final step being the dbcc check. The job will recievec a failure if the check fails.
See http://www.nigelrivett.net/s_TestRestore.html for th copy/restore.
I restore important databases every backup - others once a week.
Note that if you don't run test restores regularly you won't know if you have any backups.

In your case if you really want to run the check on the live database then you could run it as a job.
I try never to do anything other than a scheduled backup t-sql statement to backup databases to a local drive.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

wardsan
Starting Member

48 Posts

Posted - 2004-10-06 : 05:02:47
So, are you saying that if there is an issue that arises during the dbcc, the job that runs the dbcc will return an error?
Go to Top of Page
   

- Advertisement -