Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Database consistency errors, please help!!!

Status
Not open for further replies.

Nofi

IS-IT--Management
May 24, 2004
2
MX
After a successfull restore of a database I get the following error when I run the command dbcc checkdb(DBName):

Server: Msg 7995, Level 16, State 1, Line 1
Database 'elmuebapp' consistency errors in sysobjects, sysindexes, syscolumns, or systypes prevent further CHECKDB processing.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
 
First off ... if you still have the backup you restored the DB from GREAT! If not ... create a backup of the DB now.

Once that is in place, try running these commands, ONE AT A TIME!!!, in Query Analyzer ...
Code:
-- RUN ONCE!
exec sp_dboption 'elmuebapp', 'SINGLE USER', 'TRUE'

-- MAY RUN MULTIPLE TIMES UNTIL NO ERROR ARE RETURNED
DBCC CheckDB(elmuebapp,REPAIR_REBUILD)

-- RUN ONCE!
exec sp_dboption 'elmuebapp', 'SINGLE USER', 'FALSE'

This will put the DB in single user mode so it must be a quiet system in order to run this. That means no one can or will be able to hit your DB once this is running.

The DBCC command may need to be ran a couple of time in order for it to completely root out the issues.

One issue you may run into is having to kill the current connections that are already using the DB. Fastest way would be to stop and start SQL Server and the fire off the first Command in Query Analyzer.

Thanks

J. Kusch
 
Hi,

Thanks for taking your time to respond, I have folloed your instructions but I keep on getting the same error message, I tried DBCC CHECKTABLE and I got the following on some of the tables:

Table error: Allocation Page (1:1002912) has invalid PFS_PAGE ....

Have you ever seen this error before?

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top