Dbcc traceflags

From SybaseWiki
Revision as of 22:57, 22 March 2008 by Psap (Talk | contribs)

Jump to: navigation, search

With dbcc traceflags you can do many different things, like change the behaviour of the server, see why a certain query plan is choosen or fine-tune the optimizer. This page shows you how to use them and provides a list of known traceflags.

Using traceflags

You can set a traceflag in two ways

At boottime

Usually a server is booted through the runserver file. In this file (default location is $SYBASE/$SYBASE_ASE/install) you can add a traceflag by specifying a -T flag and one or more comma separated values.

At run time

When you are logged in to ASE you can set a traceflag with the dbcc traceon command. Example:

dbcc traceon(3604)

You can specify multiple values, comma separated. To turn a traceflag off, use traceoff

dbcc traceoff(3604)

Which traceflags are active

To see which traceflags are active for your own session use the dbcc traceflags command

dbcc traceflags

To see the traceflags of other sessions as well

dbcc traceflags(2)

List of known traceflags

Below you will find a list of currently known traceflags. But beware of the following:

WARNING

  • Most traceflags are undocumented and not supported by Sybase, use at your own risk. Certain traceflags can severely harm your databases.
  • Some traceflags are obsolete and are replaced by configuration parameters.
  • Certain traceflags should be used when you start the server, others are meant for a specific session, when known this is indicated in the list.
  • Experiment first on a test server, use only on production systems when either the traceflag is documented by Sybase or when you have consulted Sybase Technical Support.


