A Project Project platform (PWA) outage occurs unexpectedly and the configuration database Sharepoint_config ldf is accidentally deleted and cannot be attached if the MDF file is attached directly.
Try sp_attach_single_file_db recovery first, and do the following:
sp_attach_single_file_db ' Sharepoint_config ', ' D:/program files/microsoft SQL server/mssql.1/mssql/data/sharepoint_ Config.mdf '
An error message appears:
File activation failed. Physical file name ' D:/program files/microsoft SQL server/mssql.1/mssql/data/sharepoint_config_log. LDF ' may not be correct.
The log could not be rebuilt because the database was not completely shut down.
Message 1813, Level 16, State 2, line 1th
Unable to open new database ' Sharepoint_config '. CREATE DATABASE aborted.
Then try the following steps:
1. New Sharepoint_config Database
2. Stop SQL SERVER 2005, overwrite the original sharepoint_config. mdf database file with the newly created sharepoint_config. mdf database file, restart the database,
The tables in the database are not read correctly at this time.
3. Set the database to a state of emergency:
ALTER DATABASE sharepoint_config SET emergency
When the data is in a critical state, the tables in the library can read
4. Execute the following code:
Use master
DECLARE @databasename varchar (255)
Set @databasename = ' Sharepoint_config '--set variable to data name
exec sp_dboption @databasename, n ' single ', n ' true '--set database to Single-user state
DBCC CHECKDB (@databasename, Repair_allow_data_loss)
DBCC CHECKDB (@databasename, Repair_rebuild)
exec sp_dboption @databasename, n ' single ', n ' false '--set target data base to multiuser state
The database is normal.