SQL Server database is suspicious after resolution

xiaoxiao2021-03-31  203

Phenomenon: The database log log is too large, Shrink can't fall. So I want to remove the database file, delete the log, and add it. Additional failed. Tip error: Server: Message 1813, Level 16, State 2, Row 1 Failed to open the new database 'metadb'. CREATE DATABASE will terminate. Device activation errors. The physical file name 'd: /metadb.ldf' may be incorrect. Environment: MSSQL Server 2000 Enterprise Edition

Solution process: 1. Built a new library newdb2. Stop the database. Delete the log file of the new library, so that metadb.mdf overrides NewDb.mdf. 3. Start the database server. The status of the database newDB is "query". 4. Allows the system directory to modify Use masterGOSP_Configure 'allow updates', 1GO Reconfigure with overridegoupdate sysdatabases set status = -32768 where dbid = db_id ('newdb') 5. Rebuild logDBCC rebuild_log ('newdb', 'c: / program files / microsoft sql server / mssql / data / newdb_log.ldf') 6.DBCC Check DBCC CHECKDB ('newDB') 7. Setting the database is normal SP_DBOPTION 'newDB' 'DBO USE ONLY', 'False'8 does not allow sp_configure' allow updates' to the system directory, 0go Reconfigure with OverrideGo

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

New Post(0)