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 it comes to Oracle databases migration there are many aspects to address.
As a first step, migrating Oracle workloads from on-prem to 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 lspatches
33192694;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 binary takes a considerable amount of effort and time. To address this matter, Oracle has introduced the method to perform binary cloning. Before cloning makes sure to install the required RPMs for Oracle RDBMS.
In this article, I will cover the cloning steps and issue encountered during this cloning process.
There are many benefits of cloning the RDBMS binary, A few benefits are listed below.
- 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.log
Performing 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 had 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
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]$