No agricultural log file restores database method two

xiaoxiao2021-03-06  13

In the case of the database log file, the database is restored. 1. Newly built a newly named database 2. Stop SQL Server (notice to separate the database) 3. Overwrite this newly built database 4 with the original database data file After restarting SQL Server5. When you open Enterprise Manager, you will be suspicious. No matter, you will perform the following statement (pay attention to modify the database name) 6. You can usually access data in the database after completion. At this time, the database It is generally issued, the solution is to create a new database with the database's script, and the data is introduced in. ISE mastergosp_configure 'allow updates', 1 reconfigure with overridegoupdate sysdatabases set status = 32768 where name =' quenched Database Name 'gospase', 'Single User', 'True'godbcc Checkdb (' Troubleshooting Database Name ") GOUPDATE SYSDATABASS set status = 28 where name = 'Quarantined database name' goSP_configure 'allow updates', 0 Reconfigure with overridego sp_dboption 'The cause of the database name', 'Single User', 'False'go method two things yesterday, the system administrator told me that the disk space where we have internal application database is inadequate. I noticed that the database event log file XXX_DATA.LDF file has grown to 3GB, so I decrease the log file. After the failure of the contracting database, I made a maximum and fooling error since I have entered the industry: I accidentally deleted this log file! Later, I saw all the discussions and database recovery articles: "If you have to ensure that the database log file exists, it is critical, even Microsoft even has a KB article how to recover only by log files. I really don't know what I think at that time? ! This is broken! This database can't be connected, and the enterprise manager is written next to its "(quenus)". And the most important, this database never backed up. I found some of the database server for half a year ago, it can be used, but there are fewer records, tables, and stored procedures. I really hope this is just a nightmare! Recovery steps, additional databases _Rambo speaking that there is no activity log in the deleted log file, can be restored: 1. Separate database, you can use sp_detach_db2, additional database, you can use sp_attach_single_file_db but, regret After execution, SQL Server questioned that the data files and log files do not match, so they cannot attach the database data file. The DTS data export cannot be read, and the XXX database cannot be read. The DTS Wizard reports "Initialization context has an error".

Emergency mode Yihong Bani said that there is no log for recovery, can do this: 1. Set the database to Emergency Mode 2, re-establish a log file 3, restart SQL Server to set up 4, set the application database to single user Mode 5, do DBCC CHECKDB6, if there is no big problem, you can change the database status. Remember to turn off the system table's modification options. I practiced, remove the data file of the application database, and re-establish one. The same name's database XXX, then stop the SQL service, cover the original data file back. Thereafter, walk according to the steps of the Yihong Mon. However, it is also unfortunate that other steps are very successful in addition to step 2. Unfortunately, after restarting SQL Server, this application database is still quilted! However, let me be pleased, after doing this, it is able to select data, let me take a breath. However, when the component uses the database, the report says: "An error: -2147467259, Begin Transaction cannot be run in the database 'xxx' because the database is in an evasive recovery mode." Final successfully recovered all steps to set the database to emergency mode ü Remove the SQL Server service; u removes the data file xxx_data.mdf of the application database; u Re-establish a database XXX; u stops the SQL service; Ü I turn back the original data file; ü Run the following statement, Set the database to emergency mode; run "Use mastergosp_configure 'allow updates', 1Reconfigure with overridego" execution: DBCC is executed. If DBCC outputs an error message, contact your system administrator. The configuration option 'allow updates' has been changed from 0 to 1. Run the Reconfigure statement to install. Then run "update sysdatabase set status = 32768 where name = 'xxx'" execution results: (The number of rows affects is 1 line) ü Restart SQL Server service; ü Run the following statement, set the application database to Single User mode; run "Sp_dboption 'XXX', 'Single User', 'True'" execution result: The command has been successfully completed. Ü DBCC Checkdb; run "DBCC Checkdb ('xxx')" execution result: 'xxx' DBCC results. 'sysObjects' DBCC results. Object 'sysObjects' has 273 rows, which are located in page 5. 'sysindexes' DBCC results. Object 'sysIndexes' has 202 rows, which are located in page 7. 'syscolumn' 's DBCC results.

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

New Post(0)