Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, there are several ways to <em>trace</em> all queries that Sybase receives.</p> <p>However, given the second part of your question, as I understand it, you need to (1) understand what <em>your</em> query is doing (2) monitor <em>your</em> active spid in the context of other active spids and ... if that does not suffice, then (3) monitor the server; not <em>trace</em>, and <em>all</em> queries. Therefore I will go into that and defer responding re the tracing elements available in Sybase.</p> <p>Your connection to ASE is a Server Process Id, or spid.</p> <ol> <li><p>SET SHOWPLAN ON and SET NOEXEC ON, and execute your query. This will give you a very good insight into what your SQL is actually doing, under the covers. This is an essential requirement, something every developer should be familiar with, and demanded before testing. Whenever it feels like your query is slow, always check the I/O being performed: SET STATISTICS IO ON.</p></li> <li><p>sp_who; sp_lock; and watch your spid ticking over, hung, waiting for locks, blocked, which other spids are holding it up, etc. This is the basic set that every developer should be using, all the time.</p></li> <li><p>sp_sysmon monitors the (entire) server. It can be used in two ways: as an ongoing monitoring tool, eg grab a full hour of stats, which is the basis for server configuration changes; and as a snapshot, eg. grab a 5 minute snapsot of the server when your process is running and when it is not, and examine the differences. Generally this is for experienced DBAs, not developers, and you need sa_role.</p></li> </ol> <p>It is all in the manuals, both online and PDF.</p> <p>Seven hours is a very long time, so you must be using a cursor or similar, and processing single rows rather than sets. Check for regular nightly batch jobs (dumps, update stats, reorgs) weighing in at the 7 hour mark; some of them hold table locks. Of course, if the server is running on Windoze, all manner of strange things, from memory leaks upwards, is standard fare; bounce the box every week at least.</p> <p>With that order of processing burden, you should keep on eye on <em>your</em> transaction log and tempdb usage.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload