Tracing Flags
Scenarios
You can use a stored procedure to trace flags in the following scenarios:
- Obtain in-depth SQL Server information, such as Lock Manager lock operations.
- Change some preset SQL Server behaviors such as stopping the query optimizer to find the timeout time for the execution plan.
- Change the current behavior of certain commands, such as terminating the use of a query prompt.
Prerequisites
An RDS Microsoft SQL Server DB instance has been connected. For details about how to connect to a DB instance, see Connecting to a DB Instance Through a Public Network.
Constraints
- The stored procedure must be executed by a user who has the [CREATE ANY DATABASE] permission. If a user who does not have this permission attempts to execute the stored procedure, the system displays the following information:
Database restores can only be performed by database logins with [CREATE ANY DATABASE] permissions.
- The current version only supports the tracing flags 1117, 1118, 1204, 1211, 1222, 1224, and 3604. If you perform operations on other flags, the system displays the following information:
Current version just open 1117, 1118, 1204, 1211, 1222, 1224, 3604 permission.
- The tracing flag can only contain 1, 0, and -1. If other operations are performed, the system displays the following information:
Just support Open:1 Close:0 Check:-1
Procedure
To trace a flag, run the following command:
EXEC msdb.dbo.rds_dbcc_trace @Trace_Flag, @Trace_Action;
- @Trace_Flag: specifies the sequence number of a trace flag. Currently, only trace flags 1117, 1118, 1204, 1211, 1222, 1224, and 3604 are supported.
- @Trace_Action: specifies the trace flag operation. The value 1 indicates that enable the trace flag. The value 0 indicates that disable the trace flag. The value -1 indicates that view the trace flag.
For example, to trace flag 1117, run the following command:
EXEC msdb.dbo.rds_dbcc_trace 1117, 1;
Last Article: Viewing Error Logs
Next Article: Capturing Change Data
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.