Clone 12c RDBMS Binary

Share on:

RDBMS CLONE

We are currently living in the Cloud Era and the majority of organizations want to expand their database workloads to the Cloud. The Cloud Environment gives a clear picture of costs and gives more flexibility to optimize the workload. Challenging parts come when the organization wants to migrate on-prem Database Workloads to cloud environments. Even when it comes to Oracle Database Migration, there are many aspects to address.

As a first step in migrating Oracle Workloads from on-prem to a cloud environment, we need to make sure Oracle Binary Levels are identical. It’s important to match patch levels before working on a fresh installation. Installed patches can be compared via Opatch utility tool by running “./opatch lspatches “

Here is a sample output below:

[oracle@localhost OPatch]$

[oracle@localhost]$ ./opatch lspatches33192694;OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)
33192793;Database Release Update : 19.13.0.0.211019 (33192793)
33208123;OCW RELEASE UPDATE 19.13.0.0.0 (33208123)

OPatch succeeded.
[oracle@localhost]$

Installing the oracle RDBMS (Relational Database Management System) Binary takes a considerable amount of effort and time. To address this matter, Oracle has introduced a method to perform binary cloning. Before cloning, make sure to install the required RPMs for Oracle RDBMS. 

In this article, I will cover the cloning steps and issues encountered during this cloning process.

There are many benefits of cloning the RDBMS Binary, including: 

  • One-time installation and clone the installation to all other Servers
  • Simple to perform and it saves time and effort
  • No need to fire Oracle Installer on all Servers
 
Consistent RDBMS Binary Backup can be taken from the source database by stopping the running Database and the Listener.
 

Backup RDBMS HOME

############# Clone db home
cd /u01/app/oracle/product/12.1.0.2/
tar -cvf /backup/12C_BINARY_BKP/db_home_1_26012022_${HOSTNAME}.tar dbhome_1

 

Clone RDBMS Binary

Running below mention commands with “/u01/app/oracle/product/12.1.0.2/dbhome_1/clone/bin/clone.pl” helps to clone oracle binary.

/u01/app/oracle/product/12.1.0.2/dbhome_1/perl/bin/perl /u01/app/oracle/product/12.1.0.2/dbhome_1/clone/bin/clone.pl \
ORACLE_BASE="/u01/app/oracle/" ORACLE_HOME="/u01/app/oracle/product/12.1.0.2/dbhome_1" OSDBA_GROUP=dba -defaultHomeName

Sample Output

/u01/app/oracle/product/12.1.0.2/dbhome_1/perl/bin/perl /u01/app/oracle/product/12.1.0.2/dbhome_1/clone/bin/clone.pl \
ORACLE_BASE="/u01/app/oracle/" ORACLE_HOME="/u01/app/oracle/product/12.1.0.2/dbhome_1" OSDBA_GROUP=dba -defaultHomeName

[oracle@atz-retail-pos-ordb-dev-db02 dbhome_1]$ /u01/app/oracle/product/12.1.0.2/dbhome_1/perl/bin/perl /u01/app/oracle/product/12.1.0.2/dbhome_1/clone/bin/clone.pl ORACLE_BASE="/u01/app/oracle/" ORACLE_HOME="/u01/app/oracle/product/12.1.0.2/dbhome_1" OSDBA_GROUP=dba -defaultHomeName
./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/u01/app/oracle/" "ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1" "oracle_install_OSDBA=dba" -defaultHomeName  -silent -paramFile /u01/app/oracle/product/12.1.0.2/dbhome_1/clone/clone_oraparam.ini
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 25367 MB    Passed
Checking swap space: must be greater than 500 MB.   Actual 15359 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-01-26_08-45-55PM. Please wait ...You can find the log of this install session at:
 /u01/app/oraInventory/logs/cloneActions2022-01-26_08-45-55PM.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 OraHome1 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2022-01-26_08-45-55PM.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/oracle/product/12.1.0.2/dbhome_1/root.sh



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

Execute root.sh

### root.sh
[root@localhost installation]# /u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh
Check /u01/app/oracle/product/12.1.0.2/dbhome_1/install/root_atz-retail-pos-ordb-dev-snap-db03_2022-01-31_19-54-49.log for the output of root script
[root@local-host ]#[root@local-host ]# cat /u01/app/oracle/product/12.1.0.2/dbhome_1/install/root_atz-retail-pos-ordb-dev-snap-db03_2022-01-31_19-54-49.logPerforming root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0.2/dbhome_1
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

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.
[root@localhost]#

Make sure to check the relinking log file for verification

### latest log 
view /u01/app/oracle/product/12.1.0.2/dbhome_1/install/relink.log

 

Relink 

In this scenario, we faced issues while trying to create a database. Even though the cloning showed as successful, there were some relinking issues. The decision was to relink the Binary manually using the below-listed commands.

cd $ORACLE_HOME/rdbms/lib
make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk ipc_rds ioracle
$ORACLE_HOME/bin/relink all
$ORACLE_HOME/bin/skgxpinfo

Relink Issues

Open the latest relink log file and “/u01/app/oracle/product/12.1.0.2/dbhome_1/install/relink.log” and search for errors. We found permission issues on two binary files.
test ! -f /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjob || (\
   mv -f /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjob /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjobO &&\
   chmod 600 /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjobO )
chmod: changing permissions of ‘/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjobO’: Operation not permitted
make: [iextjob] Error 1 (ignored)
mv /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/lib/extjob /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjob

test ! -f /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssu || (\
   mv -f /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssu /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssuO &&\
   chmod 600 /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssuO )
chmod: changing permissions of ‘/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssuO’: Operation not permitted
make: [ijssu] Error 1 (ignored)
mv /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/lib/jssu /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssu

The Solution

Make sure to check the permission first on the Binary before making any changes. To get a clear idea about the binary files, you have to check the permission on the source server. To overcome this permission error, we changed the permission to Oracle and performed relink again.
[oracle@localhost]$ ls -l /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjobO
-rwsr-x---. 1 root oinstall 1630568 Jan 31 19:51 /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/extjobO
[oracle@localhost]$ ls -l /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssuO-rwsr-x---. 1 root oinstall 46920 Jan 31 19:51 /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/jssuO
[oracle@local-host]$
Share on:

More from this Author

OCI OEM Installation – (Using Market Place Image)

OCI OEM Installation – (Using Market Place Image)

  Introduction Monitoring plays a major part in mission-critical environments. Most businesses depend on IT infrastructure.  As the ... Read More

OCI Tablespace Creation Error ORA 28361 Master Key not yet set for CREATE TABLESPACE in OCI DBCS

OCI Tablespace Creation Error – ORA-28361: Master Key not yet set for CREATE TABLESPACE in OCI DBCS

Introduction We are living in a data era. Every organization invests in a colossal sum of money to secure its IT infrastructure environment. ... Read More

Back to Top