-
March 6th, 2019, 04:59 AM
#1
Repair SQL Database with DBCC CHECKDB Command
There are no definite criteria when errors will occur. A database administrator may suddenly be prompted with errors in the SQL database or experience data loss. It is because of the factors affecting SQL server database. A wrong query executed by user may generate error or closing database when it is working state. One should be prepared for such errors and their recovery method.
An instant and effective way of SQL database recovery is DBCC CHECKDB command. This command is used to repair and rebuild corrupt SQL database and to get back deleted MDF, LDF files.
- Login to the SQL Database in which error has occurred
- Start the database console to execute commands for database repair
- First, type DBCC CHECKDB command and know the status of database
- Check the Database Index ID, if the index ID is greate than 1, then recreate the database
- If Database ID is between 0 and 1 then run the below given commands for database recovery
- DBCC CHECKDB (Database Name repair_fast) for instant recovery
- DBCC CHECKDB (Database Name repair_rebuild) to recreate and rebuild the SQL database
- DBCC CHECKDB (Database Name repair_allow_data_loss). These commands are used when the above two are not useful. Here user agrees for data loss in order to make the database run
They are useful for quick and instant recovery of database files.
Similar Threads
-
By JamesAlison in forum Microsoft Office
Replies: 11
Last Post: November 27th, 2018, 04:16 AM
-
By Kar in forum Microsoft Office
Replies: 8
Last Post: May 13th, 2016, 06:39 PM
-
By Auric in forum Tech-To-Tech
Replies: 1
Last Post: January 15th, 2008, 03:39 PM
-
By craigmodius in forum Tech-To-Tech
Replies: 2
Last Post: September 24th, 2003, 02:10 PM
-
By Percy in forum Windows NT/2000
Replies: 10
Last Post: January 15th, 2002, 02:40 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks