|
-
the content of my batch file raja.bat
=====================================
sqlplus scott@his/tiger @C:\HISKILL.SQL
c:\SNIPKILL.bat
the content of my script file c:\hiskill.sql
============================================
SET HEAD OFF;
SPOO C:\SNIPKILL.BAT;
SELECT 'ORAKILL HIS ' , B.SPID
FROM V$SESSION A, V$PROCESS B
WHERE A.PADDR = B.ADDR
AND A.STATUS='SNIPED';
SPOO OFF;
EXIT;
the sample output from the spool c:\snipkill.bat
================================================
ORAKILL HIS 770
ORAKILL HIS 545
ORAKILL HIS 378
ORAKILL HIS 534
ORAKILL HIS 339
ORAKILL HIS 703
ORAKILL HIS 748
ORAKILL HIS 600
8 rows selected.
i run the batch file raja.bat.
it executes the script hiskill.sql and the
batch file (snipkill.bat) spooled by
the the script.
in this script 'ORAKILL' is the utility you
can find in the \bin directory.
'HIS' is my database SID.
(You have to replace with your database sid).
the executing user should have select privilege over
v$session and v$process.
Note: You can run this batch file as scheduled task also.
-Raja
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|