Log Shipping Tables and Stored Procedures
This topic describes all of the tables and stored procedures associated with a log shipping configuration. All log shipping tables are stored in msdb on each server. The tables below describe which tables and stored procedures are used on which servers in a log shipping configuration.
Primary Server Tables
Table |
Description |
---|---|
Stores alert job ID. This table is only used on the primary server if a remote monitor server has not been configured. |
|
Stores error detail for log shipping jobs associated with this primary server. |
|
Stores history detail for log shipping jobs associated with this primary server. |
|
Stores one monitor record for this primary database. |
|
Contains configuration information for primary databases on a given server. Stores one row per primary database. |
|
Maps primary databases to secondary databases. |
Primary Server Stored Procedures
Stored Procedure |
Description |
---|---|
Sets up the primary database for a log shipping configuration, including the backup job, local monitor record, and remote monitor record. |
|
Adds a secondary database name to an existing primary database. |
|
Changes primary database settings including local and remote monitor record. |
|
Cleans up history locally and on the monitor based on retention period. |
|
Removes log shipping of primary database including backup job as well as local and remote history. |
|
Removes a secondary database name from a primary database. |
|
Retrieves primary database settings and displays the values from the log_shipping_primary_databases and log_shipping_monitor_primary tables. |
|
Retrieves secondary database names for a primary database. |
|
Refreshes the monitor with the latest information for the specified log shipping agent. |
Secondary Server Tables
Table |
Description |
---|---|
Stores alert job ID. This table is only used on the secondary server if a remote monitor server has not been configured. |
|
Stores error detail for log shipping jobs associated with this secondary server. |
|
Stores history detail for log shipping jobs associated with this secondary server. |
|
Stores one monitor record per secondary database associated with this secondary server. |
|
Contains configuration information for the secondary databases on a given server. Stores one row per secondary ID. |
|
Stores configuration information for a given secondary database. Stores one row per secondary database. |
[!UWAGA]
Secondary databases on the same secondary server for a given primary database share the settings in the log_shipping_secondary table. If a shared setting is altered for one secondary database, the setting is altered for all of them.
Secondary Server Stored Procedures
Stored Procedure |
Description |
---|---|
Sets up a secondary database for log shipping. |
|
Sets up the primary information, adds local and remote monitor links, and creates copy and restore jobs on the secondary server for the specified primary database. |
|
Changes secondary database settings including local and remote monitor records. |
|
Changes secondary database settings such as source and destination directory, and file retention period. |
|
Cleans up history locally and on the monitor based on retention period. |
|
Removes a secondary database and the local history and remote history. |
|
Removes the information about the specified primary server from the secondary server. |
|
Retrieves secondary database settings from the log_shipping_secondary, log_shipping_secondary_databases, and log_shipping_monitor_secondary tables. |
|
This stored procedure retrieves the settings for a given primary database on the secondary server. |
|
Refreshes the monitor with the latest information for the specified log shipping agent. |
Monitor Server Tables
Table |
Description |
---|---|
Stores alert job ID. |
|
Stores error detail for log shipping jobs. |
|
Stores history detail for log shipping jobs. |
|
Stores one monitor record per primary database associated with this monitor server. |
|
Stores one monitor record per secondary database associated with this monitor server. |
Monitor Server Stored Procedures
Stored Procedure |
Description |
---|---|
Creates a log shipping alert job if one has not already been created. |
|
Removes a log shipping alert job if there are no associated primary databases. |
|
Returns the job ID of the alert job. |
|
Returns monitor records for the specified primary database from the log_shipping_monitor_primary table. |
|
Returns monitor records for the specified secondary database from the log_shipping_monitor_secondary table. |