Oracle lock table query and unlocking method: First use [PL/SQL Developer] to connect and operate the oracle database; then use the statement select for update to lock the table; finally use the statement [alter system kill session 'sid] to unlock .
The operating environment of this article: Windows7 system, PL/SQL Developer version 13.0.1.1893, Dell G3 computer.
Recommended (free): oracle tutorial
oracle lock table query And unlocking method:
1. Use commonly used PL/SQL Developer to connect and operate the oracle database.
#2. For example, the commonly used select for update statement will lock the table.
select * from table_name for update;
3. What is the impact after locking the table? If other people operate this table, modifications to the table are not allowed. As the name suggests, lock the watch and prevent others from operating it.
As shown in the figure, when updating it, it cannot be submitted.
#4. How to query which tables are locked?
select p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_name from v$process p,v$session a, v$locked_object b,all_objects c where p.addr=a.paddr and a.process=b.process and c.object_id=b.object_id ;
#5. How to unlock it?
alter system kill session 'sid,serial#';(其中sid=l.session_id)
6. If you query again, there will be no record of the lock table.
The above is the detailed content of What are the methods of querying and unlocking Oracle lock table?. For more information, please follow other related articles on the PHP Chinese website!