Oracle Probleme: Unterschied zwischen den Versionen
Schild (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Gesperrte Tabellen entspereen == 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 n…“) |
Schild (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
== Gesperrte Tabellen entspereen == | == Gesperrte Tabellen entspereen == | ||
+ | |||
+ | ==SID der gesperrten Tabelle ermitteln== | ||
+ | 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: | ||
+ | |||
+ | <code> select session_id from dba_dml_locks where name = 'EMP';</code> | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="cpp"> | ||
+ | #include <iostream> | ||
+ | int m2 (int ax, char *p_ax) { | ||
+ | std::cout <<"Hello World!"; | ||
+ | return 0; | ||
+ | }</syntaxhighlight> | ||
+ | |||
+ | Output : | ||
+ | |||
+ | SID | ||
+ | ___ | ||
+ | 607 | ||
+ | |||
+ | |||
+ | ==ID der gesperrten Tabellenzeile ermitteln== | ||
+ | STEP 2: The next step is a script to find the Serial# for the table row lock : | ||
+ | <pre> | ||
+ | select | ||
+ | sid, | ||
+ | serial# | ||
+ | from | ||
+ | v$session | ||
+ | where | ||
+ | sid in ( | ||
+ | select | ||
+ | session_id | ||
+ | from | ||
+ | dba_dml_locks | ||
+ | where | ||
+ | name = 'EMP'); | ||
+ | </pre> | ||
+ | Output : | ||
+ | |||
+ | SID SERIAL# | ||
+ | ---- ------- | ||
+ | 607 1402 | ||
+ | |||
+ | |||
+ | ==Session beenden, die 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 | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == Gesperrte Tabellen entspereen == | ||
+ | |||
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: |
Version vom 16. März 2018, 11:01 Uhr
Inhaltsverzeichnis
1 Gesperrte Tabellen entspereen
2 SID der gesperrten Tabelle ermitteln
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 = 'EMP';
<syntaxhighlight lang="cpp">
- include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!"; return 0;
}</syntaxhighlight>
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 = 'EMP');
Output :
SID SERIAL#
-------
607 1402
4 Session beenden, die 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
5 Gesperrte Tabellen entspereen
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 = 'EMP';
Output :
SID ___ 607
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 = 'EMP');
Output :
SID SERIAL#
-------
607 1402
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';