When you start a diagnostic tracing session, you also configure the type of tracing you want to perform, and specify where you want the tracing data to be stored. Your tracing session continues until you explicitly request that it stops.
To start a tracing session, TCP/IP must be running on the database server(s) on which the tracing database and production database are running. See Using the TCP/IP protocol.
Starting a tracing session is also referred to as attaching tracing. Likewise, stopping a tracing session is referred to as detaching tracing. The SQL statements for starting and stopping tracing are, respectively, ATTACH TRACING and DETACH TRACING.
To create a diagnostic tracing session (Sybase Central)
Connect to the database as a user with DBA authority or as a user with PROFILE authority.
Right-click the database and choose Tracing.
Click Next.
On the Tracing Detail Level page, select the level of tracing.
On the Edit Tracing Levels page, customize the diagnostic tracing settings.
On the Create External Database page:
On the Start Tracing page:
ENG=Server47;DBN=TracingDB
Only DBN, DBF, ENG, DBKEY and LINKS (CommLinks) are supported in the connection string for an external database.
Click Finish.
When you are done gathering diagnostic tracing data, right-click the database and choose Tracing » Stop Tracing With Save.
To create a diagnostic tracing session (Interactive SQL)
Connect to the database as the DBA, or as a user with PROFILE authority.
Use the sa_set_tracing_level system procedure to set the tracing levels.
Start tracing by executing an ATTACH TRACING statement.
Stop tracing by executing a DETACH TRACING statement.
You can view the diagnostic tracing data in Application Profiling mode in Sybase Central. See Application profiling.
This example shows how to start diagnostic tracing on the current database, store the tracing data in a separate database, and set a two hour limit on the amount of data to store. This example is all on one line:
ATTACH TRACING TO 'UID=DBA;PWD=sql;ENG=dbsrv11;DBN=tracing;LINKS=tcpip' LIMIT HISTORY 2 HOURS; |
This example shows how to start diagnostic tracing on the current database, store the tracing data in the local database, and set a two megabyte limit on the amount of data to store:
ATTACH TRACING TO LOCAL DATABASE LIMIT SIZE 2 MB; |
This example shows how to stop diagnostic tracing and save the diagnostic data that was captured during the tracing session:
DETACH TRACING WITH SAVE; |
This example shows how to stop diagnostic tracing and not save the diagnostic data.
DETACH TRACING WITHOUT SAVE; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |