TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

sp_help_log_shipping_secondary_database (Transact-SQL)

 

Updated: August 2, 2016

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

This stored procedure retrieves the settings for one or more secondary databases.

Topic link icon Transact-SQL Syntax Conventions

  
sp_help_log_shipping_secondary_database  
[ @secondary_database = ] 'secondary_database' OR  
[ @secondary_id = ] 'secondary_id'  

[ @secondary_database = ] 'secondary_database'
Is the name of the secondary database. secondary_database is sysname, with no default.

[ @secondary_id = ] 'secondary_id'
The ID for the secondary server in the log shipping configuration. secondary_id is uniqueidentifier and cannot be NULL.

0 (success) or 1 (failure)

Column nameDescription
secondary_idThe ID for the secondary server in the log shipping configuration.
primary_serverThe name of the primary instance of the Microsoft SQL Server Database Engine in the log shipping configuration.
primary_databaseThe name of the primary database in the log shipping configuration.
backup_source_directoryThe directory where transaction log backup files from the primary server are stored.
backup_destination_directoryThe directory on the secondary server where backup files are copied to.
file_retention_periodThe length of time, in minutes, that a backup file is retained on the secondary server before being deleted.
copy_job_idThe ID associated with the copy job on the secondary server.
restore_job_idThe ID associated with the restore job on the secondary server.
monitor_serverThe name of the instance of the SQL Server Database Engine being used as a monitor server in the log shipping configuration.
monitor_server_security_modeThe security mode used to connect to the monitor server.

1 = Microsoft Windows Authentication.

0 = SQL Server Authentication.
secondary_databaseThe name of the secondary database in the log shipping configuration.
restore_delayThe amount of time, in minutes, that the secondary server waits before restoring a given backup file. The default is 0 minutes.
restore_allIf set to 1, the secondary server restores all available transaction log backups when the restore job runs. Otherwise, it stops after one file has been restored.
restore_modeThe restore mode for the secondary database.

0 = Restore log with NORECOVERY.

1 = Restore log with STANDBY.
disconnect_usersIf set to 1, users are disconnected from the secondary database when a restore operation is performed. Default = 0.
block_sizeThe size, in bytes, that is used as the block size for the backup device.
buffer_countThe total number of buffers used by the backup or restore operation.
max_transfer_sizeThe size, in bytes, of the maximum input or output request which is issued by SQL Server to the backup device.
restore_thresholdThe number of minutes allowed to elapse between restore operations before an alert is generated.
threshold_alertThe alert to be raised when the restore threshold is exceeded.
threshold_alert_enabledDetermines if restore threshold alerts are enabled.

1 = Enabled.

0 = Disabled.
last_copied_fileThe filename of the last backup file copied to the secondary server.
last_copied_dateThe time and date of the last copy operation to the secondary server.
last_copied_date_utcThe time and date of the last copy operation to the secondary server, expressed in Coordinated Universal Time.
last_restored_fileThe filename of the last backup file restored to the secondary database.
last_restored_dateThe time and date of the last restore operation on the secondary database.
last_restored_date_utcThe time and date of the last restore operation on the secondary database, expressed in Coordinated Universal Time.
history_retention_periodThe amount of time, in minutes, that log shipping history records are retained for a given secondary database before being deleted.
last_restored_latencyThe amount of time, in minutes, that elapsed between when the log backup was created on the primary and when it was restored on the secondary.

The initial value is NULL.

If you include the secondary_database parameter, the result set will contain information about that secondary database; if you include the secondary_id parameter, the result set will contain information about all secondary databases associated with that secondary ID.

sp_help_log_shipping_secondary_database must be run from the master database on the secondary server.

Only members of the sysadmin fixed server role can run this procedure.

sp_help_log_shipping_secondary_primary (Transact-SQL)
About Log Shipping (SQL Server)
System Stored Procedures (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft