| Back to logs list
326378 2010 年 12 月 09 日 14:17 Reading (loading. ..) Comments (0) Category: SQL database
any database system can not avoid the collapse of the state, even if you use the Clustered, hot standby ... ... still can not completely eradicate the system of single point of failure, not to mention for most users, can not afford such expensive hardware investments. Therefore, when a system crash, how to restore the original data has become an extremely valuable important problem.
in the recovery time,
lebron james shoes, the best thing you can do the data files and log files are intact, and that only sp_attach_db, attach the data file to a new database or you can simply shut down when all data file (must have a master,
nba basketball shoes, etc.) copy to the original path also, but generally do not recommend this approach, sp_attach_db better, although the trouble many.
But hey, when the collapse of the general database system may not have time to complete the transaction and not so dirty pages to disk, so that the situation sp_attach_db will fail. So expect to send DBA to develop a good disaster recovery plan it. According to your recovery plan, restore the latest full backup, incremental backup or transaction log backup, then the active transaction log if you can read it, then congratulations! You can revert to the state before the collapse.
units are generally not full-time DBA, and if there is no backup is available, more likely to be the most recent backup of the time is too long and result in unacceptable data loss, and the transaction log of your activities are in an unusable state That is the most troublesome situation.
Unfortunately, it is a general database crashes are caused by the storage subsystem, and this situation is almost impossible to log is available for recovery.
then had to try out these programs. Of course, is to require at least your data files exist, if the data files, log files and backup are not the words, do not find me, you can go up to the roof to sing
First of all,
nike lebron, you can try sp_attach_single_file_db, try to restore your data files,
lebron james vii, although unlikely to recover, but if the implementation of this database is just a checkpoint, then it is possible to succeed.
If you do not feel good to have the luck lottery, the most important database is not like you'd expect attach up, do not despair, there are other programs.
We could try to create a log, first set the database to emergency mode, sysdatabases's status as the 32768, says the database is in this state.
but the system tables could not be changed, and set about the first
then
now, pray the sky deities bless it, to re-create a log file. Chance of success is still quite large, the system will usually recognize your newly created log. If you did not report any errors can breathe now.
Although the data is restored, but do not think it even completed, the transaction is definitely being lost, the original data may also be some damage.
first look at SQL Server restart,
kobe bryant v, then check your database now.
first set into single user mode, then do dbcc
no big problem if the database state can be changed back, I remember do not forget to change the system option off the table. update sysdatabases set status = 28 where name ='', of course, you may not be the database state,
cheap lebron shoes, their right to appropriate values. Can also use
checkdb likely to report when there is something wrong, the wrong data you may have to drop out.
checkdb There are several repair options, your watch with it, but then you may still have REPAIR_ALLOW_DATA_LOSS, complete all the repair.
chekcdb can not complete all the repair, we need further repair, using DBCC CHECKTABLE check on each table to do it.
sysobjects table inside the list can be put OBJECTPROPERTY is IsTable check to find out all of it, this can basically solve the problem, if it reports an error, try to select into the data to another table to check .
after these are done, all the indexes, views, stored procedures, triggers and other re-establish it. DBCC DBREINDEX may help you some help.