Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Working with Trace and Dump Files

This section describes working with trace files and dump files for your Amazon RDS DB instances running Microsoft SQL Server.

Generating a Trace SQL Query

Copy
declare @rc int declare @TraceID int declare @maxfilesize bigint set @maxfilesize = 5 exec @rc = sp_trace_create @TraceID output, 0, N'D:\rdsdbdata\log\rdstest', @maxfilesize, NULL

Viewing an Open Trace

Copy
select * from ::fn_trace_getinfo(default)

Viewing Trace Contents

Copy
select * from ::fn_trace_gettable('D:\rdsdbdata\log\rdstest.trc', default)

Setting the Retention Period for Trace and Dump Files

Trace and dump files can accumulate and consume disk space. By default, Amazon RDS purges trace and dump files that are older than seven days.

To view the current trace and dump file retention period, use the rds_show_configuration procedure, as shown in the following example.

Copy
exec rdsadmin..rds_show_configuration;

To modify the retention period for trace files, use the rds_set_configuration procedure and set the tracefile retention in minutes. The following example sets the trace file retention period to 24 hours.

Copy
exec rdsadmin..rds_set_configuration 'tracefile retention', 1440;

To modify the retention period for dump files, use the rds_set_configuration procedure and set the dumpfile retention in minutes. The following example sets the dump file retention period to 3 days.

Copy
exec rdsadmin..rds_set_configuration 'dumpfile retention', 4320;

For security reasons, you cannot delete a specific trace or dump file on a SQL Server DB instance. To delete all unused trace or dump files, set the retention period for the files to 0.

Related Topics