Saturday, April 24, 2021

Install Oracle 19c on AWS EC2 AMI Linux machines

Please take note this installation purely for demonstration purpose, as AWS Linux AMI image hasn't been officially certified for Oracle 19c installation.

Prepare Linux  OS environment


# Package list reference to RHEL 7 Requirements
yum install -y                     \
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                            \
libXrender                         \
libXrender-devel                   \
libgcc                             \
libstdc++                          \
libstdc++-devel                    \
libxcb                             \
make                               \
smartmontools                      \
sysstat                            \
net-tools


/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin
/usr/sbin/groupadd -g 54330 racdba

/usr/sbin/useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba -m -d /home/oracle oracle

[root@ip-172-31-11-120 ~]# mkdir /u01
[root@ip-172-31-11-120 ~]# chown -R oracle:oinstall /u01

[root@ip-172-31-11-120 ~]# cat << EOD > /etc/security/limits.d/oracle-database-preinstall-19c.conf

# oracle-database-preinstall-19c setting for nofile soft limit is 1024
oracle soft nofile 1024

# oracle-database-preinstall-19c setting for nofile hard limit is 65536
oracle hard nofile 65536

# oracle-database-preinstall-19c setting for nproc soft limit is 16384
# refer orabug15971421 for more info.
oracle soft nproc 16384

# oracle-database-preinstall-19c setting for nproc hard limit is 16384
oracle hard nproc 16384

# oracle-database-preinstall-19c setting for stack soft limit is 10240KB
oracle soft stack 10240

# oracle-database-preinstall-19c setting for stack hard limit is 32768KB
oracle hard stack 32768

# oracle-database-preinstall-19c setting for memlock hard limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM
oracle hard memlock 134217728

# oracle-database-preinstall-19c setting for memlock soft limit is maximum of 128GB on x86_64 or 3GB on x86 OR 90% of RAM
oracle soft memlock 134217728

# oracle-database-preinstall-19c setting for data soft limit is 'unlimited'
oracle soft data unlimited

# oracle-database-preinstall-19c setting for data hard limit is 'unlimited'
oracle hard data unlimited

EOD


[root@ip-172-31-11-120 ~]# cat << EOD >> /etc/sysctl.conf

# oracle-database-preinstall-19c setting for fs.file-max is 6815744
fs.file-max = 6815744

# oracle-database-preinstall-19c setting for kernel.sem is '250 32000 100 128'
kernel.sem = 250 32000 100 128

# oracle-database-preinstall-19c setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# oracle-database-preinstall-19c setting for kernel.shmall is 1073741824 on x86_64
kernel.shmall = 1073741824

# oracle-database-preinstall-19c setting for kernel.shmmax is 4398046511104 on x86_64
kernel.shmmax = 4398046511104

# oracle-database-preinstall-19c setting for kernel.panic_on_oops is 1 per Orabug 19212317
kernel.panic_on_oops = 1

# oracle-database-preinstall-19c setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# oracle-database-preinstall-19c setting for net.core.rmem_max is 4194304
net.core.rmem_max = 4194304

# oracle-database-preinstall-19c setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# oracle-database-preinstall-19c setting for net.core.wmem_max is 1048576
net.core.wmem_max = 1048576

# oracle-database-preinstall-19c setting for net.ipv4.conf.all.rp_filter is 2
net.ipv4.conf.all.rp_filter = 2

# oracle-database-preinstall-19c setting for net.ipv4.conf.default.rp_filter is 2
net.ipv4.conf.default.rp_filter = 2

# oracle-database-preinstall-19c setting for fs.aio-max-nr is 1048576
fs.aio-max-nr = 1048576

# oracle-database-preinstall-19c setting for net.ipv4.ip_local_port_range is 9000 65500
net.ipv4.ip_local_port_range = 9000 65500

EOD


[root@ip-172-31-11-120 ~]# sysctl -p


[root@ip-172-31-11-120 ~]# grep "SELINUX=" /etc/selinux/config
SELINUX=disabled

Installation 19c database in silence mode (Here I am using 19.11 golden image)


[oracle@ip-172-31-11-120 ~]$ unzip DB.19.11.GoldImage.zip -d /u01/db

# Fix permission issue if any 
[root@ip-172-31-11-120 ~]# /bin/chown -HRf oracle:oinstall /u01/db

cd /u01/db
./runInstaller  -silent -ignorePrereqFailure -waitforcompletion \
    oracle.install.option=INSTALL_DB_SWONLY \
    UNIX_GROUP_NAME=oinstall \
    INVENTORY_LOCATION=/u01/app/oraInventory \
    ORACLE_HOME=/u01/db \
    ORACLE_HOME_NAME='OraDB19Home1' \
    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=backupdba \
    oracle.install.db.OSDGDBA_GROUP=dgdba \
    oracle.install.db.OSKMDBA_GROUP=kmdba \
    oracle.install.db.OSRACDBA_GROUP=racdba \
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
    DECLINE_SECURITY_UPDATES=true

[root@ip-172-31-11-120 ~]# /u01/app/oraInventory/orainstRoot.sh.
[root@ip-172-31-11-120 ~]# /u01/db/root.sh


# Create listener

export ORACLE_BASE=/u01/app/oracle; export ORACLE_HOME=/u01/db; /u01/db/bin/netca /orahome /u01/db /instype typical /inscomp client,oraclenet,javavm,server,ano /insprtcl tcp /cfg local /authadp NO_VALUE /responseFile /u01/db/network/install/netca_typ.rsp /lisport 1521 /silent /orahnam OraDB19Home1

