By Mouhamadou Diaw

When deploying new Oracle Home on the same server or on a new server, you may use the downloaded Oracle binaries and do an install from scratch as usual. You may then apply any patch you have on your actually Oracle Homes. This may take time.
Oracle provides tools to clone an existing Oracle Home with all patches on top on it. I usually use the famous clone.pl script, but does it still work with Oracle 21c?
I decide to do some tests on my small lab

I actually have this following Oracle Home with the patch 33239276

1
2
3
4
5
6
7
8
oracle@oraadserver:/home/oracle/ [DB21 (CDB$ROOT)] echo $ORACLE_HOME/
/u01/app/oracle/product/21.3.0/db_1/
oracle@oraadserver:/u01/app/oracle/product/21.3.0/ [DB21 (CDB$ROOT)] opatch lspatches
33239276;Database Release Update : 21.4.0.0.211019 (33239276)
OPatch succeeded.
oracle@oraadserver:/u01/app/oracle/product/21.3.0/ [DB21 (CDB$ROOT)]

I decide to clone it in the same server using the traditional clone.pl script

1- Copy the binairies in db_1 in the new db_2 Oracle Home. Feel free to proceed as you like (zip, cp, tar…). Just adjust the permissions as they are on db_1

1
2
3
4
5
6
7
8
[root@oraadserver 21.3.0]# pwd
/u01/app/oracle/product/21.3.0
[root@oraadserver 21.3.0]#
[root@oraadserver 21.3.0]# ls -ld *
drwxr-xr-x. 66 oracle oinstall 4096 Dec 20 14:52 db_1
drwxr-xr-x. 66 oracle oinstall 4096 Dec 20 14:52 db_2
[root@oraadserver 21.3.0]#

2- Run the script clone.pl as follow with user oracle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
oracle@oraadserver:/home/oracle/ [DB21 (CDB$ROOT)] /u01/app/oracle/product/21.3.0/db_2/perl/bin/perl /u01/app/oracle/product/21.3.0/db_2/clone/bin/clone.pl ORACLE_BASE="/u01/app/oracle" ORACLE_HOME="/u01/app/oracle/product/21.3.0/db_2"  ORACLE_HOME_NAME=OraDB21Home3
Jan 24, 2022 1:04:03 PM oracle.install.library.util.MachineInfo isHostExadata
INFO: This host is not an Exadata system.
[INFO] [INS-32183] Use of clone.pl is deprecated in this release. Clone operation is equivalent to performing a Software Only installation from the image.
You must use /u01/app/oracle/product/21.3.0/db_2/runInstaller script available to perform the Software Only install. For more details on image based installation, refer to help documentation.
Starting Oracle Universal Installer...
You can find the log of this install session at:
 /u01/app/oraInventory/logs/cloneActions2022-01-24_01-04-02PM.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.
........................................
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 OraDB21Home3 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2022-01-24_01-04-02PM.log' for more details.
Setup Oracle Base in progress.
Setup Oracle Base successful.
..................................................   88% Done.
Setup Read-Only Oracle Home in progress.
Setup Read-Only Oracle Home successful.
..................................................   96% Done.
As a root user, execute the following script(s):
        1. /u01/app/oracle/product/21.3.0/db_2/root.sh
..................................................   100% Done.
oracle@oraadserver:/home/oracle/ [DB21 (CDB$ROOT)]

Despite the fact that we have the warning “[INFO] [INS-32183] Use of clone.pl is deprecated in this release…”, the process was successful. We now just have to run the root.sh script as required

1
2
3
[root@oraadserver 21.3.0]# /u01/app/oracle/product/21.3.0/db_2/root.sh
Check /u01/app/oracle/product/21.3.0/db_2/install/root_oraadserver_2022-01-24_13-07-38-506111736.log for the output of root script
[root@oraadserver 21.3.0]#

And we can then verify that the Oracle Home clone was fine.

1
2
3
4
5
6
7
oracle@oraadserver:/home/oracle/ [rdbms213c2] echo $ORACLE_HOME/
/u01/app/oracle/product/21.3.0/db_2/
oracle@oraadserver:/home/oracle/ [rdbms213c2] opatch lspatches
33239276;Database Release Update : 21.4.0.0.211019 (33239276)
OPatch succeeded.
oracle@oraadserver:/home/oracle/ [rdbms213c2]

But as we can see the clone.pl is deprecated, Oracle recommends performing a Software Only installation from the image. How this process does work?
Let’s see this method

1- Let’s create the gold image using the runInstaller command as below

From the source Oracle Home

1
2
[oracle@oraadserver ~]$  /u01/app/oracle/product/21.3.0/db_1/runInstaller -createGoldImage -destinationLocation /home/oracle/gold_software/
Launching Oracle Database Setup Wizard...

The wizard should run following images

If you do not have a graphical environment configured or do not want to use the graphical tool, just use the silent option in the command

1
[oracle@oraadserver ~]$  /u01/app/oracle/product/21.3.0/db_1/runInstaller -silent -createGoldImage -destinationLocation /home/oracle/gold_software/

2- Let’s now use the goldimage to deploy a new Oracle Home

The first step is to unpack the goldimage on the new Oracle Home folder

1
2
3
4
5
6
7
oracle@oraadserver:/home/oracle/gold_software/ [rdbms213c] ls -ltra
total 3622644
drwx------. 8 oracle oinstall       4096 Jan 24 13:38 ..
-rw-r--r--. 1 oracle oinstall 3709576334 Jan 24 13:44 db_home_2022-01-24_01-38-44PM.zip
drwxr-xr-x. 2 oracle oinstall         46 Jan 24 13:44 .
oracle@oraadserver:/home/oracle/gold_software/ [rdbms213c] mkdir -p /u01/app/oracle/product/21.3.0/db_2
oracle@oraadserver:/home/oracle/gold_software/ [rdbms213c] unzip -d /u01/app/oracle/product/21.3.0/db_2 db_home_2022-01-24_01-38-44PM.zip

And after we can start the deployment with the runInstaller in the new Oracle Home

1
2
3
[oracle@oraadserver db_2]$ pwd
/u01/app/oracle/product/21.3.0/db_2
[oracle@oraadserver db_2]$ ./runInstaller

The install process is the same that usual ( But here we will not need to install the eventual patches as they are already in the GoldImage). I will not show all screenshots for the install

And at the end of the installation, we can verify that the new Oracle Home has the same patch level

1
2
3
4
5
oracle@oraadserver:/home/oracle/ [rdbms213c2] opatch lspatches
33239276;Database Release Update : 21.4.0.0.211019 (33239276)
OPatch succeeded.
oracle@oraadserver:/home/oracle/ [rdbms213c2]

Note that here also you can use a silent install if you do not have or do not want graphical tool

We can also validate that the Oracle Inventory is fine

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
oracle@oraadserver:/home/oracle/ [rdbms213c2] opatch util LoadXML -xmlInput /u01/app/oraInventory/ContentsXML/inventory.xml
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2022, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/21.3.0/db_2
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/21.3.0/db_2/oraInst.loc
OPatch version    : 12.2.0.1.27
OUI version       : 12.2.0.9.0
Log file location : /u01/app/oracle/product/21.3.0/db_2/cfgtoollogs/opatch/opatch2022-01-24_14-05-10PM_1.log
Invoking utility "loadxml"
UtilSession: XML file is OK.
OPatch succeeded.
oracle@oraadserver:/home/oracle/ [rdbms213c2]

Conclusion

We saw how to clone an existing Oracle Home to a new one. Although you can still use the traditional clone.pl script it is highly recommended to adopt the gold image method for the latest Oracle versions