Cloning Oracle Grid Infrastructure home and ASM installation

perl clone Oracle GI and ASM installation

This tutorial is meant to work for RHEL/Centos environments. Covered few issues faced during grid software installation

  • TAR binaries and copy, make sure to bring down oracle services before creating tar.
[[email protected] product]# tar -czvf grid_home.tar.gz grid_home
[[email protected] product]$ scp grid_home.tar.gz node4:/u01/app/oracle/product/.
  • Partition disks required for ASM instance – follow procedure here
  • Create oracle OS user under dba group, this user will be owning the grid binaries.
[[email protected] tmp]# groupadd dba
[[email protected] tmp]# useradd -g dba oracle
  • Unzip binaries and setting few system environment variables.
[[email protected] disks]$ cd /u01/app/oracle/product
[[email protected] product]$ tar -xzvf grid_home.tar.gz
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/grid_home
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=+ASM
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
  • Running perl clone

[[email protected] grid_home]$ cd $ORACLE_HOME/clone/bin/

[[email protected] bin]$ perl clone.pl ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/grid_home ORACLE_HOME_NAME=OraHome1Grid INVENTORY_LOCATION=/u01/app/oraInventory CRS=TRUE
  • root level actions need to be performed
[[email protected] /]# /u01/app/oraInventory/orainstRoot.sh
[[email protected] app]# /u01/app/oracle/product/grid_home/root.sh
  • Looking at the output of root.sh command, we also need to run below roothas.pl to configure grid software for a standalone server installation.
[[email protected] lib]# /u01/app/oracle/product/grid_home/perl/bin/perl -I/u01/app/oracle/product/grid_home/perl/lib -I/u01/app/oracle/product/grid_home/crs/install /u01/app/oracle/product/grid_home/crs/install/roothas.pl
Using configuration parameter file: /u01/app/oracle/product/grid_home/crs/install/crsconfig_params
/u01/app/oracle/product/grid_home/bin/crsctl query crs activeversion ... failed rc=127 with message:
 /u01/app/oracle/product/grid_home/bin/crsctl.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory

Improper Oracle Grid Infrastructure configuration found on this host
Deconfigure the existing cluster configuration before starting
to configure a new Grid Infrastructure
run '/u01/app/oracle/product/grid_home/crs/install/roothas.pl -deconfig'
to configure existing failed configuration and then rerun root.sh

We got an error here, this is because of missing compat-libcap1-1.10-1.x86_64 rpm.

  • Install all dependent rpms required for oracle software.
yum install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat
  • Retry running roothas.pl, but first we need to deconfigure oracle restart using deconfig option
 [[email protected] lib]# /u01/app/oracle/product/grid_home/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /u01/app/oracle/product/grid_home/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Failure in execution (rc=-1, 0, No such file or directory) for command /etc/init.d/ohasd deinstall
Successfully deconfigured Oracle Restart stack
[[email protected] lib]# /u01/app/oracle/product/grid_home/perl/bin/perl -I/u01/app/oracle/product/grid_home/perl/lib -I/u01/app/oracle/product/grid_home/crs/install /u01/app/oracle/product/grid_home/crs/install/roothas.pl
Using configuration parameter file: /u01/app/oracle/product/grid_home/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'dba'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
OCR create keys failed, OCR error 27.
Creating local-only OCR (/u01/app/oracle/product/grid_home/bin/clscfg -local -g oracle) ... failed

So, it failed again 🙁 .. and looks like it is because of expecting oracle system user under oracle group.

[[email protected]4 lib]# /u01/app/oracle/product/grid_home/crs/install/roothas.pl -deconfig -force 

[[email protected] lib]# groupadd oracle
[[email protected] lib]# usermod -G oracle oracle
[[email protected] lib]# /u01/app/oracle/product/grid_home/perl/bin/perl -I/u01/app/oracle/product/grid_home/perl/lib -I/u01/app/oracle/product/grid_home/crs/install /u01/app/oracle/product/grid_home/crs/install/roothas.pl
Using configuration parameter file: /u01/app/oracle/product/grid_home/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'dba'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node node4 successfully pinned.
Adding Clusterware entries to upstart
node4 2017/06/06 20:36:38 /u01/app/oracle/product/grid_home/cdata/node4/backup_20170606_203638.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

It was successful this time

