SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Log Shipping scans files but doesn't restore


Log Shipping scans files but doesn't restore

Author
Message
SQL_Bob
SQL_Bob
Valued Member
Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)

Group: General Forum Members
Points: 55 Visits: 408
I'm trying to setup the restore phase of log shipping, and it doesn't seem to want to restore. Running SqlLogShip.exe in the command line with -VerboseLevel 4 to return as much information as possible, but still not getting enough info.

My database was restored from a full backup WITH NORECOVERY and is in a restoring state. I have a folder with 100 transaction log backups, some of which are prior to the full backup, but most of which come after.

SqlLogShip.exe correctly determines the files that should be skipped and identifies which file is first to be restored, but then quits before performing any restores. It says the restore was successful, but 0 files were restored. Here's a few lines of the output:


Searching through log backup files for first log backup to restore. Secondary DB: 'DBName'
Skipped log backup file. Secondary DB: 'DBName', File: '<file path>'
...
Skipped log backup file. Secondary DB: 'DBName', File: '<file path>'
Found first log backup file to restore. Secondary DB: 'DBName', File: '<file path>'
The restore operation was successful. Secondary Database: 'DBName', Number of log backup files restored: 0


I don't see how this can be a permissions issue because I'm executing SqlLogShip.exe as myself (sysadmin, windows admin). SQL Server service account has correct permissions as well, and through profiler I can see calls to [master].[sys].[sp_can_tlog_be_applied] run against files in this folder. SQL Server can see and read the files in question, yet doesn't restore them. The SQL Server error log returns nothing of interest either.

Any ideas of what else I can try would be much appreciated!

_______________________________________________________________________________________________
Bob Pusateri
Microsoft Certified Master: SQL Server 2008

Blog: The Outer Join
Twitter: @SQLBob
csdunaway
csdunaway
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 236
Has your Log Shipping every worked for this database? It is possible that is is out of sync. You may nee to reload a new backup and try again.



SQL_Bob
SQL_Bob
Valued Member
Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)

Group: General Forum Members
Points: 55 Visits: 408
Good question. This is a new setup so no it has never worked before (because it has never been attempted). However I can successfully restore the log backups manually, so I know they are compatible and there's no reason from a backup/restore perspective that they shouldn't work.

I should also point out that the age of the files is within the retention period setting, so that shouldn't prevent a restore from occurring either.

_______________________________________________________________________________________________
Bob Pusateri
Microsoft Certified Master: SQL Server 2008

Blog: The Outer Join
Twitter: @SQLBob
csdunaway
csdunaway
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 236
Let me know if it still does not work. I have successfully setup hundreds of Log Shipping databases, with SQL Server 2008 R2 and SQL Server 2012.



SQL_Bob
SQL_Bob
Valued Member
Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)

Group: General Forum Members
Points: 55 Visits: 408
I'd say this behavior is pretty consistent - I have re-restored the full backup 4-5 times and have the same behavior each time.

_______________________________________________________________________________________________
Bob Pusateri
Microsoft Certified Master: SQL Server 2008

Blog: The Outer Join
Twitter: @SQLBob
csdunaway
csdunaway
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 236
I sent you a pm with my phone number. Feel free to call me to discuss your issue.



Perry Whittle
Perry Whittle
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20332 Visits: 17244
SQL_Bob (1/13/2014)
Good question. This is a new setup so no it has never worked before (because it has never been attempted). However I can successfully restore the log backups manually, so I know they are compatible and there's no reason from a backup/restore perspective that they shouldn't work.

I should also point out that the age of the files is within the retention period setting, so that shouldn't prevent a restore from occurring either.

Have you run the agent restore job and checked the history on this , it will usually give a clear indication as to the exact problem.

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
csdunaway
csdunaway
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 236
I would copy the code from the restore job, and run it in a command window. That way, you will see what the error is.



Steve Jones
Steve Jones
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: Administrators
Points: 64279 Visits: 19117
Well, if Master Bob is stumped, how can we help?? :-Pw00t

What about using something like the Process Monitor from Sysinternals to see if anything else launches after the tool reads the files? Or a detailed trace to see if SQL attempts something?

http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Steve Jones
Steve Jones
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: Administrators
Points: 64279 Visits: 19117
Or use the file watcher to see if any process touches a log file.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search