trace flag:3604
Function:
- The output DBCC command returns results to the query window (usually the SSMs window), similar to the display of the Print command;
Use:
- Often used to get the output of the DBCC IND, DBCC PAGE command, because these 2 commands do not output any results by default.
Example:
UseMasterGO--turn on trace flag 3604DBCCTRACEON (3604)--View page: (1,1,10) dbid 1 (master), file ID 1, pageDBCCPAGE (1,1,Ten)--turn off trace flag 3604DBCCTraceoff (3604)--Unable to view page: (1,1,10) dbid 1 (master), file ID 1, pageDBCCPAGE (1,1,Ten)
trace flag:3605
Function:
- The output DBCC command returns results to the SQL Server error log (errorlog);
Use:
- Often used to get the details of deadlocks, because when the deadlock information is fetched, it often turns on 1204, 1222 global trace flag: DBCC TRACEON (1222,-1);
- In fact, DBCC TRACEON (1222,-1) = DBCC TRACEON (3605,1222,-1), the trace flag of a deadlock, is output to the error log by default;
Example:
UseMasterGO--turn on trace flag 3605DBCCTRACEON (3605)--View page: (1,1,10) dbid 1 (master), file ID 1, pageDBCCPAGE (1,1,Ten)--results are saved in the error log, not displayed in the query windowexecXp_readerrorlog0,1N"'N"',NULL,NULLN'DESC'
Summary:
(1) Trace markers 3604 and 3605, which can be used to control how the DBCC command returns the result of printing;
(2) Usually only view DBCC command results, do not need to turn on global trace flag-1;
(3) These two trace marks are not officially documented.
2. Trace flag (trace flag) 3604, 3605 output DBCC command result