Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - SQL Usage » Monitoring and Improving Database Performance » Application profiling tutorials » Tutorial: Diagnosing slow statements


Lesson 1: Creating a diagnostic tracing session

The Database Tracing Wizard is used to create a diagnostic tracing session. The tracing session captures processing statement data which includes duration times.

This tutorial assumes you have created the test database. If you have not, see Lesson 1: Creating the test database.


You can copy and paste the SQL statements in this tutorial into Interactive SQL.

To create a diagnostic tracing session
  1. Start Sybase Central and connect to the test database app_profiling.db with the user ID DBA and the password sql.

    If you are unfamiliar with starting Sybase Central and connecting to a database, see Connect to a local database.

  2. Start the Database Tracing Wizard.

    1. In Sybase Central, choose Mode » Application Profiling. If the Application Profiling Wizard appears, click Cancel.

    2. Choose File » Configure And Start Tracing.

    3. On the Welcome page, click Next.

    4. On the Tracing Detail Level page, select High Detail (Recommended For Short-Term, Intensive Monitoring), and then click Next.

    5. On the Edit Tracing Levels page, click Next.

    6. On the Create External Database page, select Do Not Create A New Database, and then click Next.

    7. On the Start Tracing page, select Save Tracing Data In This Database.

    8. To allow no limits on the amount of stored tracing data, select No Limit, and then click Finish.

  3. In Sybase Central, in the left pane, select the app_profiling - DBA database, and then choose File » Open Interactive SQL.

    Interactive SQL starts and connects to the app_profiling - DBA database.

  4. In Interactive SQL, run the following SQL statement.

    SELECT SalesOrderItems.ID, LineID, ProductID, SalesOrderItems.Quantity, ShipDate
    FROM SalesOrderItems, SalesOrders
    WHERE SalesOrders.CustomerID = 105 AND 
  5. In Interactive SQL, run the following SQL statement. This query returns the same results as the previous query, but uses a uncorrelated subquery.

    SELECT * 
    FROM SalesOrderItems
    WHERE SalesOrderItems.ID IN (
       SELECT SalesOrders.ID 
       FROM SalesOrders
       WHERE SalesOrders.CustomerID = 105 );
  6. Exit Interactive SQL.

  7. In Sybase Central, select the database and then choose File » Tracing » Stop Tracing With Save to stop the tracing session.

For information about the Database Tracing Wizard, see Advanced application profiling using diagnostic tracing.