Disclaimer is non-original ~~~~
This article is a remedy for the following operations, for reference only:
1. The log file is already full, and the database is not possible;
2, according to some people's experience, first separate the database, stop SQL Server service, delete log files, and attach the MDF file failed.
The above operation 2 is basically applicable when the log file is not full.
Below is a repair method:
1. Put the original MDF file rename is *** _ 1.mdf, newly built a named database and *** _ TEMP database
2. Run the following statement to set the database to emergency mode;
Use master
Go
sp_configure 'allow updates', 1
Reconfigure with override
Go
Update sysdatabases set status = 32768 where name = '***'
3, stop the database service 4, override the MDF file, is the newly generated MDF file name RENAME is *** _ 2.mdf, *** _ 1.mdf rename is the original file name 5, restart the database service 6, through DTS brigad To *** _ TEMP
(1) Run the DTS Export Wizard;
(2) Replication Source Select the database XXX of EmergencyMode, import to XXX_TEMP;
(3) Select "Replication objects and data between SQL Server Database", try to make multiple times, it seems that all table structure is copied, but there is no data, no view and stored procedures, and the DTS wizard final report replication failure;
(4) So finally select "From Source Database Replication Table and View", but later discovered that it always copies part of the table record;
(5) Then select "Data to be transmitted with a query", which is missing which table record is, which is
7, generate scripting files for the original database via Enterprise Manager-> Tools-> Generate SQL Script; Run the script file 10, pass the data 11 via the DTS 11, restore the emergency mode settings of the database; use master
Go
sp_configure 'allow updates', 0
Reconfigure with override
Go
sp_resetstatus '***'
December 24, 2004 18:24:24