Thursday, 23 August 2012

"Oracle Grid Infrastructure is not configured properly. ASMCA needs Oracle Grid Infrastructure to configure ASM" error while creating ASM instance using ASMCA


While creating a ASM instance for standalone server using "asmca", we received the following error.



Intially the Oracle Grid Infrastructure was installed using following option "Install Oracle Grid Infrastructure software Only"

Solution

Execute the "root.sh" again as root user. "root.sh" can be found on grid home.

------------------------
[root@coltdb08 grid]# ./opt/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/opt/11.2.0/grid/perl/bin/perl -I/opt/11.2.0/grid/perl/lib -I/opt/11.2.0/grid/crs/install /opt/11.2.0/grid/crs/install/roothas.pl


To configure Grid Infrastructure for a Cluster execute the following command:
/opt/11.2.0/grid/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.

---------------------

You can see there is separate script for creating Grid Infrastructure for stand-alone server. Execute the script as root user

--------------------
[root@coltdb08 grid]# /opt/11.2.0/grid/perl/bin/perl -I/opt/11.2.0/grid/perl/lib -I/opt/11.2.0/grid/crs/install /opt/11.2.0/grid/crs/install/roothas.pl
Using configuration parameter file: /opt/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node coltdb08 successfully pinned.
Adding Clusterware entries to inittab

coltdb08     2012/08/23 16:56:53     /opt/11.2.0/grid/cdata/coltdb08/backup_20120823_165653.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
------------


Now try to create the ASM instance using "asmca", it will successfully create the ASM instance.




Thursday, 9 August 2012

Error: ORA-12545 while trying to connect using SCAN from the Oracle Client in Oracle 11gR2


While trying to connect from Oracle Client using the SCAN IP we are receiving the Error.

Enter user-name: system/manager@coltdb01-scan.test.exp:1521/sendb.test.exp

ERROR:
ORA-12545: Connect failed because target host or object does not exist

Steps to troubleshoot

1. check whether you are able to "ping" and "nslookup" the SCAN name from Client host. nslookup should resolve the SCAN ips

2. Check whether you have set your REMOTE_LISTENER correctly. In 11gR2 it should point to your SCAN name
 
    remote_listener                      string      coltdb01-scan:1521

3. Check your LOCAL_LISTENER parameter. It is very important, that you point your VIP correctly
 
    local_listener         (DESCRIPTION=(ADDRESS_LIST=(AD
                           DRESS=(PROTOCOL=TCP)(HOST=colt
                           db02-vip.test.exp)(PORT=1521))
                           ))


     Try to connect using the VIP name and  VIP IP address from the client instead of SCAN. If you are not able to connect using the VIP name and able to connect using the VIP IP address,
     make sure to change the local_listener value as below

    local_listener           (DESCRIPTION=(ADDRESS_LIST=(AD
                           DRESS=(PROTOCOL=TCP)(HOST=10.9
                           1.119.151)(PORT=1521))))

4. Make sure all your listener are online using following commands

   [oracle@coltdb01 admin]$ $GRID_HOME/bin/srvctl config scan
   [oracle@coltdb01 admin]$ $GRID_HOME/bin/srvctl config scan_listener
   [oracle@coltdb01 admin]$ $GRID_HOME/bin/crsctl stat res -w "TYPE = ora.scan_listener.type"
   [oracle@coltdb01 admin]$$GRID_HOME/bin/lsnrctl status LISTENER_SCAN1  ( Make sure you set the ORACLE_HOME env variable to GRID_HOME)
   [oracle@coltdb01 admin]$$GRID_HOME/bin/lsnrctl service LISTENER_SCAN1


My issue was fixed when I modified my local_listener to include the VIP IP address because the Oracle client was not able resolve the VIP name



Enter user-name: system/manager@coltdb01-scan.test.exp:1521/sendb.test.exp

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options



The reason is that the SCAN listener is only a front to the local listeners on each node. Once the SCAN interface determines what node to send you to it will basically change the connect string to the connect string of the local listener. The value of the local listener host for some reasons get from "local_listener" database initialisation parameter. By default you can have VIP adresses without domain name. If your DNS does not resolve nodes shortnames (which is quite common) SCAN does not know where is the node hosts and raise "ORA-12545: Connect failed because target host or object does not exist".

Tuesday, 7 August 2012

Moving OCR and Voting Disk from Raw Devices to ASM Disk

After upgrade from 10.2 to 11.3, you can use the following steps to move the ocr and Voting disk from Raw devices to ASM Disk.

