How to Kill INACTIVE SESSIONS in R12
Step-1.Connect to SQL:-
Base_dir>Oracle
database>VIS
[oracle@dev1211]$cd /oracle/VIS/apps/apps_st/appl
[oracle@dev1211 appl]$ . APPSVIS_dev1211.env
[oracle@dev1211 appl]$ sqlplus
SQL*Plus: Release 10.1.0.5.0 - Production on Wed Apr 4 05:21:44 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: apps
Enter password: apps
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Step-2.Make script to session kill:-
SQL>spool on
SQL> spool /home/oracle/session.sql
SQL>select 'alter system kill session '''||sid||','||serial#||''' immediate;' from v$session where status='INACTIVE';
SQL>spool off
SQL> @/home/oracle/session.sql
SQL>select 'alter system kill session '''||sid||','||serial#||''' immediate;' from v$session where status='INACTIVE';
SQL> select 'alter system kill session '||''''||sid||','||serial#||'''
immediate;',(sysdate-logon_time)/5 from V$session;
No comments:
Post a Comment