Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

INSTALL & CREATE ORACLE 18C (18.3) on Oracle Linux

Posted by Mir Sayeed Hassan on March 14th, 2019

INSTALLATION OF ORACLE 18C SOFTWARE Only

[root@oracle18c_db ~]# cat /etc/oracle-release
Oracle Linux Server release 7.5

Oracle Linux Software is installed in this machine.

Download Oracle 18c (18.3) Software from below link:
https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

File: LINUX.X64_180000_db_home.zip

OS Configuration:

Login as a root & issue the below command

[oracle@oracle18c_db ~]$ su - root
Password:
Last login: Tue Mar 5 06:57:12 EST 2019 from 10.21.121.70 on pts/3

ADD HOSTNAME

[root@oracle18c_db ~]# vi /etc/hosts

192.168.120.131 oracle18c_db
:wq
[root@oracle18c_db ~]# hostnamectl set-hostname oracle18c_db --- Static registeration
[root@oracle18c_db ~]# vi /etc/sysconfig/network

# Created by anaconda
NETWORKING=yes
HOSTNAME=oracle18c_db
:wq
[root@oracle18c_db ~]# /etc/init.d/network restart
Restarting network (via systemctl):          [  OK  ]

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 ORACLE USER FOR DB

[root@oracle18c_db ~]# useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle

CHANGE ORACLE PWD

[root@oracle18c_db ~]# passwd oracle

Changing password for user oracle.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

CHECK REQUIRED RPM PACKAGE

[root@oracle18c_db ~]# 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
bc-1.06.95-13.el7(x86_64)
binutils-2.27-28.base.el7_5.1(x86_64)
compat-libcap1-1.10-7.el7(x86_64)
compat-libstdc++-33-3.2.3-72.el7(x86_64)
elfutils-libelf-0.170-4.el7(x86_64)
elfutils-libelf-devel-0.170-4.el7(x86_64)
fontconfig-devel-2.10.95-11.el7(x86_64)
glibc-2.17-222.el7(x86_64)
glibc-devel-2.17-222.el7(x86_64)
ksh-20120801-137.el7(x86_64)
libaio-0.3.109-13.el7(x86_64)
libaio-devel-0.3.109-13.el7(x86_64)
libX11-1.6.5-1.el7(x86_64)
libXau-1.0.8-2.1.el7(x86_64)
libXi-1.7.9-1.el7(x86_64)
libXtst-1.2.3-1.el7(x86_64)
libgcc-4.8.5-28.0.1.el7(x86_64)
package librdmacm-devel is not installed
libstdc++-4.8.5-28.0.1.el7(x86_64)
libstdc++-devel-4.8.5-28.0.1.el7(x86_64)
libxcb-1.12-1.el7(x86_64)
make-3.82-23.el7(x86_64)
smartmontools-6.5-1.el7(x86_64)
sysstat-10.1.5-13.el7(x86_64)

Check some of mandatory package

 

[root@oracle18c_db ~]# rpm -qa libaio-devel
libaio-devel-0.3.109-13.el7.x86_64
[root@oracle18c_db ~]# yum install ksh*.x86_64
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package ksh.x86_64 0:20120801-137.el7 will be updated
---> Package ksh.x86_64 0:20120801-139.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================
Package                                              Arch                                                    Version                                                            Repository                                             Size
===========================================================================
Updating:
ksh                                                  x86_64                                                  20120801-139.el7                                                   base                                                  885 k
Transaction Summary
===========================================================================
Upgrade  1 Package
Total size: 885 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Updating   : ksh-20120801-139.el7.x86_64                                                                                                                                                                                               1/2
Cleanup    : ksh-20120801-137.el7.x86_64                                                                                                                                                                                               2/2
Verifying  : ksh-20120801-139.el7.x86_64                                                                                                                                                                                               1/2
Verifying  : ksh-20120801-137.el7.x86_64                                                                                                                                                                                               2/2
Updated:
ksh.x86_64 0:20120801-139.el7

Complete!

In my case, I have the local repository to install any rpm package respect to the Oracle linux

[root@oracle18c_db ~]# vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 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
:wq

Execute kernel parameters

#/sbin/sysctl -p
[root@oracle18c_db ~]# vi /etc/security/limits.conf
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
:wq
Disable Firewall