# Create Database Example 1:

export ORACLE_HOME=/u01/db; export ORACLE_BASE=/u01/app/oracle; /u01/db/bin/dbca -silent -createDatabase  -emConfiguration NONE  -templateName 'General_Purpose.dbc' -storageType FS -datafileDestination '/u01/app/oracle/oradata' -datafileJarLocation '/u01/db/assistants/dbca/templates' -sampleSchema true -oratabLocation /etc/oratab  -runCVUChecks false -continueOnNonFatalErrors true -createAsContainerDatabase true -numberOfPDBs 1 -pdbName pdb1 -gdbName 'orcl' -sid 'orcl' -initParams filesystemio_options=setall -ignorePrereqs    

# Create Database Example 2:

$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname CDB21 -sid CDB21 -createAsContainerDatabase true -numberOfPDBs 1 -pdbName PDB21 -createUserTableSpace true -responseFile NO_VALUE -characterSet AL32UTF8 -totalMemory 1800 -sysPassword WElcome123## -systemPassword WElcome123## -pdbAdminPassword WElcome123## -dbsnmpPassword WElcome123## -enableArchive true -recoveryAreaDestination /u03/app/oracle/fast_recovery_area -recoveryAreaSize 15000 -datafileDestination /u02/app/oracle/oradata

How to fix error "FROM_LOCATION(SourceLocation)"?

if you hit below error, the solution is to run "./runInstaller" inside Oracle Home using relative path, instead of absolution path below.

[oracle@ip-172-31-11-120 ~]$ /u01/db/oui/bin/runInstaller -ignoreSysPrereqs -waitforcompletion -silent \
>     oracle.install.option=INSTALL_DB_SWONLY \
>     UNIX_GROUP_NAME=oinstall \
>     INVENTORY_LOCATION=/u01/app/oraInventory \
>     ORACLE_HOME=/u01/db \
>     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=backupdba \
>     oracle.install.db.OSDGDBA_GROUP=dgdba \
>     oracle.install.db.OSKMDBA_GROUP=kmdba \
>     oracle.install.db.OSRACDBA_GROUP=racdba \
>     SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
>     DECLINE_SECURITY_UPDATES=true
Starting Oracle Universal Installer...

Checking swap space: 0 MB available, 500 MB required.    Failed <<<<

>>> Ignoring required pre-requisite failures. Continuing...

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2021-04-24_10-45-00AM. Please wait ...Oracle Universal Installer, Version 12.2.0.7.0 Production
Copyright (C) 1999, 2018, Oracle. All rights reserved.

You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2021-04-24_10-45-00AM.log
SEVERE:Values for the following variables could not be obtained from the command line or response file(s):
  FROM_LOCATION(SourceLocation)

Messages from Linux:


Apr 23 01:59:41 ip-172-31-11-120 kernel: NX (Execute Disable) protection: active
Apr 23 01:59:41 ip-172-31-11-120 kernel: SMBIOS 2.7 present.
Apr 23 01:59:41 ip-172-31-11-120 kernel: DMI: Amazon EC2 m5.large/, BIOS 1.0 10/16/2017
Apr 23 01:59:41 ip-172-31-11-120 kernel: Hypervisor detected: KVM
Apr 23 01:59:41 ip-172-31-11-120 kernel: tsc: Fast TSC calibration using PIT
Apr 23 01:59:41 ip-172-31-11-120 kernel: e820: last_pfn = 0x232a00 max_arch_pfn = 0x400000000
Apr 23 01:59:41 ip-172-31-11-120 kernel: x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT
Apr 23 01:59:41 ip-172-31-11-120 kernel: e820: last_pfn = 0xbfffa max_arch_pfn = 0x400000000
Apr 23 01:59:41 ip-172-31-11-120 kernel: Scanning 1 areas for low memory corruption
Apr 23 01:59:41 ip-172-31-11-120 kernel: Using GB pages for direct mapping
Apr 23 01:59:41 ip-172-31-11-120 kernel: RAMDISK: [mem 0x3607e000-0x37036fff]
Apr 23 01:59:41 ip-172-31-11-120 kernel: ACPI: Early table checksum verification disabled

Messages from Database Alert Log:

2021-04-24T11:37:33.914580+00:00
**********************************************************************
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Initial number of CPU is 2
Number of processor cores in the system is 1
Number of processor sockets in the system is 1
Capability Type : Network
capabilities requested : 7 detected : 0 Simulated : 0
Capability Type : Runtime Environment
capabilities requested : 400000FF detected : 8 Simulated : 0
Capability Type : Engineered Systems
capabilities requested : F detected : 0 Simulated : 0
Capability Type : Database Test
capabilities requested : 3 detected : 0 Simulated : 0
Capability Type : Database Editions
capabilities requested : C detected : 8 Simulated : 0
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/db/dbs/arch
Autotune of undo retention is turned on.
IMODE=BR
ILAT =51
LICENSE_MAX_USERS = 0
SYS auditing is enabled
NOTE: remote asm mode is local (mode 0x1; from cluster type)
NOTE: Using default ASM root directory ASM
NOTE: remote asm mode is local (mode 0x1; from cluster type)
NOTE: Cluster configuration type = NONE [2]
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0.
ORACLE_HOME:    /u01/db
System name:    Linux
Node name:      ip-172-31-11-120.ap-southeast-1.compute.internal
Release:        4.14.231-173.360.amzn2.x86_64
Version:        #1 SMP Mon Apr 19 23:20:22 UTC 2021
Machine:        x86_64


No comments:

Post a Comment