Monday, March 26, 2012

Recataloging a log backup disk file

Backup Log DataBaseName to
DISK='\\ServerName\ShareName\Path\FileName.TRN' with
RetainDays=1, Description='Daily Backup Routine'
When I restore a database and logs to an alternate
server, I can restore the full database backup and the
first iteration of the log backups without any problems.
The problem is with all subsequent log backups that were
performed and apended to the file created by the above
statement. I know and can get to the subsequent appended
logs via TSQL, but not an easy task if there are 15
appended log backups on the device. Is there a way I can
recatalog all the log backups so I can use Enterprise
Manager's point an click interface to restore? Will the
STOPAT parameter restore the first log backup, and all
subsequent backups, up to the STOPAT? The command used
to create the log backup is stated above.
Thanx soo much for your help,
D2David,
> Is there a way I can
> recatalog all the log backups so I can use Enterprise
> Manager's point an click interface to restore?
Not easily. I guess you can write a TSQL script that uses RESTORE HEADERONLY and based on that
inserts data into the backup history tables in msdb. Note that *this is not supported*! EM has an
option to generate backuphistory as you select a backup device in the restore dialog, but that isn't
dine on a file basis, but on a backup basis, so using EM to generate backuphistory, you would have
to go through that dialog 15 times.
> Will the
> STOPAT parameter restore the first log backup, and all
> subsequent backups, up to the STOPAT?
No. All RESTORE commands only addresses one backup at a time.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Danh" <anonymous@.discussions.microsoft.com> wrote in message
news:370101c4a05d$53fc68b0$a501280a@.phx.gbl...
> Backup Log DataBaseName to
> DISK='\\ServerName\ShareName\Path\FileName.TRN' with
> RetainDays=1, Description='Daily Backup Routine'
> When I restore a database and logs to an alternate
> server, I can restore the full database backup and the
> first iteration of the log backups without any problems.
> The problem is with all subsequent log backups that were
> performed and apended to the file created by the above
> statement. I know and can get to the subsequent appended
> logs via TSQL, but not an easy task if there are 15
> appended log backups on the device. Is there a way I can
> recatalog all the log backups so I can use Enterprise
> Manager's point an click interface to restore? Will the
> STOPAT parameter restore the first log backup, and all
> subsequent backups, up to the STOPAT? The command used
> to create the log backup is stated above.
> Thanx soo much for your help,
> D2
>|||Thanks for the help... I ended up doing this...
RESTORE VERIFYONLY FROM DISK='FilePath' WITH
FILE=#,LOADHISTORY
Replaced the # with 1 2 3 4 5 6 7 ...
I just wish it can be done with one command.
>--Original Message--
>David,
>> Is there a way I can
>> recatalog all the log backups so I can use Enterprise
>> Manager's point an click interface to restore?
>Not easily. I guess you can write a TSQL script that
uses RESTORE HEADERONLY and based on that
>inserts data into the backup history tables in msdb.
Note that *this is not supported*! EM has an
>option to generate backuphistory as you select a backup
device in the restore dialog, but that isn't
>dine on a file basis, but on a backup basis, so using EM
to generate backuphistory, you would have
>to go through that dialog 15 times.
>> Will the
>> STOPAT parameter restore the first log backup, and all
>> subsequent backups, up to the STOPAT?
>No. All RESTORE commands only addresses one backup at a
time.
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>http://www.solidqualitylearning.com/
>
>"David Danh" <anonymous@.discussions.microsoft.com> wrote
in message
>news:370101c4a05d$53fc68b0$a501280a@.phx.gbl...
>> Backup Log DataBaseName to
>> DISK='\\ServerName\ShareName\Path\FileName.TRN' with
>> RetainDays=1, Description='Daily Backup Routine'
>> When I restore a database and logs to an alternate
>> server, I can restore the full database backup and the
>> first iteration of the log backups without any
problems.
>> The problem is with all subsequent log backups that
were
>> performed and apended to the file created by the above
>> statement. I know and can get to the subsequent
appended
>> logs via TSQL, but not an easy task if there are 15
>> appended log backups on the device. Is there a way I
can
>> recatalog all the log backups so I can use Enterprise
>> Manager's point an click interface to restore? Will
the
>> STOPAT parameter restore the first log backup, and all
>> subsequent backups, up to the STOPAT? The command used
>> to create the log backup is stated above.
>> Thanx soo much for your help,
>> D2
>
>.
>

No comments:

Post a Comment