Databases Reference
In-Depth Information
TEMPFILE=/tmp/$$.tmp
sqlplus system/system_password <<EOF
spool $TEMPFILE
select p.spid from v\$process p,v\$session s
where s.paddr=p.addr
and s.status='SNIPED';
spool off
EOF
for i in 'cat $TEMPFILE | grep "^0123456789"'
do
kill -9 $i
done
rm $TEMPFILE
Orakill
On Windows platforms the OS architecture is different; it works with threads.
In Windows a process is defined as a container for address space and threads,
the thread is the fundamental schedulable entity in the system. So there is no way
to find a single Oracle server process at the OS in the way that we can on Unix like
platforms, it simply doesn't exist as a session/OS process pair, the only process the
DBA will find is a running oracle.exe process which embodies both the background
and the user processes. A tool for Windows platforms to kill oracle processes from
the OS prompt was specifically created by Oracle; the orakill.exe tool. In the next
sequence a session has been marked as SNIPED on a Windows platform, and then the
DBA may leave a task that periodically cleans up the SNIPED sessions.
Orakill Usage: orakill sid thread
where sid = the Oracle instance to target
thread = the thread id of the thread to kill
The thread id should be retrieved from the spid column of a query such as:
select spid, osuser, s.program from
v$process p, v$session s where p.addr=s.paddr
Orakill receives two arguments; the oracle instance name and the "OS PID". As
Windows doesn't actually have a processes ID for the session process Oracle makes
one up, and it can be queried from the V$PROCESS dynamic view. A kill SNIPED
script is created, this queries the V$PROCESS view, takes the SPID, and it passes this
value as argument to the ORAKILL.exe tool.
 
Search WWH ::




Custom Search