Install Oracle 18C on Oracle Linux 7 (OEL7)

This article presents how to install Oracle 18C on Oracle Enterprise Linux 7 (OEL7).

Read following article how to install Oracle Enterprise Linux 7: Install Oracle Linux 7 (OEL7) (set 8G memory for your virtual machine before proceeding with Oracle software installation).

Software

Software for 18C is available on edelivery

Database software

V974953-01.zip

General the software is not for on-premises database but there is workaround. All you have to do is just add hidden parameter “_exadata_feature_on=true” to your database init.ora to start it.

OS configuration and preparation

OS configuration is executed as root. To login as root just execute following command in terminal.

su - root

The “/etc/hosts” file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1 oel7 oel7.dbaora.com localhost.localdomain localhost

Set hostname

hostnamectl set-hostname oel7.dbaora.com --static

Add groups

#groups for database management
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
groupadd -g 54330 racdba
Add user Oracle for database software
useradd -u 54321 -g oinstall \
-G dba,oper,backupdba,dgdba,kmdba,racdba oracle

Change password for user Oracle

passwd oracle

Packages

Check which packages are installed and which are missing

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' bc \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
fontconfig-devel \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libX11 \
libXau \
libXi \
libXtst \
libgcc \
librdmacm-devel \
libstdc++ \
libstdc++-devel \
libxcb \
make \
smartmontools \
sysstat

If you have information that librdmacm-devel is not installed probably you can ignore it

[root@oel7 ~]# yum install librdmacm-devel
Loaded plugins: langpacks, ulninfo
Package librdmacm-devel-1.1.0-2.el7.x86_64 is obsoleted 
by rdma-core-devel-15-7.el7_5.x86_64 which is already installed

and extra packages if you want. I don’t install them

(for Oracle ACFS Remote)

targetcli 
python 
python-configshell 
python-rtslib 
python-six

(for Oracle ACFS)

nfs-utils

(for Oracle RAC and Oracle Clusterware)

net-tools

You can install missing packages from dvd. Just mount it and install missing packages using rpm -Uvh command from directory <mount dvd>/Packages or by using yum install command.

NOTE – I’m using x86_64 version of packages

First option from dvd

rpm -Uvh libaio-devel*.x86_64.rpm
rpm -Uvh ksh*.x86_64.rpm

Second option using yum install command. It requires access to internet.

yum install libaio-devel*.x86_64
yum install ksh*.x86_64

Add kernel parameters to /etc/sysctl.conf

# kernel parameters for 18C installation

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
kernel.panic_on_oops=1

Apply kernel parameters

/sbin/sysctl -p

Add following lines to set shell limits for user oracle in file /etc/security/limits.conf

# shell limits for users oracle 18C

oracle   soft   nofile   1024
oracle   hard   nofile   65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   soft   memlock  3145728
oracle   hard   memlock  3145728

Disable firewall

service iptables stop
chkconfig iptables off

Additional steps

Add following lines in .bash_profile for user oracle

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=oel7.dbaora.com
export ORACLE_UNQNAME=ORA18C
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/18.0.0.0/db_1
export ORACLE_SID=ORA18C

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'

umask 022

if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
       ulimit -u 16384 
       ulimit -n 65536
    else
       ulimit -u 16384 -n 65536
    fi
fi

envo

Directory structure

Create directory structure as user root

ORACLE_BASE – /ora01/app/oracle

ORACLE_HOME – /ora01/app/oracle/product/18.0.0.0/db_1

mkdir -p /ora01/app/oracle/product/18.0.0.0/db_1
chown oracle:oinstall -R /ora01

SSH server

I use it for later connection as user oracle in GNOME using command ssh oracle@oel7.dbaora.com -X. Without it it won’t be possible to run X interfaces like Oracle Universal Installer.

Install ssh server. It should be already installed.

yum install openssh-server

start ssh server

systemctl start sshd

verify it works

systemctl status sshd

Install database software

Let’s start with database software installation as oracle user. Usually I’m connected as user root in GNOME so you need to use ssh.

Connect as user oracle