[[email protected] lib]# ps -ef|grep oracle
oracle 24132 1 2 20:36 ? 00:00:00 /u01/app/oracle/product/grid_home/bin/ohasd.bin reboot
oracle 24285 1 0 20:36 ? 00:00:00 /u01/app/oracle/product/grid_home/bin/oraagent.bin
oracle 24299 1 0 20:36 ? 00:00:00 /u01/app/oracle/product/grid_home/bin/evmd.bin
oracle 24333 24299 0 20:36 ? 00:00:00 /u01/app/oracle/product/grid_home/bin/evmlogger.bin -o /u01/app/oracle/product/grid_home/evm/log/evmlogger.info -l /u01/app/oracle/product/grid_home/evm/log/evmlogger.log
  • Run the following command, since this is for a standalone installation we are not setting CLUSTER_NODES
[[email protected] bin]$ ./runInstaller -updateNodelist ORACLE_HOME=/u01/app/oracle/product/grid_home -defaultHomeName CLUSTER_NODES= CRS=TRUE
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 2015 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
[[email protected] admin]$ crsctl check has
CRS-4638: Oracle High Availability Services is online
[[email protected] admin]$ crsctl check css
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
  • cssd is not up yet, we need to configure AUTO_START=1 attribute for cssd and diskmon and restart high availability service.
[[email protected] admin]$ crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
[[email protected] admin]$ crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
[[email protected] admin]$ crsctl stop has
[[email protected] admin]$ crsctl start has

[[email protected] dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.cssd ora.cssd.type ONLINE ONLINE node4
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE node4
ora.ons ora.ons.type OFFLINE OFFLINE
  • CREATE ASM SERVICE AND INSTANCE :

Creating an init file for ASM instance.

[[email protected] dbs]$ cat /u01/app/oracle/product/grid_home/dbs/init+ASM.ora
instance_type=asm
asm_diskstring='/dev/oracleasm/disks/*'
asm_power_limit=5
large_pool_size=12M
remote_login_passwordfile=exclusive
diagnostic_dest=/u01/app/oracle
  • Adding ASM service
[[email protected] dbs]$ srvctl status asm
PRCR-1001 : Resource ora.asm does not exist
[[email protected] dbs]$ srvctl add asm -p /u01/app/oracle/product/grid_home/dbs/init+ASM.ora
[[email protected] dbs]$ srvctl status asm
ASM is not running.
[[email protected] dbs]$ srvctl start asm
[[email protected] dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.asm ora.asm.type ONLINE ONLINE node4
ora.cssd ora.cssd.type ONLINE ONLINE node4
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE ONLINE node4
ora.ons ora.ons.type OFFLINE OFFLINE
  • Viewing ASM configuration
[[email protected] dbs]$ srvctl config asm
ASM home: /u01/app/oracle/product/grid_home
ASM listener was not found
PRCA-1032 : ASM listener LISTENER does not exist
Spfile: /u01/app/oracle/product/grid_home/dbs/init+ASM.ora
ASM diskgroup discovery string: ++no-value-at-resource-creation--never-updated-through-ASM++
  • Creating ASM diskgroups :
[[email protected] dbs]$ sqlplus / as sysasm
SQL> set pages 500 lines 200
SQL> col PATH for a30
SQL> SELECT MOUNT_STATUS, HEADER_STATUS, PATH, OS_MB, TOTAL_MB, FREE_MB FROM V$ASM_DISK;

MOUNT_S HEADER_STATU PATH OS_MB TOTAL_MB FREE_MB
------- ------------ ------------------------------ ---------- ---------- ----------
CLOSED PROVISIONED /dev/oracleasm/disks/DATA1 30720 0 0
CLOSED PROVISIONED /dev/oracleasm/disks/DATA2 30720 0 0

SQL> CREATE DISKGROUP DATA EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/DATA1','/dev/oracleasm/disks/DATA2';

Diskgroup created.

Verifying newly created DATA diskgroup

SQL> SELECT MOUNT_STATUS, HEADER_STATUS, PATH, OS_MB, TOTAL_MB, FREE_MB FROM V$ASM_DISK;

MOUNT_S HEADER_STATU PATH OS_MB TOTAL_MB FREE_MB
------- ------------ ------------------------------ ---------- ---------- ----------
CACHED MEMBER /dev/oracleasm/disks/DATA2 30720 30720 30695
CACHED MEMBER /dev/oracleasm/disks/DATA1 30720 30720 30693

SQL> select GROUP_NUMBER,NAME,BLOCK_SIZE,STATE,TOTAL_MB,FREE_MB from v$asm_diskgroup;

GROUP_NUMBER NAME BLOCK_SIZE STATE TOTAL_MB FREE_MB
------------ ------------------------------ ---------- ----------- ---------- ----------
 1 DATA 4096 MOUNTED 61440 61388

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *