Hi, I am trying make a copy our Production DB from a backup & running into issues described below
Basically I am trying to
1. Restore the MyDB as the MyDB2 with NORECOVERY & also move/replace the data/log logical files
2. Restore the Log Files (backed up hourly) with NORECOVERY
3. Restore the MyDB2 with RECOVERY & finalize it
The issue we are running is that
1. We can restore the DB ONLY with REPLACE option, but that means we cannot restore the Logs incrementally as the db is allready recovered
2. Unable to restore the DB using the NORECOVERY option and get "The tail of the log for the database "PT" has not been backed up." error (not sure is there is something wrong with the backup OR its because we're trying to restore to a new DB (other than the one it was backed up))
Command to restore the db & restore the mdf/ldf files + move an extra file -
EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [MyDB2] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\FULL_(local)_MyDB_20130110_000102.sqb' WITH NORECOVERY, MOVE N'MyDB_Data' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10.QA\MSSQL\Data\MyDB2.mdf', MOVE N'MyDB_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10.QA\MSSQL\Data\MyDB2.ldf' "'
SQL error 3013: SQL error 3013: RESTORE DATABASE is terminating abnormally.
SQL error 3159: SQL error 3159: The tail of the log for the database "MyDB2" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the
RESTORE statement to just overwrite the contents of the log.
On trying to restore the logs, I am getting
EXECUTE master..sqlbackup '-SQL "RESTORE LOG MyDB2 FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\LOG_(local)_MyDB_20130109_180201.sqb' WITH NORECOVERY" '
SQL error 3013: SQL error 3013: RESTORE LOG is terminating abnormally.
SQL error 3117: SQL error 3117: The log or differential backup cannot be restored because no files are ready to rollforward.
Any ideas?
(Disclaimer : I am not a DBA & have limited database knowledge)
Basically I am trying to
1. Restore the MyDB as the MyDB2 with NORECOVERY & also move/replace the data/log logical files
2. Restore the Log Files (backed up hourly) with NORECOVERY
3. Restore the MyDB2 with RECOVERY & finalize it
The issue we are running is that
1. We can restore the DB ONLY with REPLACE option, but that means we cannot restore the Logs incrementally as the db is allready recovered
2. Unable to restore the DB using the NORECOVERY option and get "The tail of the log for the database "PT" has not been backed up." error (not sure is there is something wrong with the backup OR its because we're trying to restore to a new DB (other than the one it was backed up))
Command to restore the db & restore the mdf/ldf files + move an extra file -
EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [MyDB2] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\FULL_(local)_MyDB_20130110_000102.sqb' WITH NORECOVERY, MOVE N'MyDB_Data' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10.QA\MSSQL\Data\MyDB2.mdf', MOVE N'MyDB_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10.QA\MSSQL\Data\MyDB2.ldf' "'
SQL error 3013: SQL error 3013: RESTORE DATABASE is terminating abnormally.
SQL error 3159: SQL error 3159: The tail of the log for the database "MyDB2" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the
RESTORE statement to just overwrite the contents of the log.
On trying to restore the logs, I am getting
EXECUTE master..sqlbackup '-SQL "RESTORE LOG MyDB2 FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\LOG_(local)_MyDB_20130109_180201.sqb' WITH NORECOVERY" '
SQL error 3013: SQL error 3013: RESTORE LOG is terminating abnormally.
SQL error 3117: SQL error 3117: The log or differential backup cannot be restored because no files are ready to rollforward.
Any ideas?
(Disclaimer : I am not a DBA & have limited database knowledge)