Recently, a large volume of data stored in the process is interrupted, resulting in a lock on a table. Now I want to modify the stored procedure, because the lock exists and remains waiting.
In PL/SQL developer, set the session status to killed. After waiting for a long time, the result is not cleared by pmon, and the lock table remains there. For more information, use the following methods to unlock your account.
-- In the following SQL statement, you can list all scripts and enter sid. This Sid can be found in session of PL/SQL developer.
Select 'alter system kill session ''' | ta. Sid | ',' | ta. Serial # | ''';',
'Alter system disconnect session ''' | ta. Sid | ',' | ta. Serial # | ''' immediate ;',
'Host orakill' | TC. instance_name | ''| TB. spid,
'Kill-9' | TB. spid,
TB. spid,
Ta. osuser,
TB. program,
Ta. Terminal,
Ta. Program
From v $ session Ta, V $ process TB, V $ instance TC
Where TB. ADDR = TA. paddr
And ta. Sid = & yoursid;
-- You can also use the script provided by Metalink. The OS thread is the spid written at orakill.
Select P. spid "OS thread", B. Name "name-user", S. osuser, S. Program
From v $ PROCESS p, V $ session S, V $ bgprocess B
Where p. ADDR = S. paddr
And P. ADDR = B. paddr Union all
Select P. spid "OS thread", S. username "name-user", S. osuser, S. Program
From v $ PROCESS p, V $ session s
Where p. ADDR = S. paddr
And S. username is not null;
Then execute C:/> orakill oracle_sid OS _thread to kill the killed process. Do not kill system processes to avoid database downtime.