Feed on
Subscription

How to restore when SQL Server database breaks down

The state that any database systems cannot avoid to break down,Although you used Clustered,Double machine heats up equipment... still cannot eradicate completely the only place breakdown in the system,What is more,the rather that to major user,Cannot bear so costly hardware invests.So,When the system breaks down,How to restore original valuable data to become an all in all issue.

When restore,The data file that optimal circumstance is you and log file are in good condition nondestructive,Need Sp_attach_db only so,Add data file to new database can,Perhaps be in stop machine when all data file (must Master waits) Copy falls to also go to original method,Do not recommend such way commonly nevertheless,Sp_attach_db is better,Although bother a lot of.

But,When general database breaks down, the system is may not can have time to wait for half-baked general affairs and dirty page those who write disk,Such circumstance Sp_attach_db can fail.So,Sent expectation to make a good disaster reinstate a plan at DBA.Plan according to your refreshment,Reductive and newest complete backup,Increment backs up or clerical log backs up,If if log of your mobile general affairs still can be read,coming out next,Congratulation you!You are OK and reductive the condition to the front of break down.

Common unit is the DBA that does not have full-time,If do not have practicable to back up,May be the time that backs up recently more too ages ago and cause not acceptability data loss,And log of your mobile general affairs also is in the position that cannot use,That is the most troubled condition.

Unfortunate is,General database breaks down is as a result of what memory subsystem causes,And such circumstance is almost impossible to practicable log is used at what restore.
So was forced to try these scheme.Of course,It is a requirement at least your data file is existence,If if data file, log file is mixed,backup was done not have,Do not look for me,You can go up to building top sing " god ah,Save save me " .

Above all,You can try Sp_attach_single_file_db,The data file that tries to restore you,Although can restore possibility is not large,If if this database just carried out a Checkpoint,passing,Succeed likely still.

If you had been done not have to the luck that has tombola bill,The most important database did not expect like you go on Attach in that way,Not crestfallen,Still have other program.

We can try to build a Log afresh,Install the database first for Emergency Mode,The Status of Sysdatabases states for 32768 the database is in this condition.

Nevertheless systematic watch is cannot change casually,Install first
Use Master
GoSp_configure 'allow Updates' , 1Reconfigure With Override
Go
NextUpdate Sysdatabases Set Status = 32768 Where Name = '%26lt;db_name%26gt;'
Now,Of Buddha of invocatory full deity bless,Build file of a Log afresh.Successful opportunity is quite great still,The system can approbate you to build the daily record that establish commonly.If did not report what is wrong,Can loosen now at a heat.

Although data was to restore,But do not think the thing calculates,finished,The work that having is missing for certain,Original data gets possibly also a few attaint.

Start SQL Server afresh first,The database that checks you next.
Set odd user pattern first,Do Dbcc nextSp_dboption '%26lt;db_name%26gt;' , 'single User' , 'true'
DBCC CHECKDB('%26lt;db_name%26gt;' )
If do not have what big question to be able to change database position,went back,The modification option that writes down so that did not forget to express the system is put out.Update Sysdatabases Set Status = 28 Where Name = '%26lt;db_name%26gt;'- - of course your database condition may not be this,The value with him appropriate instead.Also can use Sp_resetstatusGoSp_configure 'allow Updates' , 0Reconfigure With Override
Go
Checkdb when the report has the possibility a few mistakes,These erroneous data you may be forced to discard.Checkdb has option of a few kinds of rehabilitate,Oneself are looked at with,Nevertheless you may be returned finally is use REPAIR_ALLOW_DATA_LOSS,Complete all repair.Chekcdb can not complete all repair,We need further repair,To each with DBCC CHECKTABLE the watch makes an inspection.
The list of the watch can be used get inside Sysobjects,OBJECTPROPERTY be IsTable is all seek an inspection,Basically can solve a problem so,If return report error,Try to check data Select Into to another piece of watch.
After these finished,Wait for process of all index, view, memory, trigger to be built afresh.DBCC DBREINDEX perhaps can give you a few help.

Related:

收藏到网摘:

Submit: