To copy a set of available transaction log backups for an individual database to your Amazon S3 bucket, call the rds_tlog_backup_copy_to_S3
stored procedure. The rds_tlog_backup_copy_to_S3
stored procedure will initiate a new task to copy transaction log backups.
Note
The rds_tlog_backup_copy_to_S3
stored procedure will copy the transaction log backups without
validating against is_log_chain_broken
attribute. For this reason, you should manually confirm an unbroken
log chain before running the rds_tlog_backup_copy_to_S3
stored procedure. For further explanation, see
Validating the transaction log backup log chain.
Example usage of the rds_tlog_backup_copy_to_S3
stored procedure
exec msdb.dbo.rds_tlog_backup_copy_to_S3 @db_name='
mydatabasename
', [@kms_key_arn='arn:aws:kms:region
:account-id
:key/key-id
'], [@backup_file_start_time='2022-09-01 01:00:15'
], [@backup_file_end_time='2022-09-01 21:30:45'
], [@starting_lsn=149000000112100001], [@ending_lsn=149000000120400001], [@rds_backup_starting_seq_id=5], [@rds_backup_ending_seq_id=10];
The following input parameters are available:
Parameter | Description |
---|---|
|
The name of the database to copy transaction log backups for |
|
A customer managed KMS key. If you encrypt your DB instance with an AWS managed KMS key, you must create a customer managed key. If you encrypt your DB instance with a customer managed key, you can use the same KMS key ARN. |
|
The UTC timestamp as provided from the |
|
The UTC timestamp as provided from the |
|
The log sequence number (LSN) as provided from the |
|
The log sequence number (LSN) as provided from the |
|
The sequence ID as provided from the |
|
The sequence ID as provided from the |
You can specify a set of either the time, LSN, or sequence ID parameters. Only one set of parameters are required.
You can also specify just a single parameter in any of the sets. For example, by providing a value for only the backup_file_end_time
parameter,
all available transaction log backup files prior to that time within the seven-day limit will be copied to your Amazon S3 bucket.
Following are the valid input parameter combinations for the rds_tlog_backup_copy_to_S3
stored procedure.
Parameters provided | Expected result |
---|---|
|
Copies transaction log backups from the last seven days and exist between the provided range
of |
|
Copies transaction log backups from the last seven days and starting from the provided
|
|
Copies transaction log backups from the last seven days up to the provided
|
|
Copies transaction log backups that are available from the last seven days and are between
the provided range of the |
|
Copies transaction log backups that are available from the last seven days, beginning from the provided
|
|
Copies transaction log backups that are available from the last seven days, up to the provided
|
|
Copies transaction log backups that are available from the last seven days, and exist between the provided range
of |
|
Copies transaction log backups that are available from the last seven days, beginning from the provided
|
|
Copies transaction log backups that are available from the last seven days, up to the provided
|
|
Copies a single transaction log backup with the provided |
Validating the transaction log backup log chain
Databases configured for access to transaction log backups must have automated backup retention enabled. Automated backup
retention sets the databases on the DB instance to the FULL
recovery model. To support point in time restore for
a database, avoid changing the database recovery model, which can result in a broken log chain. We recommend keeping the
database set to the FULL
recovery model.
To manually validate the log chain before copying transaction log backups, call the rds_fn_list_tlog_backup_metadata
function
and review the values in the is_log_chain_broken
column. A value of "1" indicates the log chain was broken
between the current log backup and the previous log backup.
The following example shows a broken log chain in the output from the rds_fn_list_tlog_backup_metadata
stored procedure.

In a normal log chain, the log sequence number (LSN) value for first_lsn for given rds_sequence_id should match the value of last_lsn in the preceding rds_sequence_id. In the image, the rds_sequence_id of 45 has a first_lsn value 90987, which does not match the last_lsn value of 90985 for preceeding rds_sequence_id 44.
For more information about SQL Server transaction log architecture and log sequence numbers,
see Transaction Log Logical Architecture