BUG: Recovery of Database Logical File Names Might Fail After a RESTORE Operation (817089)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
BUG #: 356866 ( SQL Server 8.0) SYMPTOMSWhen you restore a database, recovery of logical file names
of the database can fail, and the logical file names that correspond to the
database in the master..sysaltfiles and the <Database_name>..sysfiles tables may differ.CAUSEWhen you perform a backup and restore operation with a
database that is in full recovery mode, this problem occurs if you modify the
logical file names in the database after you back up the database but before
you back up the transaction log.WORKAROUNDIf you are already experiencing this problem, follow these
steps to work around the problem:
- Change the logical file names to names that are different
from the names that you want to use.
- Rename the logical file names to the names that you
want.
Note If you directly rename the logical files to the names that you
want, the rename operation might fail because the new names already exist and
are updated in one of the system tables. Therefore, you must rename the logical
files to some other name, and then rename them to the names that you want. Make
sure that you take the database and log backups after renaming.
To avoid this problem when you want to modify logical file
names, follow these steps (in the same sequence):
- Rename a logical file name in the database. For example:
ALTER DATABASE <DATABASENAME> MODIFY FILE (NAME = <Old file name> NEWNAME = <New file name>) GO - Back up the database and the transaction log files. For
example:
BACKUP DATABASE <Database name> TO DISK= '<Backup file with path>' GO BACKUP LOG <Database name> TO DISK= '<Backup file with path>' GO - Restore the database and the log files. For example:
RESTORE DATABASE <Database name> FROM DISK = '<Disk drive>' WITH FILE = <File number>, NORECOVERY GO RESTORE LOG <database name> FROM DISK = '<disk drive>' WITH FILE = <file number>, RECOVERY GO Note Verify the master..sysaltfiles and < Database_name>.. sysfiles to make sure that there is no mismatch. STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbBackup kbTSQL kbbug KB817089 kbAudDeveloper |
---|
|