Skip to content
Home » Oracle » Patch Oracle before DBCA, Can We ?

Patch Oracle before DBCA, Can We ?

Yes, the answer is positive.

Usually, we patch Oracle home with one or more existing databases for routine software updates. However, for a new database server which requires up-to-date release of Oracle database software, we can patch Oracle home first, then create the database afterwards by using dbca.

Let's see the procedure.

  1. Unzip Installation Package
  2. We unzip the installation package to any place in the file system.

  3. Install Oracle software only
  4. The command is runInstaller.

  5. Install Newest OPatch
  6. Just replace OPatch with the newest one.

  7. Patch Oracle home
  8. The command is opatch apply. Please note that, SQL patch (datapatch -verbose) is unnecessary in this procedure.

  9. Network Configuration Assistant (Optional)
  10. The command is netca.

  11. Database Creation Assistant
  12. The command is dbca.

For 18c and Later Releases

Starting from 18c, the installation package becomes an image-based one. We can apply patches (Database Release Update, DBRU) during an Oracle Database installation.

Let's see the simplified procedure.

  1. Unzip Installation Package
  2. We unzip the installation package to Oracle home, can't go anywhere else.

  3. Install Newest OPatch
  4. Just replace OPatch with the newest one.

  5. Patch Oracle home + Install Oracle software only
  6. The command is runInstaller -applyRU.

  7. Network Configuration Assistant (Optional)
  8. The command is netca.

  9. Database Creation Assistant
  10. The command is dbca.

The differences are, we have to replace OPatch with the newest one (Step 2) before patching and installing Oracle home (Step 3). Furthermore, we reduce 1 step from the original procedure. It's pretty convenient for DBA to setup a new server.

runInstaller -applyRU

The tip is to add -applyRU option to make OUI patch Oracle home to the newest release as well. Here's an example.

[oracle@test ~]$ cd $ORACLE_HOME
[oracle@test dbhome_1]$ ./runInstaller -applyRU /sources/patches/34765931/
Preparing the home to patch...
Applying the patch /sources/patches/34765931/...
Successfully applied the patch.
...

In this case, p34765931 is DBRU 19.18.

Although using -applyRU option is convenient and worthy, the overall time consumed is nearly the same.

Silent Mode

Previously, we have talked about how to install Oracle home in silent mode. What about patch Oracle software in silent mode?

The same tip applies to it. Let's see the example:

[oracle@test dbhome_1]$ ./runInstaller -applyRU /sources/patches/34765931/ -silent -noconfig -ignorePreReq oracle.installer.ignorePreReq=TRUE oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=oper oracle.install.db.OSBACKUPDBA_GROUP=dba oracle.install.db.OSDGDBA_GROUP=dba oracle.install.db.OSKMDBA_GROUP=dba oracle.install.db.OSRACDBA_GROUP=dba oracle.install.db.rootconfig.executeRootScript=true oracle.install.db.rootconfig.configMethod=ROOT

Software Patched Level

To check the patch level of Oracle software after installation and patching, we use opatch lspatches.

[oracle@test dbhome_1]$ opatch lspatches
34765931;DATABASE RELEASE UPDATE : 19.18.0.0.230117 (REL-JAN230131) (34765931)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

OPatch succeeded.

As you can see, the result of listing patch history is the same as the original procedure. There're 2 patches in 1 install, that's why I said 19.3 installer package for download is also a base + release update one.

Now you can create a new database with the patched Oracle home.

SQL Patched Level

After a new database has been created, we can check its SQL patch level by querying DBA_REGISTRY_SQLPATCH.

SQL> select description from dba_registry_sqlpatch order by action_time desc;

DESCRIPTION
--------------------------------------------------------------------------------
DATABASE RELEASE UPDATE : 19.18.0.0.230117 (REL-JAN230131) (34765931)

It keeps only the very last record, no footprint of 19.3. That's the difference.

To see a good example of patching Oracle home before creating a database, you may refer to the post: How to Install Oracle Database 19.18 on Linux. In the example, we directly install Oracle 19.18 for the new database server.

Leave a Reply

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