• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 29
  • Last Modified:

SQL Log Restores (No Full Backups)

I'm trying to setup an environment where I can restore log files from a primary database to a secondary database (different servers) every 30 minutes.  I do not want to have to restore a full backup each time.  This secondary database will be used as a read-only instances as well. At this point I'm getting an error "The log or differential backup cannot be restored because no files are ready to rollforward."  I understand that this is maybe because the database is in recovery mode at the time.

Any help would be greatly appreciated.
Oh, the SQL Versions are both 2016.

thanks,
John.
0
Thunder724
Asked:
Thunder724
  • 7
  • 5
1 Solution
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
The solution you want is available natively in SQL Server and it's called Log Shipping.
0
 
Thunder724Author Commented:
HI Vitor,
I need to restore the log files without creating any kind of connection between the primary and secondary database/instances.  In our situation we have access, only, to the log files, and not the SQL Instance of the primary.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Still the same requirements for Log Shipping. Only thing that it needs is access to a file share where the transaction log backups will be stored.
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Thunder724Author Commented:
Ok, that's good news.  I think the problem I may be having is that when I initially restored the full backup I did not put it into Standby Mode.  I'll have to try that again.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Yes, you'll need to put the replicated database in Standby Mode if you need to access to the database.
Remove the Standby Mode so you can apply next transaction log restore.
0
 
Thunder724Author Commented:
Yup, that makes sense and it works.  My only question is that when I put it into NoRecovery mode the transaction log restore wont restore objects that have changed.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Do you get any error message during the restore when that happens?
0
 
Thunder724Author Commented:
Nothing other than a comment, not an error, stating that it can't restore objects because it does not have write permissions.  Although it states that it did restore a certain number of pages.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Please post the full message here. It may have some clue for me.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Thunder did you abandoned this question?
0
 
Thunder724Author Commented:
I'm sorry if I didn't get back to this question.  Thought I did.  I ended up working it out and my log shipping is working fine. The only thing I'm trying figure out is if it is possible to get object changes restored to database from transaction logs.  I'm leaving the database in Standby (read-only).  When restoring the trans logs I place it into NoRecovery first, than back to standby.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
I'm leaving the database in Standby (read-only).  When restoring the trans logs I place it into NoRecovery first, than back to standby.
That's the correct way to do it. You should get all changes after restoring the last transaction log backups.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now