The Database Tracing Wizard can be used to create a diagnostic tracing session. The tracing session captures deadlock data.
In the application profiling tutorials, tracing information is stored in the test database (app_profiling.db), which is the same database you are running the tutorials on. However, if you profile a database that experiences heavy loads, you should consider storing tracing data in a separate database than your production database to avoid impacting performance.
In Sybase Central, click Mode » Application Profiling.
If the Application Profiling Wizard appears, click Cancel.
Start the Database Tracing Wizard as follows:
In the left pane, click app_profiling - DBA, and click File » Tracing.
On the Welcome page, click Next.
On the Tracing Detail Level page, click High Detail (Recommended For Short-Term, Intensive Monitoring), and then click Next.
On the Edit Tracing Levels page, click Next.
On the Create External Database page, click Do Not Create A New Database. I Will Use An Existing Tracing Database, and then click Next.
On the Start Tracing page, click Save Tracing Data In This Database.
To place no limits on the amount of stored tracing data, click No Limit, and then click Finish.
Create the deadlock as follows:
In the left pane, click app_profiling - DBA, and then click File » Open Interactive SQL.
Interactive SQL starts and connects to the app_profiling.db database.
Repeat the previous step to open a second Interactive SQL window.
In the first Interactive SQL window, execute the following SQL statement:
In the second Interactive SQL window, execute the following SQL statement within 20 seconds of executing the SQL statement in the other Interactive SQL window:
After a few moments, an ISQL Error window appears indicating that a deadlock has been detected.
The deadlock occurred because proc_deadlock1 requires access to the deadlock2 table, which is locked by proc_deadlock2. At the same time, proc_deadlock2 requires access to the deadlock1 table, which is locked by proc_deadlock1.
SQL Anywhere stopped the deadlocked operations, so you can close the Interactive SQL windows.
In Sybase Central, stop the tracing session by clicking the app_profiling - DBA connection in the left pane and clicking File » Tracing » Stop Tracing With Save.
Click this link to continue the tutorial: Lesson 3: Reviewing blocked connection data.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|