Oracle Probleme: Unterschied zwischen den Versionen

Aus PPwiki
Wechseln zu: Navigation, Suche
Zeile 7: Zeile 7:
 
STEP 1:  To identify the SID for the table with the lock, you will use this system ID in a later query to get the serial number for the table row lock:
 
STEP 1:  To identify the SID for the table with the lock, you will use this system ID in a later query to get the serial number for the table row lock:
  
<pre>  
+
<pre>
 
select
 
select
 
   session_id
 
   session_id
Zeile 13: Zeile 13:
 
   dba_dml_locks
 
   dba_dml_locks
 
where
 
where
   name = 'b_auftrcol';
+
   name = 'b_auftrcol';</pre>
</pre>
 
  
 
Output :
 
Output :
Zeile 21: Zeile 20:
 
SID
 
SID
 
___
 
___
607
+
607</pre>
 
 
</pre>
 
  
  
Zeile 41: Zeile 38:
 
       dba_dml_locks
 
       dba_dml_locks
 
   where
 
   where
       name = 'b_auftrcol');
+
       name = 'b_auftrcol');</pre>
</pre>
+
 
 
Output :
 
Output :
 
<pre>
 
<pre>
 
SID SERIAL#
 
SID SERIAL#
 
---- -------
 
---- -------
607 1402
+
607 1402</pre>
</pre>
 
 
   
 
   
 
==Session beenden, der die Zeile sperrt==
 
==Session beenden, der die Zeile sperrt==
Zeile 56: Zeile 52:
 
alter system kill session 'SID,SERIALl#';
 
alter system kill session 'SID,SERIALl#';
  
alter system kill session '607,1402';
+
alter system kill session '607,1402';</pre>
  
</pre>
 
 
http://www.dba-oracle.com/t_remove_oracle_table_row_lock.htm
 
http://www.dba-oracle.com/t_remove_oracle_table_row_lock.htm

Version vom 16. März 2018, 12:08 Uhr

1 Gesperrte Tabellen entspereen

2 SID der gesperrten Tabelle ermitteln (nicht notwendig?)

Kann eigentlich übersprungen und direkt mit Step 2 angefangen werden

STEP 1: To identify the SID for the table with the lock, you will use this system ID in a later query to get the serial number for the table row lock:

select
   session_id
from
   dba_dml_locks
where
   name = 'b_auftrcol';

Output :

SID
___
607


3 ID der gesperrten Tabellenzeile ermitteln

STEP 2: The next step is a script to find the Serial# for the table row lock :

select
   sid,
   serial#
from
   v$session
where
   sid in (
   select
      session_id
   from
      dba_dml_locks
   where
      name = 'b_auftrcol');

Output :

SID SERIAL#
---- -------
607 1402

4 Session beenden, der die Zeile sperrt

STEP 3: Finally, we can use the "alter system" command to kill the session that is holding the table lock:

alter system kill session 'SID,SERIALl#';

alter system kill session '607,1402';

http://www.dba-oracle.com/t_remove_oracle_table_row_lock.htm