To kill locked sessions in Oracle
To view the locked session on oracle
SQL> select oracle_username,object_id,session_id from v$locked_object;
ORACLE_USERNAME OBJECT_ID SESSION_ID
------------------------------ ---------- ----------
AHSAN_REPORT 321876 130
AHSAN_REPORT 320431 130
AHSAN_REPORT 320429 130
AHSAN_REPORT 320427 130
AHSAN_REPORT 320415 130
AHSAN_REPORT 320413 130
6 rows selected.
Now you would like to see which objects are actually locked. For this do as follows:
SQL> select object_name from dba_objects where object_id = 321876;
OBJECT_NAME
--------------------------------------------------------------------------------
APR_MOSAIC_GEO_CODE_DIM
After being sure that this object indeed belongs to you, you can kill it by:
1) first obtain the object Id from session.
SQL> select sid,serial# from v$session where sid=130;
SID SERIAL#
---------- ----------
130 8655
2) Kill the disturbing session.
SQL> alter system kill session '130,8655';
System altered.
Now you can verify that there are no more blocked objects.
SQL> select oracle_username,object_id,session_id from v$locked_object;
no rows selected
5 comments:
very helpful tips.. Thankyou.. it worked for me :D
I have a problem, the session doesn't release the locks.
SQL> select distinct object_name from dba_objects where object_id in (select object_id from v$locked
_object);
OBJECT_NAME
-----
AUDITORIAS
AUDITORIAS_COLUMNAS
CATEGORIAS
CONTROLES
DEPOSITOS
ESTRUCTURAS
EXISTENCIAS
FABRICANTES
LINEAS
LINEAS_ORIGENES
MARCAS
MONEDAS
ORIGENES
PRODUCTOS
TIPOS_BIENES
UNIDADES
VALORES
W_IGLI0210
18 filas seleccionadas.
SQL> select sid,serial# from v$session where sid=711;
SID SERIAL#
--------- ---------
711 12206
SQL> alter system kill session '711,12206' immediate;
Sistema modificado.
SQL> select sid,serial# from v$session where sid=616;
SID SERIAL#
--------- ---------
616 10165
SQL> alter system kill session '616,10165' immediate;
Sistema modificado.
ORACLE_USE OBJECT_ID SESSION_ID
---------- --------- ----------
FMCC 52837 457
FMCC 50117 457
FMCC 50099 457
FMCC 52120 457
FMCC 52024 457
FMCC 51455 457
FMCC 51297 457
FMCC 51211 457
FMCC 51177 457
FMCC 50926 457
FMCC 50603 457
FMCC 50292 457
FMCC 62352 457
ADGH 52837 466
ADGH 50117 466
ADGH 50099 466
ADGH 52120 466
ADGH 52024 466
ADGH 51455 466
ADGH 51297 466
ADGH 51211 466
ADGH 51177 466
ADGH 50926 466
ADGH 50603 466
ADGH 50292 466
ADGH 62352 466
ADGH 52837 537
ADGH 50117 537
ADGH 50099 537
ADGH 52120 537
ADGH 52024 537
ADGH 51455 537
ADGH 51297 537
ADGH 51211 537
ADGH 51177 537
ADGH 50926 537
ADGH 50603 537
ADGH 50292 537
ADGH 62352 537
GZAV 52837 550
GZAV 50117 550
GZAV 50099 550
GZAV 52120 550
GZAV 52024 550
GZAV 51455 550
GZAV 51297 550
GZAV 51211 550
GZAV 51177 550
GZAV 50926 550
GZAV 50603 550
GZAV 50292 550
GZAV 62352 550
ADGH 50117 578
ADGH 50099 578
ADGH 62356 578
ADGH 62354 578
ADGH 52837 578
ADGH 52120 578
ADGH 52024 578
ADGH 51455 578
ADGH 51297 578
ADGH 51211 578
ADGH 51177 578
ADGH 50926 578
ADGH 50603 578
ADGH 50292 578
ADGH 62352 578
MMGS 62356 599
ENUDA 52181 616
ENUDA 51181 616
ENUDA 52837 616
ENUDA 50117 616
ENUDA 50099 616
ENUDA 52120 616
ENUDA 52024 616
ENUDA 51455 616
ENUDA 51297 616
ENUDA 51211 616
ENUDA 51177 616
ENUDA 50926 616
ENUDA 50603 616
ENUDA 50292 616
ENUDA 62352 616
GZAV 50117 683
GZAV 50099 683
GZAV 62356 683
GZAV 62354 683
GZAV 52837 683
GZAV 52120 683
GZAV 52024 683
GZAV 51455 683
GZAV 51297 683
GZAV 51211 683
GZAV 51177 683
GZAV 50926 683
GZAV 50603 683
GZAV 50292 683
GZAV 62352 683
GZAV 50117 711
GZAV 50099 711
GZAV 62356 711
GZAV 62354 711
GZAV 52837 711
GZAV 52120 711
GZAV 52024 711
GZAV 51455 711
GZAV 51297 711
GZAV 51211 711
GZAV 51177 711
GZAV 50926 711
GZAV 50603 711
GZAV 62352 711
GZAV 50292 711
113 filas seleccionadas.
very useful
Existing without the answers to the difficulties you’ve sorted out through this guide is a critical case, as well as the kind which could have badly affected my entire career if I had not discovered your website.
Best PHP Training Institute in Chennai|PHP Course in chennai
Best .Net Training Institute in Chennai
Powerbi Training in Chennai
R Programming Training in Chennai
Javascript Training in Chennai
Post a Comment