Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

This question already has an answer here:

I have set up log shipping between 2 SQL Servers (SQL Server 2008 and SQL Server 2012),

At first i took a full backup of the first one and restored it on the other one and than i set up the log shipping,

The databases first backup-restore took a few hours and i wish to know:

  • how does the log shipping process knows from when to start the logs it is shipping? does it start from when the last backup-restore process happened or from the moment the log shipping itself is set ?
  • Can i be sure that no information was lost in these few hours ?

Thanks

share|improve this question
add comment

migrated from stackoverflow.com Jul 14 '13 at 20:21

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Marian, ypercube, Mikael Eriksson, Mark Storey-Smith, Kin Jul 14 '13 at 23:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 1 down vote accepted

The way log shipping works is by taking the data written to the log file and writing it to a file. The database log is written sequentially and has an ID (log sequence ID) associated with each entry. When a transaction backup is taken, it starts with the next LSN after the last backup. When the backup completes, an entry is written to the database that states the start and end of the backup.

LSN Explained: http://msdn.microsoft.com/en-us/library/ms190411(v=sql.105).aspx

For example:

LSN

1 -> Start of log backup #1

2

3

4 <- End of log backup #1

5 -> Start of log backup #2

6

7 <- End of log backup #3

8

9

share|improve this answer
add comment

You can use log shipping to send transaction logs from one database (the primary database) to another (the secondary database) on a constant basis. Continually backing up the transaction logs from a primary database and then copying and restoring them to a secondary database keeps the secondary database nearly synchronized with the primary database.

Here is the answer of your questions - If configured correctly then log shipping software start from the point the last backup-restore process happened - The Answer of your second question is really depends upon how you configure it.

As we are using red gate software and we are taking backup after every 15 minutes and in this way we can lost maximum of 15 minutes of data, as the secondary database nearly synchronized with the primary database.

hopw it will help.

You can read more Monitor Log Shipping

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.