When oracleSession is locked
A problem often occurs. A table in oracle cannot be updated suddenly, either through pl/SQL Developer or through sqlplus, the execution of the update statement or the execution of the select * from table_name for update statement is the same and remains in the execution status and cannot be completed. In this case, I guess the session is locked? With this problem, we write an SQL statement:
-- Lock Table query SQL
SELECT object_name, machine, s. sid, s. serial # FROM gv $ locked_object l, dba_objects o, gv $ session s WHERE l. object_id = o. object_id AND l. session_id = s. sid;
The execution result is as follows:
We can see this piece of data. That is to say, a table is locked. At this time, we confirm that, the update operation cannot be completed because the table cannot be updated. <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + yOe6zsrNt8XE2D + 8zND41rTQ0NK7zPVTUWwg0 ++ 5Do8L3A + Signature = "brush: SQL;"> ALTER system kill session '2016 ';
We can see that SID and Serial are found in 601 and 802, in the format of alter system kill session "sid, serial # '; after the execution is complete:
When the locked session is absent, we will execute the table update operation again. We can see that the update is no problem.