Resolving serious problems with SQL Server log file corruption

Source: Internet
Author: User

If the server has a raid failure, and after the data base recovery is successful, one of the SQL Server log files (extension LDF) is found to be severely damaged, and we can recover all the data by doing the following.

Start by creating a new database with the same name, then stopping the SQL Server service, overwriting the new database file with the original database data file, and restarting the SQL Server service. Open Enterprise Manager, which displays "suspect" and executes the following statement in Query Analyzer:

USE MASTER
GO
SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE
GO
UPDATE SYSDATABASES SET STATUS =32768 WHERE NAME='置疑的数据库名'
Go
sp_dboption '置疑的数据库名', 'single user', 'true'
Go
DBCC CHECKDB('置疑的数据库名')
Go
update sysdatabases set status =28 where name='置疑的数据库名'
Go
sp_configure 'allow updates', 0 reconfigure with override
Go
sp_dboption '置疑的数据库名', 'single user', 'false'
Go

The database itself remains problematic after implementation and still shows "doubt". Now create a new database, run the DTS Export Wizard, import the data from the problematic database into the new database, open the new database, and retrieve all the data!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.