Hello,
How can I check if backup log fiile is first log backup after database
backup ?
f.e. I have 1 database backup file ( BACKUP DATABASE x TO DISK = ...)
and 10 log backup files ( BACKUP LOG x TO DISK='...)
I want to be sure that noone have removed the fist log file. using T-SQL :)
To create order in backkup log files i'm using FistLSN and LastLSN collumns
of RESTORE HEADERONLY procedure. But i dont know how to connect them to
database backup.
Any ideas ?
--
Best Regards
Wojciech ZnanieckiTry checking table backupset in database msdb. Something like:
select
backup_set_id,
type,
backup_start_date,
backup_finish_date
from
msdb..backupset
where
database_name = 'your_db'
and type = 'L'
and backup_start_date > (select top 1 backup_finish_date from
msdb..backupset where database_name = 'your_db' and type = 'D' order by
backup_start_date desc)
order by
backup_start_date;
AMB
"Wojtek Z" wrote:
> Hello,
> How can I check if backup log fiile is first log backup after database
> backup ?
> f.e. I have 1 database backup file ( BACKUP DATABASE x TO DISK = ...)
> and 10 log backup files ( BACKUP LOG x TO DISK='...)
> I want to be sure that noone have removed the fist log file. using T-SQL :)
> To create order in backkup log files i'm using FistLSN and LastLSN collumns
> of RESTORE HEADERONLY procedure. But i dont know how to connect them to
> database backup.
> Any ideas ?
> --
> Best Regards
> Wojciech Znaniecki
>
>|||Thanks - i havent known that. But how about restoring db to a different
server ?
--
Best Regards,
Wojciech Znaniecki
U¿ytkownik "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com>
napisa³ w wiadomo¶ci
news:9DBEE13B-A899-4BF5-8E29-DA24F801F335@.microsoft.com...
> Try checking table backupset in database msdb. Something like:
> select
> backup_set_id,
> type,
> backup_start_date,
> backup_finish_date
> from
> msdb..backupset
> where
> database_name = 'your_db'
> and type = 'L'
> and backup_start_date > (select top 1 backup_finish_date from
> msdb..backupset where database_name = 'your_db' and type = 'D' order by
> backup_start_date desc)
> order by
> backup_start_date;
>
> AMB
> "Wojtek Z" wrote:
> > Hello,
> > How can I check if backup log fiile is first log backup after database
> > backup ?
> > f.e. I have 1 database backup file ( BACKUP DATABASE x TO DISK = ...)
> > and 10 log backup files ( BACKUP LOG x TO DISK='...)
> > I want to be sure that noone have removed the fist log file. using T-SQL
:)
> >
> > To create order in backkup log files i'm using FistLSN and LastLSN
collumns
> > of RESTORE HEADERONLY procedure. But i dont know how to connect them to
> > database backup.
> > Any ideas ?
> >
> > --
> > Best Regards
> > Wojciech Znaniecki
> >
> >
> >|||My guess is that the first log backup's FirstLsn need to be prior to the database backup's FirstLsn.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Wojtek Z" <wojtas_z@.poczta.fm> wrote in message news:d5upv9$174$1@.nemesis.news.tpi.pl...
> Thanks - i havent known that. But how about restoring db to a different
> server ?
> --
> Best Regards,
> Wojciech Znaniecki
> U¿ytkownik "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com>
> napisa³ w wiadomo¶ci
> news:9DBEE13B-A899-4BF5-8E29-DA24F801F335@.microsoft.com...
>> Try checking table backupset in database msdb. Something like:
>> select
>> backup_set_id,
>> type,
>> backup_start_date,
>> backup_finish_date
>> from
>> msdb..backupset
>> where
>> database_name = 'your_db'
>> and type = 'L'
>> and backup_start_date > (select top 1 backup_finish_date from
>> msdb..backupset where database_name = 'your_db' and type = 'D' order by
>> backup_start_date desc)
>> order by
>> backup_start_date;
>>
>> AMB
>> "Wojtek Z" wrote:
>> > Hello,
>> > How can I check if backup log fiile is first log backup after database
>> > backup ?
>> > f.e. I have 1 database backup file ( BACKUP DATABASE x TO DISK = ...)
>> > and 10 log backup files ( BACKUP LOG x TO DISK='...)
>> > I want to be sure that noone have removed the fist log file. using T-SQL
> :)
>> >
>> > To create order in backkup log files i'm using FistLSN and LastLSN
> collumns
>> > of RESTORE HEADERONLY procedure. But i dont know how to connect them to
>> > database backup.
>> > Any ideas ?
>> >
>> > --
>> > Best Regards
>> > Wojciech Znaniecki
>> >
>> >
>> >
>|||U¿ytkownik "Tibor Karaszi"
<tibor_please.no.email_karaszi@.hotmail.nomail.com> napisa³ w wiadomo¶ci
news:OcqdnSvVFHA.3320@.TK2MSFTNGP12.phx.gbl...
> My guess is that the first log backup's FirstLsn need to be prior to the
database backup's FirstLsn.
Thanks ! thats it.
--
Best Regards,
Wojciech Znaniecki
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment