Installation of Oracle 19c Database

Lokesh
8 min readAug 15, 2023

--

CLI Installation

  1. Click on Application icon -> System Utilities -> Terminal.

2. Enter the following command to switch to root user.

a. “su root”

b. Enter the root user password.

3. Enter the following commands to check the hostname of the system.

a. “hostnamectl”

4. Enter the following commands to edit the hosts file.

a. “vi /etc/hosts”

b. Press ‘i’ to enter insert mode.

c. Go to next line in the file and add machine IP Address, domain name(fqdn) and machine name.

d. Press ‘esc’ key to come out of insert mode.

e. Now, type ‘:wq’ to save and exit the file.

5. Oracle Installation Prerequisites

Automatic Installation

a. To download the Oracle database prerequisites 19c from the oracle server to oracle Linux machine.

Enter the following command yum install -y oracle-database-preinstall-19c”.

It will start downloading all the required packages from the server.

Note: If you are using RHEL7 or CentOS7, you can pick up the PRM from the OL7 repository and install it. It will pull the dependencies from your normal repositories using the following commands:

# yum install -y https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm”.

Manual Installation

a. If you have not used the “oracle-database-preinstall-19c” package to perform all prerequisites, you will need to manually perform the following setup tasks.

b. In order to perform manual installation, we have to edit “/etc/sysctl.conf” file And have to add these lines.

Enter the command “#vi /etc/sysctl.conf”

Press “i” to insert

Add these following lines in the file,

fs.file-max = 6815744

kernel.sem = 250 32000 100 128

kernel.shmmni = 4096

kernel.shmall = 1073741824

kernel.shmmax = 4398046511104

kernel.panic_on_oops = 1

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

net.ipv4.conf.all.rp_filter = 2

net.ipv4.conf.default.rp_filter = 2

fs.aio-max-nr = 1048576

net.ipv4.ip_local_port_range = 9000 65500

c. Now enter the following command to change the current kernel parameters: /sbin/sysctl -p

d. Add the following lines to the “/etc/security/limits.d/oracle-database-preinstall-19c.conf” file.

Enter the command:“vi /etc/security/limits.d/oracle-database-preinstall-19c.confpress “i” to insert

Add these following lines in the file,

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft nproc 16384

oracle hard nproc 16384

oracle soft stack 10240

oracle hard stack 32768

oracle hard memlock 134217728

oracle soft memlock 134217728

6. Verifying groups and Users

a. When we install the prerequisites package (oracle-database-preinstall-19c) all the required groups and users will be configured.

b. We can verify the user created in the passwd directory:

c. Command: vim /etc/passwd

d. We can verify the groups created in the group directory:

Command: vim /etc/group

  1. To check the id of the user (oracle) created we can use the command.

Command: id oracle

7. Create the directories in which the Oracle software will be installed

a. To create the directories, issue the following commands:

mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1

mkdir -p /u02/oradata

Note: Putting mount points directly under the root without mounting separate disks to them is typically a bad idea. It’s done here for simplicity, but for a real installation “/” storage should be reserved for the OS.

8. Give permissions to the Oracle user in order to access the directories

#chown -R oracle:oinstall /u01 /u02

#chmod -R 775 /u01 /u02

9. Add the server into the access control list:

Unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.

#xhost +<machine-name>

In this case the machine name is srv01.lti.com.

10. Setting up Environment Variables for the Software Owner Account

a. Create a “scripts” directory

mkdir /home/oracle/scripts

b. Create an environment file called “setEnv.sh’’. The “$” characters are escaped using “\”. If you are not creating the file with the cat command, you will need to remove the escape characters. These environment variables will run every time the bash_profile runs, setting up the environment for Oracle DB.

cat > /home/oracle/scripts/setEnv.sh <<EOF

# Oracle Settings

export TMP=/tmp

export TMPDIR=\$TMP

export ORACLE_HOSTNAME=srv01.lti.com

export ORACLE_UNQNAME=cdb1

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=\$ORACLE_BASE/product/19.0.0/dbhome_1

export ORA_INVENTORY=/u01/app/oraInventory

export ORACLE_SID=cdb1

export PDB_NAME=pdb1

export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH

export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib

EOF

c. Add a reference to the “setEnv.sh” file at the end of the /home/oracle/.bash_profile” file.

echo “. /home/oracle/scripts/setEnv.sh” >> /home/oracle/.bash_profile

