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
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
select * from ::fn_trace_getinfo(default)
Viewing Trace Contents
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,
as shown in the following example.
To modify the retention period for trace files,
and set the
tracefile retention in minutes.
The following example sets the trace file retention period to 24 hours.
exec rdsadmin..rds_set_configuration 'tracefile retention',
To modify the retention period for dump files,
and set the
dumpfile retention in minutes.
The following example sets the dump file retention period to 3 days.
exec rdsadmin..rds_set_configuration 'dumpfile retention',
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.