Hi,
Sometimes application developers or client offers you to kill any session or sessions group like SQL Net Client, or JDBC Client sessions, RMAN sessions or All sessions.
You can read other Kill Session Scripts in Oracle.
https://ittutorial.org/oracle-kill-session-scripts-2/
https://ittutorial.org/oracle-kill-session-scripts-3/
gv$lock view lists the locks currently held by the Oracle Database and outstanding requests for a lock or latch.
You can list the locks running the following command.
SQL> select * from gv$lock;
You may want to kill some users sessions which are still executing more than 720 seconds and without SYS user and User type ( not background sessions ), then you can use following useful Oracle DBA script.
SELECT 'alter system kill session ''' || SID || ',' || s.serial# ||',@'||p.inst_id|| ''';' FROM gv$session s, gv$process p WHERE s.paddr = p.addr(+) and s.TYPE ='USER' and s.username!='SYS' and status='ACTIVE' and last_call_et > 720;
alter system kill session '409,13205,@2'; alter system kill session '776,14616,@2'; alter system kill session '1187,19997,@2'; alter system kill session '2694,61796,@2'; alter system kill session '24,29348,@2'; alter system kill session '822,34620,@2'; alter system kill session '1181,15588,@2'; alter system kill session '2310,62598,@2'; alter system kill session '409,13205,@1'; alter system kill session '776,14616,@1'; alter system kill session '1187,19997,@1'; System altered. System altered. System altered. System altered. System altered. System altered. System altered. System altered. System altered. System altered. System altered.
Do you want to learn Oracle Database for Beginners, then read the following articles.
https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/