Monday, April 29, 2013

Issue with running catupgrd.sql while Database upgrade from 10.2.0.4 to 11.2.0.3:



Getting below error while running catupgrd.sql scripts while DB upgrade.

SELECT TO_NUMBER('MUST_HAVE_RUN_PRE-UPGRADE_TOOL_FOR_TIMEZONE')
                *
ERROR at line 1:
ORA-01722: invalid number

Cause:
------------
The Pre-Upgrade Script is not creating the registry$database table & inserting the Platform DST Patch Information.The error may also appear if the the registry$database table exists,  but does not contain the required information.

Solution:
-----------------

SQL> select * from sys.registry$database;

PLATFORM_ID PLATFORM_NAME        EDITION                        TZ_VERSION
----------- -------------------- ------------------------------ ----------
         13 Linux x86 64-bit

SQL> create table registry$database_b as select * from registry$database;

Table created.

select * from sys.registry$database;

PLATFORM_ID PLATFORM_NAME        EDITION                        TZ_VERSION
----------- -------------------- ------------------------------ ----------
         13 Linux x86 64-bit

SQL> INSERT into registry$database
  2                      (platform_id, platform_name, edition, tz_version)
  3                 VALUES ((select platform_id from v$database),
  4                         (select platform_name from v$database),
  5                          NULL,
  6                         (select version from v$timezone_file));

1 row created.

SQL> select * from sys.registry$database;

PLATFORM_ID PLATFORM_NAME        EDITION                        TZ_VERSION
----------- -------------------- ------------------------------ ----------
         13 Linux x86 64-bit
         13 Linux x86 64-bit                                             4

SQL> commit;

Commit complete.

SQL> delete from sys.registry$database where TZ_VERSION is NULL;

1 row deleted.

SQL> commit;

Commit complete.

SQL> select * from sys.registry$database;

PLATFORM_ID PLATFORM_NAME        EDITION                        TZ_VERSION
----------- -------------------- ------------------------------ ----------
         13 Linux x86 64-bit                                             4

Ref Doc: catupgrd.sql fails With ORA-01722 Invalid Number after running the Pre-Upgrade Script [ID 1466464.1]

Thursday, April 25, 2013

Opatch Error while Applying PSU 5 Patch in 11g.

Recently i got the below error while applying the PSU5 Patch on one of my Dev instance.

[oracle@xxxxxxxxxxxxxxxxxxxxx]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.
UtilSession failed: oracle/cluster/install/InstallException
Log file location: /oracle/product/11.2.0.3/XXXXXX/cfgtoollogs/opatch/opatch2013-04-25_02-37-35AM_1.log
OPatch failed with error code 73
The Stack Trace error shows the below error:

[Apr 25, 2013 2:37:38 AM]    OUI-67073:UtilSession failed: oracle/cluster/install/InstallException
[Apr 25, 2013 2:37:38 AM]    Finishing UtilSession at Thu Apr 25 02:37:38 EDT 2013
[Apr 25, 2013 2:37:38 AM]    Log file location: /oracle/product/11.2.0.3/OIMDEV/cfgtoollogs/opatch/opatch2013-04-25_02-37-35AM_1.log
[Apr 25, 2013 2:37:38 AM]    Stack Description: java.lang.RuntimeException: oracle/cluster/install/InstallException
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.sysman.oii.oiip.oiipg.OiipgClusterwareInfo.createClusterwareInfo(OiipgClusterwareInfo.java:155)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.sysman.oii.oiip.oiipg.OiipgClusterwareInfo.getClusterwareInfo(OiipgClusterwareInfo.java:180)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.sysman.oii.oiip.oiipg.OiipgDetectCluster.<init>(OiipgDetectCluster.java:131)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.sysman.oii.oiip.oiipg.OiipgDetectCluster.getDetectCluster(OiipgDetectCluster.java:146)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.Rac.getLocalNode(Rac.java:1789)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.Rac.getInstance(Rac.java:1236)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.Rac.getInstance(Rac.java:1101)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.opatchutil.NSession.validateConnectStringNodes(NSession.java:85)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.opatchutil.NApply.process(NApply.java:418)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.opatchutil.OUSession.napply(OUSession.java:1136)
[Apr 25, 2013 2:37:38 AM]    StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[Apr 25, 2013 2:37:38 AM]    StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[Apr 25, 2013 2:37:38 AM]    StackTrace: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[Apr 25, 2013 2:37:38 AM]    StackTrace: java.lang.reflect.Method.invoke(Method.java:592)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.UtilSession.process(UtilSession.java:322)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.OPatchSession.main(OPatchSession.java:2346)
[Apr 25, 2013 2:37:38 AM]    StackTrace: oracle.opatch.OPatch.main(OPatch.java:613)

I tried to search in oracle.support and google and didn't fine anything.. it 's looks more like java error rather than Database error. Then i carefully saw the java error and found that it is trying to searching Local Node. While querying opatch lsinv, the local and remote node was showing different node name rather than current node..

Rac system comprising of multiple nodes
  Local node = xxxxxxxxxxxxxxxx
  Remote node = xxxxxxxxxxxxxxxxx
SO i updated the updateNodeList parameter like below, and the opatch apply went successful.

cd $ORACLE_HOME/oui/bin/
./runInstaller -silent -updateNodeList ORACLE_HOME=/oracle/product/11.2.0.3/XXXXX "CLUSTER_NODES={host.cisco.com}"