Text box

Please note that the problems that i face may not be the same that exist on your environment so please test before applying the same steps i followed to solve the problem .

Sunday 11 December 2011

Investigating ITL wait resulted from ORA-00060: Deadlock detected

Hello,
I got the following error:ORA-00060: Deadlock detected
investigating the trace logfile i found :

Deadlock graph:
                       ---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TX-0013001c-0002687a       149     369     X            135     517           S
TX-000c0004-000283db       135     517     X             99     531           S
TX-00090003-0005c060        99     531     X            149     369           S

the session Holds wait type S made me check if it resulted from ITL wait and ehre i checked it using the following query:


select * from
(
   select 
      DECODE
      (GROUPING(a.object_name), 1, 'All Objects', a.object_name)
   AS "Object",
sum(case when 
   a.statistic_name = 'ITL waits' 
then 
   a.value else null end) "ITL Waits",
sum(case when 
   a.statistic_name = 'buffer busy waits' 
then 
   a.value else null end) "Buffer Busy Waits",
sum(case when 
   a.statistic_name = 'row lock waits' 
then 
   a.value else null end) "Row Lock Waits",
sum(case when 
   a.statistic_name = 'physical reads' 
then 
   a.value else null end) "Physical Reads",
sum(case when 
   a.statistic_name = 'logical reads' 
then 
   a.value else null end) "Logical Reads"
from 
   v$segment_statistics a
where 
   a.owner like upper('&owner')
group by 
   rollup(a.object_name)) b
where (b."ITL Waits">0 or b."Buffer Busy Waits">0);

The owner in the above query is the schema that the statement in the trace file runs against.

Some other queries that may help:
SELECT t.OWNER, t.OBJECT_NAME, t.OBJECT_TYPE, t.STATISTIC_NAME, t.VALUE
FROM v$segment_statistics t
WHERE t.STATISTIC_NAME = 'ITL waits'
AND t.VALUE > 0;

select SID,TYPE,ID1,ID2,LMODE,REQUEST from v$lock                                                            
where type='TX';                                                                                            

Select
   s.sid SID,
   s.serial# Serial#,
   l.type type,
   ' ' object_name,
   lmode held,
   request request
from
   v$lock l,
   v$session s,
   v$process p
where
   s.sid = l.sid and
   s.username <> ' ' and
   s.paddr = p.addr and
   l.type <> 'TM' and
   (l.type <> 'TX' or l.type = 'TX' and l.lmode <> 6)
union
select
   s.sid SID,
   s.serial# Serial#,
   l.type type,
   object_name object_name,
   lmode held,
   request request
from
   v$lock l,
   v$session s,
   v$process p,
   sys.dba_objects o
where
   s.sid = l.sid and
   o.object_id = l.id1 and
   l.type = 'TM' and
   s.username <> ' ' and
   s.paddr = p.addr
union
select
   s.sid SID,
   s.serial# Serial#,
   l.type type,
   '(Rollback='||rtrim(r.name)||')' object_name,
   lmode held,
   request request
from
   v$lock l,
   v$session s,
   v$process p,
   v$rollname r
where
   s.sid = l.sid and
   l.type = 'TX' and
   l.lmode = 6 and
   trunc(l.id1/65536) = r.usn and
   s.username <> ' ' and
   s.paddr = p.addr
order by 5, 6;



If you got IT 0 waits then it is not ITL wait problem but if you find that it is ITL problem then you have to refer to the following note:
How To Solve High ITL Waits For Given Segments. [ID 464041.1]



Monday 5 December 2011

Oracle APEX installation problems

Today i was asked to install oracle apex which was a very intersting task for me.I meet alot of problems related to database and solved it but the remarkable problems that were related to apex installation were solved in the following oracle notes:
1-Oracle apex needs oracle text to be installed:
Manual installation, deinstallation of Oracle Text 10gR1 [ID 280713.1].
2-Apex reported a problem related to grants:
The WWV_FLOW_HELP PACKAGE Status is Invalid After Installing Oracle Text [ID 1335521.1].
I wrote this document to share the information with the community.

Friday 2 December 2011

Egypt Oracle User Group(EGOUG)

I was searching Egypt for a real community group that acts and doing seminars and help people/customers ,but really i didn't find one.I wanted to start the idea and generated the group and now i am in the process of finding people in Egypt who are willing to work as volunteers with me in this non profit group that aim to help oracle community in Egypt.if you are interested please let me know.
The group link is:
http://www.linkedin.com/groups/Egypt-Oracle-User-Group-EGOUG-4201255?home=&gid=4201255&trk=anet_ug_hm

