Posted by: Colin Smith
Sybase DBCC or Database Consistency Checks. This was something that was talked about in my training class and so I thought I would implement this when I got back to work. I mentioned it to my team and they both said that I sounded just like them when they got back from class and they laughed a bit but said go ahead and see what happens. They told me that I would get a ton of errors that were meaningless and that to find out that they were meaningless errors I would have to call Sybase Support. They made it sound like it was more hassle then it was worth but I figured that I might want to do it any way just to get the experience and just what if I did find an error. I could be the Hero and I l love to be the Hero when I can.
I requested a couple devices from our Unix guys for the DBCC Database. I did an sp_plan_dbccdb and determined that I needed 5 gigs of space for data and only about 20 MB for log but I figured I would do 1 Gig for log. I got the devices and I created the DBCCDB and I ran the installdbcc script and boom I have DBCCDB and I am ready to go. I did also set up a named cache and bound it to DBCCDB just to make the DBCC commands run a bit faster. I also made sure that my number of worker process was sufficient for the task.
After getting everything set up I did it, I ran dbcc checkstorage on my DB and guess what. 0 Errors were found. Nothing at all to worry about and not even one spurious error that my teammates said I would have tons of. I am pretty sure that they have not run dbcc checkstorage for a couple releases and in 12.5.4 they added some error checking into the dbcc that makes it report very few if any spurious errors. Since this is the case I am going to regularly schedule this and perhaps one day it will really save us.
The dbcc does take about an hour to run on my DBA server that we load from Production once a week. I will continue to run he dbcc on this server so that I will not hinder the production server at all. Sybase does say that dbcc checkstorage is very un-intrusive but I would rather not give the application team any reason to blame the Database or my team for the application running slow. Based on this I would recommend that you run this as often ass possible as it may save you from getting in big trouble at some point. I hope to never see this report any errors but if it does I will be happy to catch it early. If you have any questions or comments please let me know here or go to www.sysadminsmith.com and send me an email.