-
Notifications
You must be signed in to change notification settings - Fork 7
Other Options
The log shipping service will look for log backups created after the last restored backup. It's possible that timezone differences could cause issues where we have to process additional log files or it starts processing log files that are too recent.
LogShippingService.exe --OffsetMins 0
"Config": {
"OffsetMins": 0,
Header verification is done by default using RESTORE HEADERONLY to validate the backup before running RESTORE LOG. This adds some extra overhead. It's possible to turn off header verification using:
LogShippingService.exe --CheckHeaders false
"Config": {
"CheckHeaders": false,
Introduce a delay to the restore process to guarantee a set amount of time is available to recover from application/user errors. This allows us to restore to a point in time before the error occurred without needing to start the restore from scratch.
LogShippingService.exe --RestoreDelayMins 60
"Config": {
"RestoreDelayMins": 60,
Use the StopAt configuration option to do a point in time restore to the specified time.
LogShippingService.exe --StopAt "2024-03-27 13:56:01"
"Config": {
"StopAt": "2024-03-27 13:56:01",
This option can be used if you want to restore a copy of your databases with a different name. This option adds a prefix to the name. e.g.
LogShippingService --RestoreDatabaseNamePrefix "CopyOf_"
A database called DB1 will be named CopyOf_DB1
This option can be used if you want to restore a copy of your databases with a different name. This option adds a suffix to the name. e.g.
LogShippingService --RestoreDatabaseNameSuffix "_Copy"
A database called DB1 will be named DB1_Copy
This option can be used if you want to restore a copy of your databases with a different name. You can explicitly map the old name to the new name. Repeat as needed for each database. e.g.
LogShippingService --OldName "DB1" --NewName "Database1"
LogShippingService --OldName "DB2" --NewName "Database2"
LogShippingService --OldName "DB3" --NewName "Database3"
"Config": {
"DatabaseNameMapping": {
"DB1": "Database1",
"DB2": "Database2",
"DB3": "Database3"
}
If an explicit mapping doesn't exist, the original database name will be used. If you also have RestoreDatabaseNamePrefix/RestoreDatabaseNameSuffix specified, the explicit mapping will take priority. The databases could also be added to the IncludedDatabases list if you wanted to prevent other databases from being restored.
By default the config file will be updated when any command options are specified. Running without any command options will run the service as a console application. Instead of saving the config, it's possible to run the tool using the command options specified without saving the config. This might be useful for an adhoc database restore.
LogShippingService.exe --Destination "Data Source=LOCALHOST;Integrated Security=True;Encrypt=True;Trust Server Certificate=True" --LogFilePath "\\BACKUPSERVER\Backups\SERVERNAME\{DatabaseName}\LOG" --Run
Note: If the config file already exists, the settings will be used unless overridden in the command options.
Max threads to use for log restores & database initialization (Each can use up to MaxThreads threads). Default is 5.
LogShippingService --MaxThreads 5