List of dbcc traceflags
Explanation Since version Untill Version Boot time Run time
100 Display a parse tree for each command
108 Allow dynamic and host variables in create view statements 12.5
200 Display messages about the before image of the query-tree
201 Display messages about the after image of the query tree
208 Show types of locks taken
241 Compress all query-trees when ASE is started
243 Do not expand select * to column names when creating a compiled object
244 When set, the maximum length of the returned value of str_replace() is 16384, otherwise it is 255
260 Reduce TDS (Tabular Data Stream) overhead in stored procedures. Turn off done-in-behaviour packets. See also Send doneinproc tokens.
291 Changes the hierarchy and casting of datatypes to pre-11.5.1 behaviour. There was an issue is some very rare cases where a wrong result could occur, but that's been cleared up in 11.9.2 and above. 11.9.2
292 Never send doneinproc tokens. See also Send doneinproc tokens.
298 Display an error message when a query uses a correlated variable as an inner or outer member of an outer join.
299 Do not recompile a stored procedure that inherits a temp table from a parent procedure.
302 Print trace information on index selection 12.5 Y
303 Display optimizer OR strategy 12.5 Y
304 Revert special "or" optimizer strategy to the strategy used in pre-System 11 (this traceflag resolved several bug issues in System 11, most of these bugs are fixed in ASE 11.0.3.2)
310 Show the plan as choosen by the optimizer, as well as I/O costs. 12.5 Y
311 Display optimizers expected I/O cost 12.5 Y
317 Show all considered plans 12.5 Y
319 Display optimizer reformatting strategy 12.5 Y
320 Turn off join order heuristics 12.5
321 Display optimizers reformatting strategy briefly 12.5
324 Turn off the like optimization for ad-hoc queries using local variables 12.5
326 Instructs the server to use arithmetic averaging when calculating density instead of a geometric weighted average when updating statistics. Useful for building better stats when an index has skew on the leading column. Use only for updating the stats of a table/index with known skewed data. 11.5
329 Turns on a strategy for fast first row return for queries using cursors with an ORDERBY. 15.0 ESD 2 Y N
333 Disables min-max optimization 12.5
334 Enable merge joins 12.5
353 Turn off transitive closure
364 Use range density instead of total density
370 Use min-max index as an alternative to the table scan for single table queries. Does not perform aggregation optimization for joins.
384 Enable JTC
396 Use min-max optimization for single table queries.
450 Sort a group by operation in the order of the groups 15
516 Print mapping between xchg operators and worker processes when using parallel execution 15
526 Print semi-graphical execution operator tree when showplan is enabled.
602 Prints out diagnostic information for deadlock prevention.
603 Prints out diagnostic information when avoiding deadlock.
615 When a read of a page does not indicate it's right identity a second read is done. When the identity is now correct the related device is suspect and ASE turns on additional diagnostic checks. The check can be turned off with the traceflag. 12.5.3 ESD 5 and 15.0 ESD 2 Y Y
646 Turn off the new space allocation method as introduced in 12.5.3 for partitioned DOL tables 12.5.3
699 Turn off transaction logging
712 Disable procedure cache optimisation
722 ASE (debug version) will perform additional checks on the heap memory to detect possible memory corruption. 15.0 ESD 2 Y N
833 Do not report Msg 880 "Your query is blocked because it tried to write and database '<dbname>' is in quiesce state. Your query will proceed after the DBA performs QUIESCE DATABASE RELEASE.". 15.0 ESD 2 Y N
990 Allow only access to the server with the "sa" account.
1116 Suppress Msg 1131. (The OAM page does not belong to object with index.....)
1202 Also show the blocked lock requests in master..syslocks
1204 Print deadlock information into errorlog
1205 Prints deadlock information by printing stacktraces.
1206 Disable lock promotion.
1212 Shows info about locks granted and released
1213 Used with dbcc object_stats
1217 Show info about locks being acquired
1603 Turns off async i/o and forces standard unix io. Can be useful if symptoms include transient corruption errors that may be caused by bad drives or controllers.
1605 Start secondary engines by hand
1606 Create a debug engine start file. This allows you to start up a debug engine which can access the server's shared memory for running diagnostics.
1608 Instructs server engine 0 to not on-line any other dataserver engines
1610 Boot the server with TCP_NODELAY enabled. Y
1611 If possible, pin shared memory -- check errorlog for success/failure.
1613 Set affinity of the ASE engine's onto particular CPUs usually pins engine 0 to processor 0, engine 1 to processor 1, etc
1615 SGI only: turn on recoverability to filesystem devices.
1625 Linux only: Revert to using cached filesystem I/O. By default, ASE on Linux opens filesystem devices using O_SYNC, unlike other Unix based releases, which means it is safe to use filesystems devices for production systems. 11.9.2
1630 SuSE 32 bit Linux (SuSE 9 SP1 or later), ASE incorrectly identifies AIO to be KAIO while using Posix AIO. Can lead to ASE hang. Start with this trace flag. 15.0 ESD 2 Y N
1642 Reserve one third of the sockets for EJB.
2205 Show HA debugging output
2209 Used when upgrading ASE configured with high availability
2512 Instructs dbcc checkalloc to skip the syslogs table during processing.
2513 Instructs dbcc checkalloc, tablealloc and indexalloc to check for whether foreign objects are stranded on a particular segment within a database.
2703 When using update statistics with sampling and the index/column does not have existing statistics, set join density and total density to values from the sample rather then to defaults. 15.0 ESD 2
3100 Load a database even when the characterset or sort order of a dump file is incompatible with the server.
3199 When ONLINE DATABASE fails with Msg 2610 (Could not find leaf row in nonclustered index partition ...) after a cross-platform database load, set the traceflag on, reload the dump and online again. 15.0 ESD 2 Y
3300 Display each log record that is being processed during recovery. You may wish to redirect stdout because it can be a lot of information.
3500 Disable checkpointing.
3502 Write an entry in the errorlog when a databases is checkpointed
3601 Write a stacktrace to the errorlog every time an error is raised.
3604 Send trace output to the session of the client Y
3605 Send trace output to the errorlog of the server Y
3607 Do not start recovery when booting ASE. Y
3608 Recover only the master database. Do not clear tempdb or start up checkpoint process. Y
3609 Recover all databases. Do not clear tempdb or start up checkpoint process.
3610 Pre-System 10 behaviour: divide by zero to result in NULL instead of error
3620 Do not kill infected processes.
3706 Performance improvement of drop table in tempdb. 15.0 ESD 2 Y Y
4001 Display a message in the errorlog when a loginrecord is recieved
4012 Don't spawn chkptproc.
4013 Write a message to the errorlog when a login takes place.
4020 Boot without recover. Y
4044 Allows to log into ASE when the "sa" login is locked
4072 Disable the global login trigger 15
4073 Export the result of certain "set" command within a login trigger to the session. 15.0 ESD 2 Y
4080 When an UPDATE using tsequal() is done within a stored procedure, tsequal() no longer returns a timestamp value unless the trace flag is set. 15.0 ESD 2
4413 Trace queries in a 12.5 server that are join-order dependent.
5101 Forces all I/O requests to go through engine 0. This removes the contention between processors but could create a bottleneck if engine 0 becomes busy with non-I/O tasks.
5102 Prevents engine 0 from running any non-affinitied tasks.
7103 Disable table lock promotion for text columns.
7703 When assinging a value from a table into a local variable, go through the whole resultset rather than jump to last row and assing the value once.
7717 Disable check of client compatibility in ASE 15. See Version 15 client compatibility 15.0.1
7815 logs address connection requests and host / name lookups.
7841 Make ASE IPv6 aware
8003 prints info on RPC calls
8203 Display statement and transaction locks on a deadlock error.
8399 Instructs the dbcc monitor command to insert a valid description into the field_name column in the sysmonitors table. Not intended for use by users. Appears in the errorlog when sp_sysmon is used.
9217 When set, RepAgent will not stop after reporting error 9289 due to an inconsistent log record found. Instead it will attempt to continue after reporting error 9290 in the error log. 15.0 ESD 2
11201 Logs client connect events, disconnect events, and attention events.
11202 Logs client language, cursor declare, dynamic prepare, and dynamic execute-immediate text.
11203 Logs client rpc events.
11204 Logs all messages routed to client.
11205 Logs all interaction with remote server.
11206 Show messages about query processing for file access
11207 Log the processing of text and image datatypes from remote servers
11208 Prevents the create index and drop table statements from being transmitted to a remote server. sysindexes is updated anyway.
11209 When running "update statistics" on remote tables update only the rowcount
11210 Disables Component Integration Services enhanced remote query optimization.
11212 Prevents escape on underscores in table names.
11213 Prevents generation of column and table constraints.
11214 Disables Component Integration Services recovery at start-up. Y
11215 Sets enhanced remote optimization for servers of class db2.
11216 For the session, disables enhanced remote optimization. Y
11217 For the server, disables enhanced remote optimization.
11218 Any query that is part of a declare cursor command, and that references proxy tables, is read only by default.
11228 A 2762 error, "CREATE TABLE command is not allowed within multiple statement transaction" may be reported when executing a SQL INSERT..SELECT from proxy table mapped to a RPC. This traceflag has to be turned on to allow CREATE TABLE command in the remote procedure (for the session) 12.5.3. ESD 5 and 15.0 ESD 2
11229 Use pre-12.5.3 behaviour to import statistics for proxy tables 12.5.3
11231 CIS: Connections to remote servers are not disconnected and remain engine affinitied until the client session terminates. The connections can now be dropped and detached from an engine after executing a statement to the remote server by enabling this flag. Exceptions are when the statement is participating in cursor, transaction or stored procedure operations; or when ASE is in either HA failover or failback states. 15.0 ESD 2
11232 A 2762 error, "CREATE TABLE command is not allowed within multiple statement transaction" may be reported when executing a SQL INSERT..SELECT from proxy table mapped to a RPC. This traceflag has to be turned on to allow CREATE TABLE command in the remote procedure (serverwide) 12.5.3. ESD 5 and 15.0 ESD 2
11906 Informational messages from REORG will no longer be printed to the errorlog. 15.0 ESD 2
12628 Data insertion into DOL tables having nonclustered index will be done with the index prepend mode splits disabled, in order to improve disk space utilization. 15.0 ESD 2 Y N
15302 When a subquery appears in the ON clause of an outer join query, the performance may not be efficient. ASE will do optimization for subquery attachment to achieve more favorable performance when turned on. 15.0 ESD 2
15303 Possible performance improvement on a SELECT statement when a BIT column is involved in the WHERE clause. 15.0 ESD 2
15556 Allow dump and load in ASE cluster edition with multiple instances active cluster edition