Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Kill Users Batch job

846231Apr 26 2011 — edited Apr 26 2011
Hi,

Oracle 11g
Windows/Unix

I have a program that kill all users before doing export dump.
This is the select statement that will spool to kill_user.sql
select 'alter system kill session '||''''||sid||','||serial#||''';' from v$session where type='USER';
This program is placed scheduled task for windows or crontab for unix.
My problem is, how can I exempt the owner(sched task) of the program from being killed?
You know that it will be included in the list at the time the select statement is run, right?
And I might happen that it is the first one to get killed, which results to not killing all rest of the users. Is my logic right?

Please help....

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2011
Added on Apr 26 2011
10 comments
1,003 views