Showing posts with label oracle 11g. Show all posts
Showing posts with label oracle 11g. Show all posts

Friday, September 27, 2013

Oracle 11g | Invalid Java Class Objects

Environment Details:
OS: Linux 5.8
Database Version: 11.2.0.3.0
Database User: Test

Issue: Java Class/Classes became INVALID after the upgrade of the database

Solution: First Compile and then resolve the Java Classes by using the below command.

ALTER JAVA SOURCE "OWNER"."OBJECT_NAME" COMPILE;

ALTER JAVA CLASS "OWNER"."OBJECT_NAME" RESOLVE;

Example:
SQL> select owner , object_name, object_type from dba_objects where status='INVALID';
OWNER       OBJECT_NAME             OBJECT_TYPE
----------- ----------------------- -----------
TEST        TestStringTokenizer     JAVA CLASS
TEST        TestStringTokenizer     JAVA SOURCE

SQL> ALTER JAVA SOURCE "TEST"."TestStringTokenizer" COMPILE;
Java altered.

SQL> ALTER JAVA CLASS "TEST"."TestStringTokenizer" RESOLVE;
Java altered.

SQL> select owner , object_name, object_type from dba_objects where status='INVALID';
no rows selected

Thursday, September 26, 2013

Oracle dbca | An unexpected error has been detected by HotSpot Virtual Machine


Environment Details:
OS: Linux 5.8
Database Version: 11.2.0.3.0
User: oracle
Issue: When the dbca is invoked for creating database, we get the below mentioned error and it is gets terminated.

54-oracle@linuxhost01=> dbca
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x0000003373279b60, pid=10441, tid=139987634067168
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_30-b03 mixed mode)
# Problematic frame:
# C  [libc.so.6+0x79b60]  strlen+0x10
#
# An error report file with more information is saved as hs_err_pid10441.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Abort

Solution: Set the LD_BIND_NOW parameter to 1 and then invoke dbca, it will work fine

55-oracle@linuxhost01=> export LD_BIND_NOW=1

56-oracle@linuxhost01=> dbca

Wednesday, August 21, 2013

ASM Diskgroup Not Compatible For Database Usage | Oracle RAC 11g

ASM Diskgroup Not Compatible For Database Usage

Environment Details:
OS: Linux 5.8
Database Version: 11.2.0.3.0
User: oracle

When we try to create a new database in a 11g RAC Environment, we are getting the error Diskgroup "+DATA_ " is not compatible for database usage. Database compatible attribute of diskgroup should be the same or lower than the database compatible initialization parameter value. Database compatible parameter is set to "11.2.0.0.0" and the diskgroup database compatibility attribute is set  to "11.2.0.2".




Check the value of the compatibility attribute from ASM instance by querying the V$ASM_DISKGROUP view.

SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;

INSTANCE_NAME
----------------
+ASM1

SQL>SELECT GROUP_NUMBER, NAME, COMPATIBILITY, DATABASE_COMPATIBILITY FROM V$ASM_DISKGROUP;

GROUP_NUMBER NAME            COMPATIBIL DATABASE_C
------------ --------------- ---------- ----------
           1 DATA_LINUX1     11.2.0.3.0 11.2.0.2.0
           2 DBFS_DG         11.2.0.3.0 11.2.0.2.0
           3 RECO_LINUX1     11.2.0.3.0 11.2.0.2.0

To Resolve the same we need to go the location $ORACLE_HOME/assistants/dbca/templates and edit the template we were trying to use(In our case its General_Purpose.dbc)

Search for the word "compatible" in the file and than change the attribute from 11.2.0.0.0 to 11.2.0.3.0

<InitParamAttributes>
      <InitParams>
         <initParam name="db_name" value=""/>
         <initParam name="dispatchers" value="(PROTOCOL=TCP) (SERVICE={SID}XDB)"/>
         <initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump"/>
         <initParam name="compatible" value="11.2.0.3.0"/>
 
Then run dbca to create the database.