Академический Документы
Профессиональный Документы
Культура Документы
--------------------------------------------------------------------------------------------------------------------------------------Date - Jun 4 14
Env - Prod Ebs 071
When - Creating an index on WF Notification OUt table
________________________________________________________________________________
___________________________________________________________
Contents
-------Observation
Error code
Description
Diagnosis query
Available Applied Solution/work around
Applied Solution/work around
Log
Useful links
Referred MOS notes
DBA views involved
Unix/linux commands used
Google search terms used
________________________________________________________________________________
___________________________________________________________
Observation
-----------------------------------------------------------------------------------------------------------------------------------------ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
occurs while creating index
________________________________________________________________________________
___________________________________________________________
Error code
-----------------------------------------------------------------------------------------------------------------------------------------ORA-00054
________________________________________________________________________________
___________________________________________________________
Description
-----------------------------------------------------------------------------------------------------------------------------------------Error occurs as there are parallel sessions holding locks on the object and y
our ddl session is
1. unable to acquire lock
2. or timing out before acquiring lock
________________________________________________________________________________
___________________________________________________________
Diagnosis query
-----------------------------------------------------------------------------------------------------------------------------------------1. to check gv$access
2. to check locked objects
3. monitor session - check hema/dba/querries
4. kill session
- check hema/dba/querries
5. get details of session using the objects
1. to check gv$access
select s.sid ,s.serial#, s.inst_id, s.status, s.last_call_et/60 as "ela
psed", s.logon_time
,s.action, s.module, s.program, s.machine, s.terminal, s.process as "cl
FROM V$LOCKED_OBJECT L,
DBA_OBJECTS O,
V$SESSION S,
V$PROCESS P,
V$SQL SQ
WHERE
L.OBJECT_ID = O.OBJECT_ID
AND L.SESSION_ID = S.SID
AND S.PADDR = P.ADDR
AND S.SQL_ADDRESS = SQ.ADDRESS;
7. Get details of process initiating tcp network connection
netstat -ap | grep <proces_id>
tcp
0
0 machine.name:34465 oracle.db.com:ncube-lm ESTABLISHED
<PID>/java
________________________________________________________________________________
___________________________________________________________
Available Applied Solution/work around
-----------------------------------------------------------------------------------------------------------------------------------------Three approaches,
1. Retry the transaction after some time
2. Make the table read only temporarily - suggested by burleson - check im
pact before trying this
ALTER TABLE tab_name READ ONLY
SELECT table_name, read_only FROM dba_tables WHERE table_name = '&ta
b_name';
ALTER TABLE tab_name READ WRITE;
3. check gv$access, gv$locked_objects find who is locking the program. -refer queries
4. try increasing DDL_LOCK_TIMEOUT for the session and retry the DDL. -- n
ew feature in 11g ?
show parameter ddl_lock_timeout
alter session set ddl_lock_timeout=300 ;
________________________________________________________________________________
___________________________________________________________
Applied Solution/work around
-----------------------------------------------------------------------------------------------------------------------------------------which one worked out here
combination of 3 and 4 helped fixing this.
________________________________________________________________________________
___________________________________________________________
Log
-----------------------------------------------------------------------------------------------------------------------------------------[applscp@de01bzapp011 ~]$ sqlplus apps
SQL> show parameter ddl
NAME
TYPE
VALUE
------------------------------------ ----------- ----------------------------ddl_lock_timeout
integer
0
enable_ddl_logging
boolean
FALSE
SQL> conn applsys
Enter password:
Connected.
SQL> show user
USER is "APPLSYS"
SQL> CREATE INDEX WF_NOTIFICATION_OUT_N1 ON WF_NOTIFICATION_OUT(CORRID)
Index created.
SQL> exit ;
________________________________________________________________________________
___________________________________________________________
MOS notes
-----------------------------------------------------------------------------------------------------------------------------------------________________________________________________________________________________
___________________________________________________________
DBA views involved
-----------------------------------------------------------------------------------------------------------------------------------------view
column
description
gv$access
object
object being used
sid, inst_id
session inst_id -> gv$session
gv$locked_objects object_name
object being locked
locked_mode
0 - none 1 - null 2 - Row-S SS 3 - Row
-X SX 4 - Share 5 S/Row-X SSX 6 Exclusive
gv$block
block
blocked or not [0-no block 1-blocking
2-global]
dba_objects
object_name
object_type
gv$session
port
________________________________________________________________________________
___________________________________________________________
Unix/linux commands used
-----------------------------------------------------------------------------------------------------------------------------------------netstat
-a
list all
-p
process
________________________________________________________________________________
___________________________________________________________
Useful Links
-----------------------------------------------------------------------------------------------------------------------------------------Burleson
Description, source, table readonly
http://www
.dba-oracle.com/t_ora_00054_locks.htm
Oracle base
stimulation, cause, explanation
http://www.
oracle-base.com/articles/11g/ddl-lock-timeout-11gr1.php
Oracle Doc 11gr1
DDL_Lock_timeout parameter documentation
http://docs
.oracle.com/cd/B28359_01/server.111/b28320/initparams068.htm#REFRN10267
Morgan library
DDL_LOCK_TIMEOUT parameter demo
http://www.
morganslibrary.org/reference/ddl_stmnts.html
decipher infosys
Speaks about option 2
http://deci
pherinfosys.wordpress.com/2007/12/07/oracle-11g-alter-table-read-only/
abeytom
Find, fix resource busy error
http://abey
tom.blogspot.in/2012/08/finding-and-fixing-ora-00054-resource.html
https://learnwithme11g.wordpress.com/tag/ddl_lock_timeout/
select for update oracle example