Log Shipping work around
DonFerguson
Posts: 202 Silver 5
Since I have not received an answer to my last question in http://www.red-gate.com/messageboard/vi ... php?t=9438 I am posting the question again in a new thread.
Backups in the source database don't get recorded in the "Server Cache" aka the SQL CE database. This is usually during times of heavy activity. Even excluding the SQL CE backups from the file system backup doesn't prevent an occasional failure to record a SQL Backup transaction log in the CE database. When it fails to record in CE, the file doesn't get shipped and log shipping breaks. I then need to manually identify the file that gets missed and copy it over to repair log shipping.
I am considering coding a work around to this problem. The work around would be along the lines of putting in a SQL Agent job step that compares the output of a sqbdata query to against the msdb..backup* tables. If a log backup is recorded in msdb but not in SQL CE, then I would perform a sqldata inserts of the missing data.
My question, is for the sqbdata insert, would it be sufficient to just insert a row into the backupfiles_copylist table? Or would I need to perform inserts into the other tables as well in order to get the the missed backup file onto the copy queue? Any guidance along those lines would be appreciated. Thanks.
Backups in the source database don't get recorded in the "Server Cache" aka the SQL CE database. This is usually during times of heavy activity. Even excluding the SQL CE backups from the file system backup doesn't prevent an occasional failure to record a SQL Backup transaction log in the CE database. When it fails to record in CE, the file doesn't get shipped and log shipping breaks. I then need to manually identify the file that gets missed and copy it over to repair log shipping.
I am considering coding a work around to this problem. The work around would be along the lines of putting in a SQL Agent job step that compares the output of a sqbdata query to against the msdb..backup* tables. If a log backup is recorded in msdb but not in SQL CE, then I would perform a sqldata inserts of the missing data.
My question, is for the sqbdata insert, would it be sufficient to just insert a row into the backupfiles_copylist table? Or would I need to perform inserts into the other tables as well in order to get the the missed backup file onto the copy queue? Any guidance along those lines would be appreciated. Thanks.
Comments
This is a sample of the INSERT command that SQL Backup uses:
Note that 'created' is the local time, but 'lastupdated' is the UTC datetime of the local time (GETUTCDATE in SQL Server).
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
In an effort to make the log shipping process more stable, I have one other issue. Just like the fact that occasionally a record does not get inserted into backupfiles_copylist, sometimes after a successful copy the status doesn't get updated causing a second copy of the file to be sent to the log shipping destination. When this happens, I get an error message on the destination that the file is out of sequence. When it tries to move the file to the MOVETO destination, it already exists and I get an error message that it can't overwrite the existing file. Hence I manually need to delete the file when this happens. Is there an option that can allow the MOVETO destination file to be overwritten when it does exist? Or alternatively delete the duplicate file in the log shipping destination directory?
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8