[root@oel7 ~]# ssh oracle@oel7.dbaora.com -X

Let’s start with database software installation as oracle user. Copy zip to ORACLE_HOME directory and then uznip it. It’s ready binaries !

[oracle@oel7 ~]$ 
cp V974953-01.zip /ora01/app/oracle/product/18.0.0.0/db_1
cd /ora01/app/oracle/product/18.0.0.0/db_1
unzip V974953-01.zip

after unzip you should see following

[oracle@oel7 db_1]$ pwd
/ora01/app/oracle/product/18.0.0.0/db_1
[oracle@oel7 db_1]$ ls
addnode cv drdaas javavm mgw ord precomp schagent.conf suptools
apex data dv jdbc network ordim QOpatch sdk ucp
assistants dbjava env.ora jdk nls ords R slax usm
bin dbs has jlib odbc oss racg sqldeveloper utl
clone deinstall hs ldap olap oui rdbms sqlj V974953-01.zip
crs demo install lib OPatch owm relnotes sqlpatch wwg
css diagnostics instantclient log opmn perl root.sh sqlplus xdk
ctx dmu inventory md oracore plsql runInstaller srvm

check environment settings

--I defined 4 aliases in .bash_profile of user oracle to make 
--administration easier :)

[oracle@oel7 ~]$ alias envo tns cdoh cdob
alias envo='env | grep ORACLE'
alias tns='cd $ORACLE_HOME/network/admin'
alias cdoh='cd $ORACLE_HOME'
alias cdob='cd $ORACLE_BASE'

--run alias command envo to display environment settings
[oracle@oel7 ~]$ envo
ORACLE_UNQNAME=ORA18C
ORACLE_SID=ORA18C
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=oel7.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/18.0.0.0/db_1

--run alias command cdob and cdoh 
--to check ORACLE_BASE, ORACLE_HOME 
[oracle@oel7 ~]$ cdob
[oracle@oel7 oracle]$ pwd
/ora01/app/oracle

[oracle@oel7 ~]$ cdoh
[oracle@oel7 db_1]$ pwd
/ora01/app/oracle/product/18.0.0.0/db_1
##########################################################
##   WARNING – the binaries are dedicated to exadata follow below instructions
##########################################################

Installation consists of 3 steps:

  • install and compile binaries
  • run NETCA to create LISTENER
  • run DBCA to generate scripts to create database
  • modify generated scripts and create database

Compile binaries

--run installation
./runInstall

1. Select “Set Up Software Only”. The first option “Create and configure a single instance database” will fail during creation of 18C database with exadata features.

2. Select “Single instance database installation” and click “Next” button

3. Select “Enterprise Edition” and click “Next” button.

4. Here you should see directory ORACLE_BASE for your binaries according to environmental settings. Click “Next” button.

5. Accept default and click “Next” button.

5. Here you can specify OS group for each oracle group. Accept default settings and click “Next” button.

6. Checks are started to verify if OS is ready to install database software.

7. I have allocated 8GB memory but some part of memory was used by virtual machine for graphical card so I ignored the errors. My swap was too small but it’s not important for test database.

8. If everything is right click “Install” button. It’s the last moment to come back to each of previous point and make changes.

9. Installation in progress … it should be very quick.

10. Once binaries are installed the last step is to run 2 scripts as user root.

--execute scripts
/ora01/app/oraInventory/orainstRoot.sh
/ora01/app/oracle/product/12.2.0/db_1/root.sh

Second script enables to install Oracle Trace File Analyzer (TFA). It’s worth to install it.

11. Binaries installation completed.

Configure LISTENER

Start NETCA administrator

[oracle@oel7 ~]$ netca

1. Select “Listener configuration” and click “Next” button.

2. Just click “Next” button.

3. Use default and click “Next” button.

4. Use default and click “Next” button.

5. Use default and click “Next” button.

6. Use default and click “Next” button.

7. Use default and click “Next” button.

8. Click “Finish” button.

Start listener

[oracle@oel7 ~]$ lsnrctl start

