Wednesday, May 27, 2015

ORA-04061: existing state of package body and ORA-04065: not executed


found below issue while compiling package by two different uses.
============================================
ORA-04061: existing state of package body "test.test_PKG" has been invalidated
ORA-04065: not executed, altered or dropped package body "test.test_PKG"
ORA-06508: PL/SQL: could not find program unit being called: "test.test_PKG" 9:53 PM
Caused by: org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call TEST1_PKG.matchUpdatedInventory(?, ?, ?, ?, ?)}]; SQL state [72000]; ERROR code [4068]; ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package "TEST1.TEST1_PKG" has been invalidated
ORA-04065: not executed, altered or dropped package "TEST1.TEST1_PKG"
ORA-06508: PL/SQL: could not find program unit being called: "TEST1.TEST1_PKG"
ORA-06512: at line 1


Solution :

flushed shared pool fixed the issue.

cause: in the shared pool old compilation status was there. 

Wednesday, May 6, 2015

ORA-8104 "This index object %s is being online built or rebuilt."

ORA-8104 "This index object %s is being online built or rebuilt."

occur during if some one manually killed or terminated index rebuild script in half way.

fix
==========
SQL> select i.obj#, i.flags, u.name, o.name, o.type#    from sys.obj$ o, sys.user$ u, sys.ind$ idx, sys.ind_online$ I   where  bitand(i.flags, 512) = 512 and o.obj#=idx.obj# and
          o.owner# = u.user# and idx.obj#=i.obj#;
      OBJ#      FLAGS  NAME     TYPE#
---------- ---------- --------------------------------------------------
    1501151       2563 test user PK_TESTUSER


SQL> show user
USER is "SYS"
SQL> DECLARE
  2  isClean BOOLEAN;
  3  BEGIN
  4  isClean := DBMS_REPAIR.ONLINE_INDEX_CLEAN();
  5  END;
  6  /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

SQL>  select i.obj#, i.flags, u.name, o.name, o.type# 
  from sys.obj$ o, sys.user$ u, sys.ind$ idx, sys.ind_online$ i
  where  bitand(i.flags, 512) = 512 and o.obj#=idx.obj# and
          o.owner# = u.user# and idx.obj#=i.obj#;  2    3    4 

no rows selected

SQL>


execute 

alter index "index_name" rebuild online;
  

Partition table/index rebuild steps

Use below steps to generate rebuild scripts for table and indexes and execute o/p on database. 

select  'alter table '||OWNER||'.'||SEGMENT_NAME||' '||'move partition '||PARTITION_NAME ||';' from dba_segments where OWNER='ADMUSER' AND SEGMENT_NAME='TEST1';

select 'alter index '||index_owner||'.'||index_name||' rebuild partition '|| PARTITION_NAME ||';' from dba_ind_partitions   where index_name in (select  index_name from dba_indexes where table_name='TEST1')



Verify the index status using below scripts

select INDEX_OWNER , INDEX_NAME , STATUS from dba_ind_partitions where STATUS='UNUSABLE'
 select index_name , status , owner from dba_indexes where status='UNUSABLE'

Tuesday, July 16, 2013

ORA-01157: cannot identify/lock data file



file /oracle/admin/test1/diag/rdbms/test/test1/trace/test1_dbw0_5435.trc:
ORA-01157: cannot identify/lock data file 190 - see DBWR trace file
ORA-01110: data file 190: '/dev/mapper/oratest_data_001_8600Mp7'
ORA-27048: skgfifi: file header information is invalid
Additional information: 19
Errors in

Above oracle error found due to below possible reasons.
  • Multipath issue or storage issues , to fix involve system admin to debug more.  also try to check if any errors exists in /var/log/messages  
  • dmesg /var/log/messages. 
  •  select  FILE# , status , error  from v$datafile_header where ERROR IS NOT NULL

         FILE# STATUS  ERROR
    ---------- ------- ----------------------------------------
             1 ONLINE  WRONG DATABASE
            57 ONLINE  WRONG DATABASE
           190 ONLINE  FILE NOT FOUND
           216 ONLINE  FILE NOT FOUND
           324 ONLINE  WRONG DATABASE
           464 ONLINE  FILE NOT FOUND
  • most of the times after fixings issues from SA , DBA team face above error. follow below steps to fix. startup mount 
  • alter system check datafiles;
  • alter database open.
  • still issue exists we can check SA might have formatted the LUNS mistakenly.
    •  

Friday, July 5, 2013

11.2.0.3 RAC AND DATABASE SETUP



















































<!--[if !mso]>

<![endif]