Database recovery

xiaoxiao2021-03-06  50

Database: MSSQL Server 2000 Enterprise Edition Description: Database is suspicious. Data library backup files are corrupted. Copy the database physical file (* .mdf), use the database additional function, additional failed. Tip error: Server: Message 1813, Level 16, State 2, Row 1 Failed to open the new database 'test'. CREATE DATABASE will terminate. Device activation errors. Physical file name 'd: /test_log.ldf' may be incorrect. The search related information solutions are as follows: a. We use the default way to create a database (such as Test) for recovery. Can be established in SQL Server Enterprise Manager. B. Stop the database server. C. Remove the log file test_log.ldf generated by the database you just generated, override the database data file Test_Data.mdf you just generated with the database MDF file to be recovered. D. Start the database server. At this time, you will see the status of the database TEST is "Troubleshoot". This will not do anything about this database. E. Setting the database to allow direct operating system tables. This action can select a database server in SQL Server Enterprise Manager, press Right-click, select "Properties", and "Allow Direct Modifications to System Directory" in the Server Settings page. You can also use the following statement to be used. Use mastergosp_configure 'Allow Updates', 1GO Reconfigure with Overridegof. Set TEST for emergency repair mode Update sysdatabases set status = -32768 where dbid = db_id ('test') can see the database in SQL Server Enterprise Manager can see the database in "Read / quenus / offline / emergency mode" Go to the table in the database, but just system table G. In the execution of the true recovery operation, rebuild database log file DBCC Rebuild_log ('Test', 'C: / Program Files / Microsoft SQL Server / MSSQL / DATA / TEST_LOG.LDF') If you encounter the following prompt information: Server : Message 5030, Level 16, State 1, Row 1 Fails to lock the database to perform this operation. DBCC is executed. If DBCC outputs an error message, contact your system administrator. Note that your other programs are using the database. If you just open the Test library system table in F step, you can use the SQL Server Enterprise Manager. Correctly performing the prompt should be similar to: Warning: The log 'Test' log has been rebuilt. The consistency of the transaction has been lost. DBCC CHECKDB should be run to verify physical consistency. The database option must be reset, and you may need to delete an extra log file. DBCC is executed. If DBCC outputs an error message, contact your system administrator. This time, open in SQL Server Enterprise Manager will see the status of the database is "for DBO only". At this point you can access the user table inside the database. H. Verify database consistency (omitted) DBCC CHECKDB ('test') The general execution result is as follows: checkdb discovers 0 assignment errors and 0 consistency errors (in database 'test'). DBCC is executed.

转载请注明原文地址:https://www.9cbs.com/read-82346.html

New Post(0)