d. Create a “start_all.sh” and “stop_all.sh” script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

i) Start_all.sh

cat > /home/oracle/scripts/start_all.sh <<EOF

#!/bin/bash

. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO

. oraenv

export ORAENV_ASK=YES

dbstart \$ORACLE_HOME

EOF

ii) Stop_all.sh

cat > /home/oracle/scripts/stop_all.sh <<EOF

#!/bin/bash

. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO

. oraenv

export ORAENV_ASK=YES

dbshut \$ORACLE_HOME

EOF

11. Provide the access of scripts to the Oracle user and Oinstall group

#chown -R oracle:oinstall /home/oracle/scripts

#chmod u+x /home/oracle/scripts/*.sh

12. Once the installation is complete and you’ve edited the “/etc/oratab”, you should be able to start/stop the database with the following scripts run from the “oracle” user.

~/scripts/start_all.sh

~/scripts/stop_all.sh

13. Installation

a. Log into the oracle user.(run su — oracle command followed by Oracle account password)

b. If you are using X emulation then set the DISPLAY environmental variable and add oracle user to the access control list.

i) export DISPLAY=’:0’

ii) Xhost +SI:localuser:oracle

c. Switch to the ORACLE_HOME directory, unzip the software directly into this path and start the Oracle Universal Installer (OUI) by issuing ./runInstaller commands in the ORACLE_HOME directory. The interactive mode will display GUI installer screens to allow user input.

d. Unzip software.

i) cd $ORACLE_HOME

NOTE: Make sure you are in the ORACLE_HOME directory before unzipping the Database file.

-> TO check the current directory, use the command PWD

ii) unzip -oq /u01/app/oracle/product/19.0.0/dbhome_1/LINUX.X64_193000_db_home.zip

GUI INSTALLATION

  1. For Launching Oracle Database Setup Wizard, we have to run the command ./runInstaller Select the option Create and configure a single instance database in order to create a starter database.

2. Under system class, we have to select the server class option

3. Select Enterprise Edition to install, as Oracle Database 19c Enterprise Edition is a self-managing database that has the scalability, performance, high availability, and security features required to run the most demanding mission critical applications.

4. We have to specify the path (/u01/app/Oracle), where installation owner can place all oracle software and configuration-related files

5. Specify a Inventory directory (/u01/app/orainventory ) for installation metadata files

Specify an operating system group (oinstall) whose members have write permission to the inventory directory.

6. Select the type of database, General Purpose/Transaction Processing

7. Provide Global database name (orcl.lti.com) that is useful for unique identification of a oracle database

8. Provide the Oracle System Identifier(SID) and also create a container database and specify the Pluggable database name

9. Enable Automatic Memory Management and allocate memory upto 40%

Note: Required Available memory for creating database cannot be more the current available memory

10. Choose to installsample schemas in the database so the human resources schema will be installed in the starter database

11. Specify the database file location(/u01/app/oracle/oradata), it is recommended to

12. Install datafiles and the Oracle database software on different disks.

13. Click on Next

14. Click on Next

15. Specify a Same Password that can be used for all accounts.

16. Assign the user defined groups(dba, oper, backupdba, dgdba, kmdba, racdba) to Privileged operating System groups(OSDBA, OSOPER, OSBACKUPDBA, OSDGDBA, OSKMDBA, OSRACDBA) respectively.

17. Click Next

18. Perform Prerequisite Checks, once all minimum requirements are satisfied, you may proceed with the installation

19. Click on Install

20. During installation, a dialog box will appear with two root scripts.

Open a new terminal and execute the root scripts with root privileges.

As a root user, execute the following script(s):

  • /u01/app/oraInventory/orainstRoot.sh
  • /u01/app/oracle/product/19.0.0/dbhome_1/root.sh

After finishing execution, we have to click on ok.

21. Once the configuration of oracle Database was successful, we can close the console

22. Connecting Oracle Linux 8.4 to Oracle database 19c

Once the installation of oracle database 19c is done, Follow the below steps in order to connect Oracle Linux to Oracle Database 19c:

  • Login to Oracle user using #su oracle
  • Enter the oracle directory using “# cd u01/app/ … “
  • Login to oracle data using # “. oraenv “
  • Enter Oracle SID # orcl
  • To connect to Oracle database 19c run the Command # sqlplus / as sysdba

23. Run the command lsnrctl status to see the status of the LISTENER and services summary

--

--

No responses yet