Wednesday, February 3, 2021

How to Manage Data Concurrency in Oracle Database

 



SQL> update emp set sal=sal+1200 where empno=7369;

1 row updated.

How to check Table lock mode?

SQL> lock table emp in exclusive mode;


How to busy row?
SQL> lock table emp in share mode nowait;
lock table emp in share mode nowait
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

How to kill the session ?

SQL> select sid,serial# username from v$session where sid in (select bl
ocking_session from v$session);

       SID   USERNAME
---------- ----------
       258      55536

SQL> alter system kill session '258,55536' immediate;

System altered.

No comments:

Post a Comment

 https://www.linkedin.com/pulse/building-real-time-database-monitoring-dashboard-oracle-khaleeq-tpwxf/