DBCA generate scripts to create database

As user oracle start DBCA

[oracle@oel7 ~]$ dbca

and follow database script generation

  1. Select “Create a database” and click “Next” button.

2. Select “Advanced configuration” and click “Next” button.

3. Here you can define type of database then click “Next” button.

4. Enter global database name, SID, PDB name then click “Next” button. You can uncheck “Create as Container database” if you want to create non pluggable database. Click “Next” button.

5. Here you can define storage attributes for your database. Click “Next” button when you re ready.

6. Specify Fast Recovery Area if you want to use it. Click “Next” button.

7. Choose listener to register database. Click “Next” button.

8.Here you can specify extra options Database Vault and Label Security. Click “Next” button.

9. On next 5 tabs specify details for your database memory usage, sizing details, character set, connection mode and if to install sample schemas. Click “Next” button when you are ready.

10. Specify port for Enterprise Manager express then click “Next” button.

11. Specify passwords for user SYS, SYSTEM,PDBADMIN. I use the same passwords for all users. Click “Next” button.

12. Uncheck “Create database” checkbox to avoid here creation of a database(it will fail anyway if you try), and check “Generate database creation scripts” checkbox. Click “Next” button.

13. Last chance to verify settings. Click “Finish” button to generate scripts.

Modify scripts and create database

1. Scripts are ready now it’s time to modify them and install 18C database. DBCA generated script in directory /ora01/app/oracle/admin/ORA18C/scripts.

[oracle@oel7 ~]$ cd /ora01/app/oracle/admin/ORA18C/scripts
[oracle@oel7 scripts]$ ls
cloneDBCreation.sql 
initORA18CTempOMF.ora 
ORA18C.sh 
plug_PDBSeed.sql 
postPDBCreation_PORA18C1.sql 
rmanPDBRestoreDatafiles.sql
CloneRmanRestore.sql 
initORA18CTemp.ora 
ORA18C.sql 
plug_PORA18C1.sql 
postScripts.sql 
rmanRestoreDatafiles.sql
init.ora 
lockAccount.sql 
PDBCreation.sql 
postDBCreation.sql 
rmanPDBCleanUpDatafiles.sql 
tempControl.ctl

2. Add _exadata_feature_on=true parameter to each init file. It’s workaround to create database on non exadata host.

[oracle@oel7 scripts]$ ls init*
init.ora initORA18CTempOMF.ora initORA18CTemp.ora
[oracle@oel7 scripts]$ 
echo "_exadata_feature_on=true" >> init.ora
echo "_exadata_feature_on=true" >> initORA18CTempOMF.ora 
echo "_exadata_feature_on=true" >> initORA18CTemp.ora

verify it

[oracle@oel7 scripts]$ cat init* | grep "_exadata_feature_on=true"
_exadata_feature_on=true
_exadata_feature_on=true
_exadata_feature_on=true

3. Start creation of database ./ORA18C.sh. The script will prompt to enter passwords for users SYS, SYSTEM make it enough complex eg. Oracle18C#

[oracle@oel7 scripts]$ ./ORA18C.sh
You should Add this entry in the /etc/oratab: 
ORA18C:/ora01/app/oracle/product/18.0.0.0/db_1:Y

SQL*Plus: Release 18.0.0.0.0 Production on Thu Jul 12 17:55:50 2018
Version 18.1.0.0.0

Copyright (c) 1982, 2017, Oracle. All rights reserved.

Enter new password for SYS: 
Enter new password for SYSTEM:

Enter password for SYS:

Connected to an idle instance.
SQL> spool /ora01/app/oracle/admin/ORA18C/scripts/CloneRmanRestore.log
....

4. Try to connect to container database as user SYS using sqlplus tool

[oracle@oel7 scripts]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 Production on Thu Jul 12 18:17:22 2018
Version 18.1.0.0.0

Copyright (c) 1982, 2017, Oracle. All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.1.0.0.0

SQL> create table test_tbl(id number);

Table created.

SQL> drop table test_tbl;

Table dropped.

Have a fun 🙂

Tomasz

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.