Install Oracle Database 18c Using RPM Packages

From Oracle Database 18c, we can install below Oracle software using RPM packages.

  • a single-instance Oracle Database.
  • an Oracle Database Instant Client software.

After software is installed, Oracle database can be created by:

  • Database Configuration Assistant (Oracle DBCA).
  • /etc/init.d/oracledb_ORCLCDB-18c service configuration script.

Restrictions and Guidelines for RPM-Based Installations.

  • Patching is still to use the OPatch utility.
  • Standard Edition 2 has no RPM-based Oracle Database installation available for.
  • Upgrades using rpm -Uvh is not supported. For Oracle Database upgrades, follow the regular upgrade process.
  • An RPM-based installation supports the installation of multiple Oracle Database software versions into different Oracle homes on the same machine.

Installing Oracle Database RPM using YUM

1)Log in as root.
2)If you are using Oracle Linux and have subscribed to Unbreakable Linux Network (ULN), you can install Oracle Database via a single yum command.

# yum -y install oracle-database-ee-18c

This command downloads and installs the Oracle Preinstallation RPM and the Oracle Database RPM packages.

Installing Oracle Database RPM Manually

1)Log in as root.
2)Download and install the Oracle Preinstallation RPM:

  1. On Oracle Linux.
    # yum -y install oracle-database-preinstall-18c 
    [root@oemnode1 ~]# rpm -qa | grep oracle-database-preinstall-18 oracle-database-preinstall-18c-1.0-1.el7.x86_64
  2. On Red Hat Enterprise Linux.
    # curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm 

    # yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

    After successful installation, you can delete the downloaded RPM file:

    # rm oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

3)Download oracle-database-ee-18c-1.0-1.x86_64.rpm to the /tmp directory.

4) Install the database software using the yum localinstall command.

#chown oracle:oinstll /opt/oracle 
#cd /tmp
[root@oemnode1 tmp]# yum -y localinstall oracle-database-ee-18c-1.0-1.x86_64.rpm Loaded plugins: ulninfo Examining oracle-database-ee-18c-1.0-1.x86_64.rpm: oracle-database-ee-18c-1.0-1.x86_64 Marking oracle-database-ee-18c-1.0-1.x86_64.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package oracle-database-ee-18c.x86_64 0:1.0-1 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================================================================= Package Arch Version Repository Size ======================================================================================================== Installing: oracle-database-ee-18c x86_64 1.0-1 /oracle-database-ee-18c-1.0-1.x86_64 7.8 G Transaction Summary ======================================================================================================== Install 1 Package Total size: 7.8 G Installed size: 7.8 G Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : oracle-database-ee-18c-1.0-1.x86_64 1/1 [INFO] Executing post installation scripts... [INFO] Oracle home installed successfully and ready to be configured. To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-18c configure Verifying : oracle-database-ee-18c-1.0-1.x86_64 1/1 Installed: oracle-database-ee-18c.x86_64 0:1.0-1 Complete!

Creating and Configuring an Oracle Database

  1. Tried to change ORACLE_SID, and PDB_NAME into whatever you  want in  configuration  file  “/etc/init.d/oracledb_ORCLCDB-18c”. But it did not work when creating database in the next step, so we have to use the default ones.

2. To create and configure a sample Oracle Database instance, run the following service configuration script:

[root@oemnode1 init.d]# /etc/init.d/oracledb_ORCLCDB-18c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" 
for further details.

Database configuration completed successfully. The passwords were auto 
generated, you must change them by connecting to the database using 
'sqlplus / as sysdba' as the oracle user.
[root@oemnode1 init.d]#

Removing RPM-based Oracle Database Installation

1)Drop instance, and listener configurations.

2)Run following command to remove the database installation by RPM.

[root@oemnode1 ContentsXML]# rpm -qa | grep 18c
oracle-database-preinstall-18c-1.0-1.el7.x86_64
oracle-database-ee-18c-1.0-1.x86_64
[root@oemnode1 ~]#  /etc/rc.d/init.d/oracledb_ORCLCDB-18c  -help
Usage: /etc/rc.d/init.d/oracledb_ORCLCDB-18c {start|stop|restart|configure}

[root@oemnode1 ~]#  /etc/rc.d/init.d/oracledb_ORCLCDB-18c stop
Shutting down Oracle Database instance ORCLCDB.
Oracle Database instance ORCLCDB shut down.
Stopping Oracle Net Listener.
Oracle Net Listener stopped.

[root@oemnode1 oracle]# yum -y remove oracle-database-ee-18c
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-18c.x86_64 0:1.0-1 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================
 Package                                                       Arch                                          Version                                      Repository                                                                    Size
=========================================================================
 oracle-database-ee-18c                                        x86_64                                        1.0-1                                        @/oracle-database-ee-18c-1.0-1.x86_64                                        7.8 G

Transaction Summary
==========================================================================
Remove  1 Package

Installed size: 7.8 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
[SEVERE] Listeners or databases are present in the system, remove them before proceeding with the deinstallation
error: %preun(oracle-database-ee-18c-1.0-1.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package oracle-database-ee-18c-1.0-1.x86_64
  Verifying  : oracle-database-ee-18c-1.0-1.x86_64                                                                                                                                                                                     1/1

Failed:
  oracle-database-ee-18c.x86_64 0:1.0-1

Complete!
[root@oemnode1 oracle]

If get above errors, please check :

a) There is no ORACLE_HOME entry in /etc/oratab.

b) There is no files under $ORACLE_HOME/dbs.

c) There is no files under $ORACLE_HOME/network/admin.

[root@oemnode1 ORCLCDB]# yum -y remove oracle-database-ee-18c
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-18c.x86_64 0:1.0-1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Removing:
oracle-database-ee-18c x86_64 1.0-1 @/oracle-database-ee-18c-1.0-1.x86_64 7.8 G

Transaction Summary
=============================================================================================================================================================================================================================================
Remove 1 Package

Installed size: 7.8 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : oracle-database-ee-18c-1.0-1.x86_64 1/1
warning: file /opt/oracle/product/18c/dbhome_1/network/admin/shrept.lst: remove failed: No such file or directory
warning: file /opt/oracle/product/18c/dbhome_1/network/admin/samples/tnsnames.ora: remove failed: No such file or directory
warning: file /opt/oracle/product/18c/dbhome_1/network/admin/samples/sqlnet.ora: remove failed: No such file or directory
warning: file /opt/oracle/product/18c/dbhome_1/network/admin/samples/listener.ora: remove failed: No such file or directory
warning: file /opt/oracle/product/18c/dbhome_1/network/admin/samples: remove failed: No such file or directory
warning: file /opt/oracle/product/18c/dbhome_1/dbs/init.ora: remove failed: No such file or directory
warning: file /etc/init.d/oracledb_ORCLCDB-18c: remove failed: No such file or directory
Verifying : oracle-database-ee-18c-1.0-1.x86_64 1/1

Removed:
oracle-database-ee-18c.x86_64 0:1.0-1

Complete!
Advertisement