Hello folks,
I am having an interesting issue with backup (from a SQL2005+SP3 Instance) restore (to SQL2012+SP1).
I performed DBCC CHECKDB before this in the SQL 2005 instance before this operation and no error appeared.
There are 3 data files, 3 FULLTEXT files and one T-Log file currently. There were two T-Log files of the mentioned database but I removed one of them as it was unnecessary a while ago.
SQL Server 2012 restores the database "successfully", however when I query sys.master_files, I see the deleted T-Log file when the database was in SQL 2005 instance. This is a new backup file, how can that deleted file record be there? When I get to the SQL 2005 instance and query the sys.master_files, I do not see that record which is expected because I deleted it about 1 month ago. I also see some FULLTEXT file records as a Data file instead of FULLTEXT record in the SQL 2012 instance. For instance, when I open Shrink Files interface in the SSMS, I see one of the FULLTEXT files in the Logs combobox which is unexpected for sure and that's for sure there's a problem with the records.
I first realized this problem when I tried to perform a backup to see the compression ratio and backup operation failed with this error: "BACKUP DATABASE is terminating abnormally. Inconsistent metadata has been encountered. The only possible backup operation is a tail-log backup using the WITH CONTINUE_AFTER_ERROR or NO_TRUNCATE option. An error occurred while processing 'BackupMetadata' metadata for database id 8 file id 1."
I tried to perform a DBCC CHECKDB in the SQL 2012 instance and it is completed with no errors.
I tried detaching the database from the SQL 2012 instance and attach with proper info regarding to the file paths etc and it failed saying there's a problem with the T-Log file. Error msg: "An error occurred while processing the log for database 'X'. If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log."
I restored the database all over again and restarted the SQL 2012 database engine service in single user mode and updated the sysaltfiles manually (desperately) and again restarted the service without the -m switch and it failed to open the database saying there might be a problem with the T-Log file.
I can successfully restart the SQL Server 2005 Database Engine service without any of these kind of problems with the mentioned database.
I want to stress out that I tried this all with another day's backup file too and the results are the same.
Now, I am performing some other tests such as:
- I am installing a SQL 2008 Eval instance to see if I'll face this problem with it too.
- I am also restoring the database using RESTORE DATABASE command and for now sys.master_files records look OK.
I am performing these because we are planning to upgrade our SQL Server instances. Any help/idea would be appreciated.
Ekrem Önsoy - MCDBA, MCITP:DBA+DBD, MCSD.Net, MCSE, ITILv3 | http://ekremonsoy.blogspot.com