1) Check the current OCR and Voting disk file

     OCR file status


     [oracle@coltdb01 ~]$ ocrcheck
     Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     240480
         Used space (kbytes)      :       6520
         Available space (kbytes) :     233960
         ID                       : 1362593683
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user

      Voting Disk status


       [oracle@coltdb01 ~]$ crsctl query css votedisk
       ##  STATE    File Universal Id                File Name Disk group
        --  -----    -----------------                --------- ---------
        1. ONLINE   2a87ecd7fedadfe9ff06de264773036e (/dev/raw/raw3) []
        2. ONLINE   2ca3947acf51ffa2bf271bf037bc8779 (/dev/raw/raw4) []
        3. ONLINE   1a72a3dca25eefabff869f8f5a661af3 (/dev/raw/raw5) []

2) Create a new ASM diskgroup for OCR and Voting disk.(you can use the existing disk also)

    SQL> create diskgroup CRS external redundancy DISK 'ORCL:VOL5';

    * Once you have created the Partition on node 1, execute the "partprobe" command on both the nodes
          
   * Execute "Oracleasm scandisks"  to check for the new ASM disk created. Verify using  "oracleasm listdisks" on node 2
   
   * Check on the node 2 whether the diskgroup created is mounted, otherwise mount it using
        SQL> alter diskgroup CRS MOUNT;

3) Change the compatible version of the asm diskgroup to 11.2

   SQL> select name,COMPATIBILITY,DATABASE_COMPATIBILITY from v$asm_diskgroup;

          NAME       COMPATIBILITY        DATABASE_COMPATIBILI
          ---------- -------------------- --------------------
          DATA         10.1.0.0.0           10.1.0.0.0
          FRA          10.1.0.0.0           10.1.0.0.0
          CRS          10.1.0.0.0           10.1.0.0.0

     SQL> alter diskgroup DATA set attribute 'compatible.asm'='11.2';

           Diskgroup altered.

     SQL> alter diskgroup FRA set attribute 'compatible.asm'='11.2';

          Diskgroup altered.

      SQL> alter diskgroup CRS set attribute 'compatible.asm'='11.2';

          Diskgroup altered.

       SQL> alter diskgroup DATA set attribute 'compatible.rdbms'='11.2';

          Diskgroup altered.

        SQL> alter diskgroup FRA set attribute 'compatible.rdbms'='11.2';

        Diskgroup altered.

        SQL> alter diskgroup CRS set attribute 'compatible.rdbms'='11.2';

        Diskgroup altered.

       SQL> select name,COMPATIBILITY,DATABASE_COMPATIBILITY from v$asm_diskgroup;

           NAME       COMPATIBILITY        DATABASE_COMPATIBILI
            ---------- -------------------- --------------------
           DATA         11.2.0.0.0           11.2.0.0.0
           FRA          11.2.0.0.0           11.2.0.0.0
           CRS          11.2.0.0.0           11.2.0.0.0

4) Replace the existing ocr file with the ASM disk
   
       [root@coltdb01 bin]# ./ocrconfig -replace /dev/raw/raw1 -replacement +CRS
   [root@coltdb01 bin]# ./ocrconfig -replace /dev/raw/raw2 -replacement +DATA

       Check the ocr status using ocrcheck
 
        [oracle@coltdb01 grid]$ ocrcheck
        Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     240480
         Used space (kbytes)      :       6516
         Available space (kbytes) :     233964
         ID                       : 1362593683
         Device/File Name         :       +CRS
                                    Device/File integrity check succeeded
         Device/File Name         :      +DATA
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user

5) Replace the voting disk as below
 
    [oracle@coltdb01 grid]$ crsctl replace votedisk +CRS
     CRS-4256: Updating the profile
     Successful addition of voting disk 8a10ad3375914f43bfc301334a9f6c2c.
     Successful deletion of voting disk 2a87ecd7fedadfe9ff06de264773036e.
     Successful deletion of voting disk 2ca3947acf51ffa2bf271bf037bc8779.
     Successful deletion of voting disk 1a72a3dca25eefabff869f8f5a661af3.
     Successfully replaced voting disk group with +CRS.
    CRS-4256: Updating the profile
    CRS-4266: Voting file(s) successfully replaced

     Check the Voting disk file
     [oracle@coltdb01 grid]$ crsctl query css votedisk
     ##  STATE    File Universal Id                File Name Disk group
     --  -----    -----------------                --------- ---------
      1. ONLINE   8a10ad3375914f43bfc301334a9f6c2c (ORCL:VOL5) [CRS]

6)  You can also use the following command to check ocr status
   
      cluvfy comp ocr -n all -verbose