Preface
Update the data for one table, on hundreds of, and then especially slowly, all the time, and then force it to return, again or again, taking into account the possibility of locking the table. Solve
① first finds which sessions are locked:
Select object_name,machine,s.sid,s.serial#
from V$locked_object l,dba_objects o, v$session s
where l.object_ id=o.object_id and L.session_id=s.sid;
After finding out, three objects were found.
② then kills the three objects one by one:
Alter system kill session ' 13,52136 ';
--Here's 13 is the sid,52136 detected by the top serial
Then there's another problem, and I'm going to check it again, the SID 13 session is still there, but the state is killed, I execute ALTER system kill session ' 13,52136 '; Ora-00031:session marked for Kill (marks the session to terminate)
The resource locked on the server database is still not released, at which point we can go to the server to kill the process.
first Identify the process number spid:
Select spid, Osuser, s.program from
v$session s,v$process p
where s.paddr=p.addr and s.sid=13; --spid=5162
and then kill the process based on the SPID of the query.
1. Linux os:kill-9 5162
2. Windows Os:orakill Mars 5162, where Mars is the instance name to kill the process.
open cmd under Windows, and enter a command tasklist/svc to view the service name of PID 5162, the instance name.
Here are three concepts:
The SPID one by one system process ID that
represents the Porcess ID of the server process at the OS level, that is, the operating system process ID
pid One by one Oracle process ID
Oracle process ID SID one by one session identity, which can be understood for Oracle's own use, is
commonly used to connect other columns
Reference Articles:
Ora-00031:session marked for kill handle locks that cannot be killed in Oracle
Oracle Lock Table Processing