RAC one node to another node clone if another rac crash due to file deletion or permission change in grid home

1. On the source node to target node, create a copy of the Oracle Grid Infrastructure home. For example, as root on Linux systems, run the cp command:-

# cp -prf root@rac1:/u01/app/product/12.1.0/grid/* root@rac2:/u01/app/product/12.1.0/grid

2. Delete unnecessary files from the copy.The Oracle Grid Infrastructure home contains files that are relevant only to the source node, so you can remove the unnecessary files from the copy of the Grid Infrastructure home in the log, crs/init, crf, and cdata directories. The following example for Linux and UNIX systems shows the commands to run to remove the unnecessary files from the copy of the Oracle Grid Infrastructure home of rac2 node:-

[root@rac2 root]# cd copy_path
[root@rac2 grid]# rm -rf crs/install/crsconfig_addparams
[root@rac2 grid]# rm -rf host_name
[root@rac2 grid]# rm -rf log/host_name
[root@rac2 grid]# rm -rf gpnp/host_name
[root@rac2 grid]# find gpnp -type f -exec rm -f {} \;
[root@rac2 grid]# find cfgtoollogs -type f -exec rm -f {} \;
[root@rac2 grid]# rm -rf crs/init/*
[root@rac2 grid]# rm -rf cdata/*
[root@rac2 grid]# rm -rf crf/*
[root@rac2 grid]# rm -rf network/admin/*.ora
[root@rac2 grid]# find . -name ‘*.ouibak’ -exec rm {} \;
[root@rac2 grid]# find . -name ‘*.ouibak.1’ -exec rm {} \;
[root@rac2 grid]# rm -rf root.sh*

3.When you run the last of the preceding commands on the Grid home, it clears setuid and setgid information from the Oracle binary. It also clears setuid from the following binaries:

Grid_home/bin/extjob
Grid_home/bin/jssu
Grid_home/bin/oradism

Run the following commands to restore the cleared information:

chmod u+s Grid_home/bin/oracle
chmod g+s Grid_home/bin/oracle
chmod u+s Grid_home/bin/extjob
chmod u+s Grid_home/bin/jssu
chmod u+s Grid_home/bin/oradism

It is important to remove any Oracle network files from the Grid_home directory on both the source and destination nodes before continuing. For example, remove any tnsnames.ora, listener.ora, or sqlnet.ora files.

4.To set up the new Oracle Clusterware environment, the clone.pl script requires you to provide several setup values for the script. You can provide the variable values by either supplying input on the command line when you run the clone.pl script, or by creating a file in which you can assign values to the cloning variables. The following discussions describe these options.

[grid@rac2 bin]$ perl clone.pl -silent ORACLE_BASE=/u01/app/grid ORACLE_HOME=/u01/app/product/12.1.0/grid ORACLE_HOME_NAME=oraGrid12c INVENTORY_LOCATION=/u01/app/oraInventory

./runInstaller -clone -waitForCompletion “ORACLE_BASE=/u01/app/grid” “ORACLE_HOME=/u01/app/product/12.1.0/grid” “ORACLE_HOME_NAME=oraGrid12c” “INVENTORY_LOCATION=/u01/app/oraInventory” -silent -paramFile /u01/app/product/12.1.0/grid/clone/clone_oraparam.ini
Starting Oracle Universal Installer…

Checking Temp space: must be greater than 500 MB. Actual 7556 MB Passed
Checking swap space: must be greater than 500 MB. Actual 17407 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-03-24_07-33-12AM. Please wait …You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2017-03-24_07-33-12AM.log
………………………………………….. 5% Done.
………………………………………….. 10% Done.
………………………………………….. 15% Done.
………………………………………….. 20% Done.
………………………………………….. 25% Done.
………………………………………….. 30% Done.
………………………………………….. 35% Done.
………………………………………….. 40% Done.
………………………………………….. 45% Done.
………………………………………….. 50% Done.
………………………………………….. 55% Done.
………………………………………….. 60% Done.
………………………………………….. 65% Done.
………………………………………….. 70% Done.
………………………………………….. 75% Done.
………………………………………….. 80% Done.
………………………………………….. 85% Done.
……….
Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.
The cloning of oraGrid12c was successful.
Please check ‘/u01/app/oraInventory/logs/cloneActions2017-03-24_07-33-12AM.log’ for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
………………………………………….. 95% Done.

As a root user, execute the following script(s):
1. /u01/app/product/12.1.0/grid/root.sh

………………………………………….. 100% Done.

./runInstaller -updateNodelist ORACLE_HOME=/u01/app/product/12.1.0/grid -defaultHomeName CLUSTER_NODES= CRS=TRUE

About the Author

debasis maity

12+ years of rich experience on Database Administrations and on Infrastructure Solution Architect. AWS Certified Solution Architect and Senior Oracle DBA

0 thoughts on “RAC one node to another node clone if another rac crash due to file deletion or permission change in grid home

Leave a Reply

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