[root@oracle18c_db ~]# systemctl stop firewalld
[root@oracle18c_db ~]# systemctl status firewalld
  • firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

DB CONFIGURATION

Edit the Bash Profile and issue below command

Login as Oracle user

[oracle@oracle18c_db ~]$ cat .bash_profile

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs

export PATH
# Oracle Settings
export TMP=/tmp
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
ORACLE_SID=ora18c; export ORACLE_SID
ORACLE_UNQNAME=ora18c; export ORACLE_UNQNAME
ORACLE_HOSTNAME=oracle18c_db; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/ora18c_soft; export ORACLE_HOME
export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$HOME/.local/bin:$HOME/bin
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
[oracle@oracle18c_db ~]$ . .bash_profile
[oracle@oracle18c_db ~]$ . oraenv

ORACLE_SID = [ora18c] ? ora18c
The Oracle base remains unchanged with value /u01/app/oracle

INSTALL DATABASE SOFTWARE ONLY

Login as the Oracle user & start the database software installation only as shown below

[root@oracle18c_db ~]# su - oracle
Last login: Wed Mar 6 02:45:14 EST 2019 on pts/1
[oracle@oracle18c_db ~]$ cd /u01/ora18c_soft/
[oracle@oracle18c_db ora18c_soft]$ ls
LINUX.X64_180000_db_home.zip
[oracle@oracle18c_db ora18c_soft]$ unzip LINUX.X64_180000_db_home.zip
[oracle@oracle18c_db ora18c_soft]$ ls
addnode     cfgtoollogs  ctx     dbs          dmu      has            inventory  jlib                          log      nls     opmn         ordim  owm      QOpatch  relnotes       root.sh.old.2  sdk           sqlpatch  ucp  xdk
apex        clone        cv      deinstall    drdaas   hs             javavm     ldap                          md       odbc    oracore      ords   perl     R        root.sh        root.sh.old.3  slax          sqlplus   usm
assistants  crs          data    demo         dv       install        jdbc       lib                           mgw      olap    oraInst.loc  oss    plsql    racg     root.sh.old    runInstaller   sqldeveloper  srvm      utl
bin         css          dbjava  diagnostics  env.ora  instantclient  jdk        LINUX.X64_180000_db_home.zip  network  OPatch  ord          oui    precomp  rdbms    root.sh.old.1  schagent.conf  sqlj          suptools  wwg

If you face an issue with the display, Try to resolve as shown below

  • Login as root & issue xhost +

  • Open the new terminal with enable x11 feature as localhost:0 & login with Oracle

  • Download the Xming Software to detect the GUI

[oracle@oracle18c_db ora18c_soft]$ ./runInstaller

Setup up Software Only

Select  the Software Only option & proceed further

 

 

 

 

 

 

 

 

 

 

 

 

Select the single instance database installation & click NEXT

 

 

 

 

 

 

 

 

 

 

 

 

Select Enterprise Edition & click Next.

 

 

 

 

 

 

 

 

 

 

 

 

Give the ORACLE_BASE directory location for environmental settings & click Next  

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with the given specify OS group for each oracle group & accept as default settings & click Next 

 

 

 

 

 

 

 

 

 

 

 

 

Try to re-compile the warning or you can ignore this warning –

 

 

 

 

 

 

 

 

 

 

 

 

Here proceed with the installation process.

 

 

 

 

 

 

 

 

 

 

 

 

Installation process started

 

 

 

 

 

 

 

 

 

 

 

 

Login as root & issue the given command

 

 

 

 

 

 

 

 

 

 

 

 

Execute the given script by using the root login

 

 

 

 

 

 

 

 

 

 

 

 

 

Therefore the Installation of database software is completed successfully

 

 

 

 

 

 

 

 

 

 

 

 

Configure LISTENER & TNSNAMES before the creation of database

 Login as the Oracle & issue the NETCA Command

[oracle@oracle18c_db ~]$ netca

Select Listener configuration  & click Next

 

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with ADD by default & click Next

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with LISTENER by default & click Next.

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with default TCP Protocol & click Next.

 

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with default PORT 1521 & click Next.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Click Next & Finish 

 

 

 

 

 

 

 

 

 

 

 

 

ADD The tnsnames services

 Proceed with default & click Next 

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with default & click next 

 

 

 

 

 

 

 

 

 

 

 

 

