Posting Yak Master
Posted - 02/17/2010 : 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?