Wednesday, October 9, 2013

dbua/dbca | Could not create logging folder

Environment Details:
OS: Linux 5.8
Database Version: 11.2.0.3.0
Oracle Home: /u01/app/oracle/product/11.2.0.3.0


Issue: While running dbca/dbua the installer was not able to create the log file and we were getting the below error.


Resolution:  I verified that the ORACLE_HOME & PATH variables were set properly. Then I checked for the other environment variables and came to conclusion that there were other environment variables from where the installer was picking a wrong ORACLE_HOME, hence unset the variable of the incorrect location and again set the ORACLE_HOME variable. It started working.

[oracle@linux01 ~]$ export
declare -x BASH_ENV="/home/oracle/.bashrc"
declare -x CVS_RSH="ssh"
declare -x DISPLAY="localhost:13.0"
declare -x EDITOR="vi"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x HOME="/home/oracle"
declare -x HOSTNAME="linux01.us.oracle.com"
declare -x INPUTRC="/etc/inputrc"
declare -x JAVA_HOME="/usr/java/jdk1.7.0_40"
declare -x LD_LIBRARY_PATH="/scratch/oracle/product/12.1.0/dbhome_1/lib"
declare -x LOGNAME="oracle"
declare -x MAIL="/var/spool/mail/oracle"
declare -x OH_PATH="/scratch/oracle/product/12.1.0/dbhome_1/OPatch:/scratch/oracle/product/12.1.0/dbhome_1/bin"
declare -x ORACLE_BASE="/scratch/oracle"
declare -x ORACLE_HOME="/u01/app/oracle/product/11.2.0.3.0"
declare -x ORACLE_INSTANCE="/scratch/oracle/product/instances/WT11gR1_UCM"
declare -x PATH="/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin"
declare -x PWD="/home/oracle"
declare -x QTDIR="/usr/lib64/qt-3.3"
declare -x QTINC="/usr/lib64/qt-3.3/include"
declare -x QTLIB="/usr/lib64/qt-3.3/lib"
declare -x SHELL="/bin/bash"
declare -x SSH_TTY="/dev/pts/5"
declare -x TERM="xterm"
declare -x USER="oracle"

[oracle@linux01 ~]$ export |grep scratch
declare -x LD_LIBRARY_PATH="/scratch/oracle/product/12.1.0/dbhome_1/lib"
declare -x OH_PATH="/scratch/oracle/product/12.1.0/dbhome_1/OPatch:/scratch/oracle/product/12.1.0/dbhome_1/bin"
declare -x ORACLE_BASE="/scratch/oracle"
declare -x ORACLE_INSTANCE="/scratch/oracle/product/instances/WT11gR1_UCM"

[oracle@linux01 ~]$ unset  LD_LIBRARY_PATH OH_PATH ORACLE_BASE ORACLE_INSTANCE

[oracle@linux01 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3.0
[oracle@linux01 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@linux01 ~]$ dbua

Thursday, October 3, 2013

Oracle Home inventory is corrupted

Environment Details:
OS: Linux 5.8
Database Version: 11.2.0.3.0
Oracle Home: /u01/app/oracle/product/11.2.0.3.0
Inventory Location: $ORACLE_HOME/oraInventory
Issue: The Oracle Home was cloned from a different server, when we try to run the opatch lsinventory -invPtrLoc $ORACLE_HOME/oraInst.loc command, we were getting the error mentioned below.

-bash-3.2$ opatch lsinventory -invPtrLoc $ORACLE_HOME/oraInst.loc 
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/11.2.0.3.0
Central Inventory : /u01/app/oracle/product/11.2.0.3.0/oraInventory
   from           : /u01/app/oracle/product/11.2.0.3.0/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0.3.0/cfgtoollogs/opatch/opatch2013-10-01_01-07-20AM.log

List of Homes on this system:

  Home name= linux_DB__slot_ems12345_oracle_db_tech_st_11_2_0, Location= "/u01/app/oracle/product/11.2.0"
Inventory load failed... OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
   Oracle Home dir. path does not exist in Central Inventory
   Oracle Home is a symbolic link
   Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73

Solution: Did a through investigation and from the error noticed that it was taking a wrong oracle home. One of the suggestions was to recreate the inventory, but I checked the file /u01/app/oracle/product/11.2.0.3.0/oraInventory/ContentsXML/inventory.xml, the contents given below. I have modified the location LOC to the correct Home .i.e. /u01/app/oracle/product/11.2.0.3.0 and saved the file. When I issued the command opatch lsinventory -invPtrLoc $ORACLE_HOME/oraInst.loc again, everything was fine and I got the output.

-bash-3.2$ opatch lsinventory -invPtrLoc $ORACLE_HOME/oraInst.loc 
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/11.2.0.3.0
Central Inventory : /u01/app/oracle/product/11.2.0.3.0/oraInventory
   from           : /u01/app/oracle/product/11.2.0.3.0/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0.3.0/cfgtoollogs/opatch/opatch2013-10-01_01-12-44AM.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0.3.0/cfgtoollogs/opatch/lsinv/lsinventory2013-10-01_01-12-44AM.txt

-----------------------------------------------------------------
Installed Top-level Products (2): 

Oracle Database 11g                                                  11.2.0.3.0
Oracle Database 11g Examples                                         11.2.0.3.0
There are 2 products installed in this Oracle Home.

Interim patches (1) :

Patch  13366268     : applied on Mon Jun 10 21:58:09 PDT 2013
Unique Patch ID:  14394336
   Created on 21 Dec 2011, 08:14:06 hrs PST8PDT
   Bugs fixed:
     13366268
----------------------------------------------------------------
OPatch succeeded.

-bash-3.2$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>11.2.0.3.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="linux_DB__slot_ems12345_oracle_db_tech_st_11_2_0" LOC="/u01/app/oracle/product/11.2.0" TYPE="O" IDX="1"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>

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

Thursday, September 19, 2013

Oracle Error with Explain Plan | ORA-00904: "OTHER_TAG": invalid identifier

Environment Details:
OS: Linux 5.8
Database Version: 11.2.0.3.0
Issue: ERROR: an uncaught error in function display has happened; please contact Oracle support
Please provide also a DMP file of the used plan table PLAN_TABLE 
ORA-00904: "OTHER_TAG": invalid identifier

When we generate the explain plan and try to get the explain plan details from plan_table we get the above mentioned error.
The reason may be the plan table has been corrupted. We need to recreate the plan table using the script utlxplan.sql from $ORACLE_HOME/rdbms/admin and it will work fine.