ORA-00600: internal error code, arguments: [qmxtrScalarIsRewritable:dft], [], [], [], [], [], [], [] and ORA-07445: exception encountered: core dump [kgghstfel()+4] [SIGSEGV] [Address n ot mapped to object] [0x000000018] [] []

I faced the following errors in the alert log and the developers were not able to view the DDL from the JDeveloper and toad for any user in the database.

The Call stack for the trace file for error ORA-07445 :


qmxtrxq()+464        CALL     qmxtrxq()            000000000 ?
                                                   FFFFFFFF7FFED090 ?
                                                   000000001 ?
                                                   FFFFFFFF7AD3B698 ?
kgghstfel()+4        PTR_CALL 0000000000000000     000000000 ? 106843EF0 ?
                                                   106843C10 ?
                                                   FFFFFFFF7D500200 ?
                                                   000000000 ?
                                                   FFFFFFFF7C73C000 ?
qmtLookup()+80       CALL     kgghstfel()          000000000 ? 3B26F7628 ?
                                                   000000000 ? 000000000 ?
                                                   000000002 ? 3B26CD118 ?
qmtRemoveRef()+76    CALL     qmtLookup()          10669E678 ? 3B26F7628 ?
                                                   3B26CD6D0 ? 000000029 ?
                                                   00010581D ?
                                                   FFFFFFFF7C026620 ?
qmxtrCleanRewriteCt  CALL     qmtRemoveRef()       10669E678 ? 3B2633A18 ?
x()+44                                             000105800 ? 10581D000 ?
                                                   3B26CD118 ? 000000000 ?
qmxtrxopn()+680      CALL     qmxtrCleanRewriteCt  FFFFFFFF7FFE5BC8 ?
                              x()                  FFFFFFFF7FFE5B18 ?
                                                   FFFFFFFF7FFED090 ?
                                                   10669E338 ? 10669E000 ?
                                                   00010669E ?
qmxtrxopt()+156      CALL     qmxtrxopn()          FFFFFFFF7B9C0118 ?
                                                   FFFFFFFF7FFED090 ?
                                                   000008000 ? 000000000 ?
                                                   002000000 ? 000004004 ?
qmxtrxq()+256        CALL     qmxtrxopt()          FFFFFFFF7B9C0118 ?
                                                   FFFFFFFF7FFED090 ?
                                                   000000000 ? 000000003 ?
                                                   FFFFFFFF7B9DFB20 ?
                                                   FFFFFFFF7B9DF718 ?
qmxtrxq()+464        CALL     qmxtrxq()            0FFFFBC00 ?
                                                   FFFFFFFF7FFED090 ?
                                                   000000000 ?
                                                   FFFFFFFF7B9C0118 ?
                                                   FFFFFFFF7B9DF718 ?
                                                   000000000 ?

after investigation i found similar bugs on metalink and they were related to XML DB.i decided to remove the XML DB from the database as it was not being used.

The steps to remove XML DB:
XDB Removal

The catnoqm.sql script drops XDB.

SQL> spool xdb_removal.log
SQL> set echo on;
SQL> connect / as sysdba
SQL> shutdown immediate;
SQL> startup
SQL> @?/rdbms/admin/catnoqm.sql
SQL> spool off;
you can refer to document :
 How to Deinstall and Reinstall XML Database (XDB) [ID 243554.1]


after removing the XML database i found many invalid objects in the sys user which impaced the database.i resolved those issues by running the following scripts:


Catalog - creates data dictionary views.
Catproc - create in built PL/SQL Procedures, Packages etc


running catalog and catproc will make your packages/procedures invalid. You will have to recompile them. 
You can use utlrp.sql which you can find in $ORACLE_HOME/rdbms/admin




after finishing the above statements i found no invalid objects in sys schema ,but the following error appeared:

Errors in file /app/home/oracle/admin/DEVDB/bdump/devdb_j000_29009.trc:
ORA-12012: error on auto execute of job 42568
ORA-04063: ORA-04063: package body "EXFSYS.DBMS_RLMGR_DR" has errors
ORA-06508: PL/SQL: could not find program unit being called: "EXFSYS.DBMS_RLMGR_
DR"
ORA-06512: at line 1
 has errors
Mon Nov 28 19:42:33 2011
Errors in file /app/home/oracle/admin/DEVDB/bdump/devdb_reco_11767.trc:
ORA-02019: connection description for remote database not found
Mon Nov 28 23:40:44 2011
 i resolved the following error by doing the following oracle note:
How To Install and Uninstall Expression Filter Feature or EXFSYS schema [ID 258618.1]

The database is up and running now with no problems.