Provide the exact service name 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Proceed with default as TCP Protocol

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Provide the given hostname & select the default standard port number 1521 

 

 

 

 

 

 

 

 

 

 

 

 

If you need to test, test it or you can verify later

 

 

 

 

 

 

 

 

 

 

 

Click finish

 

 

 

 

 

 

 

 

 

 

 

CREATION OF DATABASE

 Select Create a database  & click Next

 

 

 

 

 

 

 

 

 

 

 

 

 

Assign the Global DB name, DB file location, Oracle standard format password & PDB Name

SID: ora18c

PDB Name:PDB1

SYS/SYSTEM/SYSMAN/DBSNMP: Oracle18cdb!

 

 

 

 

 

 

 

 

 

 

 

 

Verify the given details & proceed further

 

 

 

 

 

 

 

 

 

 

 

 

 

Started the database creation process

 

 

 

 

 

 

 

 

 

 

 

 

Hence the creation of database is completed & close the window

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VERIFY THE DATABASE

[oracle@oracle18c_db ~]$ . oraenv

ORACLE_SID = [ORA18C] ? ora18c
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@oracle18c_db ~]$ !sq
sqlplus / as sysdba
SQL> select status from V$instance;

STATUS
------
OPEN
SQL> show con_name
CON_NAME
-------------------
CDB$ROOT
SQL> select sys_context('USERENV','CON_NAME') from dual;
SYS_CONTEXT('USERENV','CON_NAME')
---------------------------------
CDB$ROOT
SQL> select name, cdb, con_id from v$database;
NAME      CDB     CON_ID
---------------------------
ORA18C    YES          0

 

SQL> select * from V$instance;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME   VERSION     VERSION_LEGACY    VERSION_FULL      STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE   ACTIVE_ST BLO     CON_ID INSTANCE_MO EDITION FAMILY                                                                           DATABASE_TYPE
--------------- ---------------- ---------------------------------------------------------------- ----------------- -----------------
1  ora18c      oracle18c_db     18.0.0.0.0        18.0.0.0.0        18.3.0.0.0        05-MAR-19 OPEN         NO           1 STOPPED  ALLOWED  NO ACTIVE  PRIMARY_INSTANCE NORMAL  NO  0 REGULAR EE    SINGLE
SQL> alter session set container=PDB1;
Session altered.
OR
SQL> connect system/Oracle18cdb!@pdb1
Connected.
SQL> sho user
USER is "SYSTEM"
SQL> select name,pdb from v$services order by 2;

NAME
----------------------------------------------------------------
PDB
----------------------------------------------------------------
SYS$BACKGROUND
CDB$ROOT
SYS$USERS
CDB$ROOT

ora18cXDB
CDB$ROOT
NAME                         PDB
----------------------------------------
ora18c                         pdb1
CDB$ROOT                PDB1
SQL> select NAME, OPEN_MODE from v$pdbs;
NAME                         OPEN_MODE
------------------------------------------
PDB$SEED          PDB1
READ ONLY                  READ WRITE
[oracle@oracle18c_db ~]$ lsnrctl status

LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 05-MAR-2019 06:32:55
Copyright (c) 1991, 2018, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle18c_db)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date                05-MAR-2019 06:11:53
Uptime                    0 days 0 hr. 21 min. 2 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/ora18c_soft/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oracle18c_db/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle18c_db)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "64a52f53a7683286e053cda9e80aed76" has 1 instance(s).
  Instance "ora18c", status READY, has 1 handler(s) for this service...
Service "8357ef6595df3749e0538378a8c0e2c5" has 1 instance(s).
  Instance "ora18c", status READY, has 1 handler(s) for this service...
Service "ora18c" has 1 instance(s).
  Instance "ora18c", status READY, has 1 handler(s) for this service...
Service "ora18cXDB" has 1 instance(s).
  Instance "ora18c", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
  Instance "ora18c", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracle18c_db ~]$ tnsping ora18c

TNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 05-MAR-2019 06:33:00
Copyright (c) 1997, 2018, Oracle.  All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle18c_db)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ora18c)))

OK (0 msec)
[oracle@oracle18c_db ~]$ tnsping pdb1
TNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 05-MAR-2019 06:33:03
Copyright (c) 1997, 2018, Oracle.  All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle18c_db)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = pdb1)))

OK (0 msec)

====Hence successfully completed the Oracle 18C Database Creation on Oracle Linux===