Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Simulating SQL Log Shipping

Author  Topic 

RobertKaucher
Posting Yak Master

169 Posts

Posted - 2010-02-17 : 14:33:33
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

169 Posts

Posted - 2010-02-18 : 12:48:41
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

169 Posts

Posted - 2010-02-22 : 18:18:41
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
   

- Advertisement -