The simplest way is
1: Create a new database with the same path name and files.
2. Disable the SQL Server service;
3: COPY the source file;
4: enable the SQL Server Service to solve the problem.
If the above method cannot be solved, we can refer to the following method.
1. Change the database to emergency mode.
The code is as follows: |
Copy code |
Alter database Netshield SET EMERGENCY |
2. Change database to single-user mode
The code is as follows: |
Copy code |
Alter database Netshield SET SINGLE_USER |
Run Again
The code is as follows: |
Copy code |
DBCC CheckDB (Sharepoint_Config, REPAIR_ALLOW_DATA_LOSS) |
If a warning is displayed after the fix: the database 'sharepoint _ config' log has been regenerated. Transaction consistency is lost. The RESTORE chain is disconnected, and the server no longer has the context of the previous log files. Therefore, you need to understand their content. Dbcc checkdb should be run to verify physical consistency. The database is already in dbo-only mode. When preparing to make the database available, you need to reset the database option and delete all redundant log files.
"The error can be further viewed.
4. Re-open Microsoft SQL Server Management Studio to change the database back to multi-user mode.
The code is as follows: |
Copy code |
Alter database into point_config SET MULTI_USER |
5. Start-> Run-> enter cmd-> open the doscommand window, and enter the following command to restart the database service.
The code is as follows: |
Copy code |
Net stop mssqlserver -- stop the service Net start mssqlserver -- start the service |