Tuesday, March 27, 2012

Determine next LSN for a Recovering database

Using SQL 2005. Is it possible to determine the LastLSN of a database that
is in "Recovering" mode?
I have a bunch of TransactionLog backups. Some have been restored to that
Recovering database and some have not. Is it possible to "query" the
Recovering database (or inspect the MDF/LDF files) to discover which LSN is
the "Current LastLSN"? If I know that, then I'll know which TransactionLog
backup needs to be restored next.
And to make it more challenging, what if the Recovering database was
restored from a SQL2000 database backup? The TransactionLog backups are
obviously from that same SQL2000 database.
Thanks,
Rob
Over 2 years ago, we went through a recovery. Without knowing exactly, it
does seem to me the LSN is listed in the wizard dialog when you restore from
a given transaction log. That was 2000, not 2005. Functionality generally
remains the same ...Fairly certain that it shows up as one of the column
headers.
http://msdn2.microsoft.com/en-us/library/ms177446.aspx
Regards,
Jamie
"nexdeveloper" wrote:

> Using SQL 2005. Is it possible to determine the LastLSN of a database that
> is in "Recovering" mode?
> I have a bunch of TransactionLog backups. Some have been restored to that
> Recovering database and some have not. Is it possible to "query" the
> Recovering database (or inspect the MDF/LDF files) to discover which LSN is
> the "Current LastLSN"? If I know that, then I'll know which TransactionLog
> backup needs to be restored next.
> And to make it more challenging, what if the Recovering database was
> restored from a SQL2000 database backup? The TransactionLog backups are
> obviously from that same SQL2000 database.
> Thanks,
> Rob
|||Thanks for the reply Jamie. I believe what you are referring to is actually
the LSN information of the TransactionLog backup and not of the database.
After selecting a TransactionLog backup to restore, the wizard displays the
FirstLSN and LastLSN information for the TransactionLog backup.
Unfortunately, the wizard does not display which LSN the database actually
"needs". If it did, you could determine which of your TransactionLog backups
is next in line to be restored.
-rob
"thejamie" wrote:
[vbcol=seagreen]
> Over 2 years ago, we went through a recovery. Without knowing exactly, it
> does seem to me the LSN is listed in the wizard dialog when you restore from
> a given transaction log. That was 2000, not 2005. Functionality generally
> remains the same ...Fairly certain that it shows up as one of the column
> headers.
> http://msdn2.microsoft.com/en-us/library/ms177446.aspx
> --
> Regards,
> Jamie
>
> "nexdeveloper" wrote:
|||My posting of this question contained some incorrect terminology. Here it is
explained properly (I hope)
Using SQL 2005. Is it possible to determine the LastLSN of a database that
is in "Restoring" mode?
I have a bunch of TransactionLog backups. Some have been restored to that
Restoring database and some have not. Is it possible to query the
Restoring database (or inspect the MDF/LDF files) to discover which LSN is
the "current LastLSN"? If I know that, then I'll know which TransactionLog
backup needs to be restored next.
And to make it more challenging, what if the Restoring database was
restored from a SQL2000 database backup? The TransactionLog backups are
obviously from that same SQL2000 database.
Thanks,
Rob
|||Hi Rob,
I understand that you would like to know the current lastLSN value of your
restoring database so that you could know which transaction log backup was
to be restored next.
If I have misunderstood, please let me know.
As far as I know, it is hard to get that information from a restoring
database. Generally when we decide to restore a database, we need to
manually record the date, time and backup files that used to restore
database. The process has many steps which are recommended to be recorded.
However for this issue I will consult the product team to see if they could
give me some valuable information on this issue. I will let you know the
result as soon as possible if I get the answer.
If you have any other questions or concerns, please feel free to let me
know.
Sincerely yours,
Charles Wang
Microsoft Online Community Support
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

No comments:

Post a Comment