Wednesday, May 24, 2017

Resource busy; not able to modify the table

step 1 // identify object id
 select OBJECT_ID from dba_objects where OBJECT_NAME='EMP

step 2 // identify who is locking
select
   c.owner,
   c.object_name,
   c.object_type,
   b.sid,
   b.serial#,
   b.status,
   b.osuser,
   b.machine
from
   gv$locked_object a ,
   gv$session b,
   dba_objects c
where
   b.sid = a.session_id
and
   a.object_id = c.object_id
   and c.object_id=1101;
 
 
solution
steps 3  //  modify ddl table lock time for 10 seconds
alter session set ddl_lock_timeout = 10;

step 4 // modify table
alter table // full modify table command