Title: MS-SQL restore fails with Logical file 'DB_Name' is not part of database 'corrupt_DB'
Date: Jul 2006
NV Version: N/A
OS Version: Windows 2003
Application version: 8/2000
Plugin version: 4.108
SQL database corruption can prevent the normal restore (rename/relocate) and recovery of an MS SQL database
Error 2006/07/20 11:53:33 664 Data Plugin NVclient [Microsoft][ODBC SQL Server Driver][SQL Server]Logical file 'your_DB_Name' is not part of database 'your_corrupt_DB'. Use RESTORE FILELISTONLY to list the logical file names.
The corruption means that the transaction log cannot be truncated, leaving a disproportionately large transaction log, e.g.;
19/10/2006 03:07 3,377,594,368 your_DB_Name.mdf
19/10/2006 03:07 5,971,968,000 your_DB_Name_log.ldf
The database can be repaired in this situation on the restore server
To fix the database corruption -
- Open Sql Query Analyzer
- Input "DBCC UPDATEUSAGE ('your_corrupt_DB')" in the main screen and wait.
- Detach and re-attach the database as a precaution
- Attempt to restore/relocate the database once more
If this resolves the naming corruption the rename/relocate restore will then work, otherwise the customer needs to contact Microsoft to resolve the corruption.
Another possible short term workaround -
The alternative is to restore the database back to the same server (or a recovered copy) with no rename or relocate options. The caveat is that this can mean that the database is unsavailable in the production environment
1- backup current corrupt database with netvault
2- restore the desired backup copy directly on top of the sql server database
3- rename the restored database with MS-SQL server
4- perform another restore of affected database using the latest backup taken at the beginning of the procedure