DisCopy


Monday, 18 July 2011

What will happen when an SQL Statement submitted to ASE?

What will happen when an SQL Statement submitted to ASE?

·         SQL statement is parsed by the language processor
·         SQL statement is normalized and optimized
·         SQL is executed
·         Task is put to sleep pending lock acquisition and logical or physical I/O
·         Task is put back on runnable queue when I/O returns
·         Task commits (writes commit record to transaction log)
·         Task is put to sleep pending log write
·         Task sends return status to client

Status Values Reported by sp_who
Status
Condition
Effects of kill Command
recv sleep
waiting on a network read
immediate
send sleep
waiting on a network send
immediate
alarm sleep
waiting on an alarm, such as waitfor delay "10:00"
immediate
lock sleep
waiting on a lock acquisition
immediate
sleeping
waiting disk I/O, or some other resource. Probably indicates a process that is running, but doing extensive disk I/O
killed when it "wakes up", usually immediate; a few sleeping processes do not wake up, and require a Server reboot to clear
runnable
in the queue of runnable processes
immediate
running
actively running on one on the Server engines
immediate
infected
Server has detected serious error condition; extremely rare
kill command not recommended. Server reboot probably required to clear process
background
a process, such as a threshold procedure, run by SQL Server rather than by a user process
immediate; use kill with extreme care. Recommend a careful check of sysprocesses before killing a background process
log suspend
processes suspended by reaching the last-chance threshold on the log
killed when it "wakes up": 1) when space is freed in the log by a dump transaction command or 2) when an SA uses the lct_admin function to wake up "log suspend" processes


Only a System Administrator can issue the kill command: permission to use it cannot be transferred.

No comments:

Post a Comment