SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Simulating SQL Log Shipping
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

RobertKaucher
Posting Yak Master

USA
169 Posts

Posted - 02/17/2010 :  14:33:33  Show Profile  Visit RobertKaucher's Homepage  Reply with Quote
So I have not found a simple resource that I liked that would allow me to do log shipping between a warm standby SQL Server 2005 server and a production SQL Server 2000 Standard server. Because of this I have decided to write a PowerShell script that will run on the standby server and simulate the log shipping. Here is what I have so far, and I was wondering if you guys might have some advice.

SQL1 Full backup done at 10:00 PM, t-logs begin at 6:00 AM done every hour untill 9:00PM
SQL2 Warm standby with all users replicated from SQL1
BU1 The server where the backups are stored.

The script will begin at 05:30 every day and run every hour until 22:30

Here is the logic:
If the current time is > 22:00 clear the list of files that have been restored.

If the time is < 22:00 check the list of files and compare it to the list of files on the backup server.
** Find the most recent backup.
** List any t-logs that were generated after this backup.

Restore any files that are not on the list using the NO RECOVERY option.
Add those files to the list.
Send an email on either success or failure.

I have been testing it by printing the RESTORE command to host. So I know that it works, I'm just not sure if this is even a good idea... The only other way I can think of to do it is to write some stored procedures and PowerShell is far simpler, IMO. Does this make sense? Am I over thinking?

RobertKaucher
Posting Yak Master

USA
169 Posts

Posted - 02/18/2010 :  12:48:41  Show Profile  Visit RobertKaucher's Homepage  Reply with Quote
Well, my script seems to be working properly and I don't see any additional over-head or anything like that. I am doing some additional testing and then I will post the code.
Go to Top of Page

RobertKaucher
Posting Yak Master

USA
169 Posts

Posted - 02/22/2010 :  18:18:41  Show Profile  Visit RobertKaucher's Homepage  Reply with Quote
The code is several hundred lines, but it's on my blog if anyone might get any use out of it.

http://elementalsql.blogspot.com/2010/02/simulating-log-shipping-with-windows.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000