Install Oracle 11g R2 Database On Oracle Linux 7.7 with EM (Enterprise Manager)

Just go through these steps, you will have Oracle 11GR2 database up and running on Oracle Linux 7.7 with Enterprise Manager (EM)

Note on Oracle version support: Starting with Oracle Database 11g Release 2 (11.2.0.3), Oracle Linux 6 and Red Hat Enterprise Linux 6 are supported on Linux x86 and Linux x86-64. … Starting with Oracle Database 11g Release 2 (11.2.0.4), Oracle Linux 7 and Red Hat Enterprise Linux 7 are supported on Linux x86-64. (link here)

In this serries:

Step 1: Install basic packages

Run below command as root user:

sudo yum install -y wget net-tools telnet curl wget gcc htop ntpdate binutils  compat-libstdc++-33 compat-libstdc++-33.i686 gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 unixODBC unixODBC-devel zlib-devel elfutils-libelf-devel sysstat make && yum -y update 

Step 2: Download the Oracle database software

You have 2 options to download:

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-download
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-download

After finish downloading you will have 2 or more ZIP files. Unzip all of them to a single directory called database with unzip command.

unzip linux.x64_11gR2_database_1of2.zip 
unzip linux.x64_11gR2_database_2of2.zip 

Step 3: Edit Host file

Edit /etc/hosts file

172.16.23.41 dg9.localdomain dg9

Edit /etc/hostname

dg9.localdomain

Install Oracle Prerequisites

yum install -y oracle-rdbms-server-11gR2-preinstall && yum update

Check if the “/etc/sysctl.conf” file is something like this (the number may be differrent because we already run preinstall above. Just a check step:

fs.aio-max-nr = 1048576 
fs.file-max = 6815744 
kernel.shmall = 2097152 
kernel.shmmax = 536870912 
kernel.shmmni = 4096 
# semaphores: semmsl, semmns, semopm, semmni 
kernel.sem = 250 32000 100 128 
net.ipv4.ip_local_port_range = 9000 65500 
net.core.rmem_default=262144 
net.core.rmem_max=4194304 
net.core.wmem_default=262144 
net.core.wmem_max=1048586 

Step 4: Additional Setup

Edit /etc/selinux/config

SELINUX=permissive

Then run the command

setenforce Permissive

Stop and disable FirewallD

systemctl stop firewalld
systemctl disable firewalld

Create installation directory

mkdir -p /u01/app/oracle/product/11.2.0.1/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Add these lines into /home/oracle/.bash_profile

# Oracle Settings 
TMP=/tmp; 
export TMP TMPDIR=$TMP; 
export TMPDIR ORACLE_HOSTNAME=dg9.localdomain; export ORACLE_HOSTNAME 
ORACLE_UNQNAME=DG9; export ORACLE_UNQNAME 
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0.1/db_1; export ORACLE_HOME ORACLE_SID=DG9; export ORACLE_SID 
ORACLE_TERM=xterm; export ORACLE_TERM 
PATH=/usr/sbin:$PATH; export PATH 
PATH=$ORACLE_HOME/bin:$PATH; export PATH 
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH 

Step 5: Start the installation

Install XMing and Putty configuration for Windows

If you are using Putty from Windows then first you need to install XMing – an X-Server that starts on top of your desktop. Download Xming and install it. Download PuTTY (if using Windows) and save it on your hard disk.

Related:  groovy.sql.Sql error calling firstRow with Oracle 10g

Start XMing as default.

Start PuTTY. In the PuTTY Configuration section, on the left panel, select Connection → SSH → X11. On the right panel, click on the Enable X11 forwarding checkbox. Set the X display location as :0.0. Enter the hostname or IP address in the Host Name textbox.

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-putty-config
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-putty-config

Now login as oracle user, run the installer. Please remember to run as oracle user and run the install file.

cd database
./runInstaller

You’ll have your X-application runs on your Windows via X11 forwarding configure.

Step 6: Some important options while installing

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-1
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-1

Choose “Create and configure a database”

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-2
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-2

Choose “Server class”

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-3
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-3

Then “Single Instance database installation” as we’re not using RAC.

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-4
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-4

Choose “Advanced install”

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-5
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-5

Choose “Enterprise Edition” depends on your license. No image here means just press NEXT.

oraerr.com-install-oracle-database-on-ol6.10-setup-03
oraerr.com-install-oracle-database-on-ol7.7-setup-03

Fill db name and SID

It is a very important step. Please remember to use CAPITALIZED words as both 2 names = DG9 (in this case). Because your automatically created spfile will be spfile[SID].ora -> if you stay with uncapitalized words -> file not found at database startup -> need to specify spfile to load manually.

Related:  Stored Procedure Dynamic Order By

Your EM Configuration file will be:

$ORACLE_HOME/[DB_UNIQUENAME]_[Captialized SID]/

Your spfile will be:

$ORACLE_HOME/dbs/spfile[captitalized SID]

Your OC4J configuration will be:

$ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_[DB_UNIQUENAME]_[Capitalized SID]

So, CAPITALIZED both SID & DATABASE NAME + Set both equal to DG9 (same value)

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-7
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-7

Configure Memory

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-8
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-8

Character sets

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-9
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-9

Set the password

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-10
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-10

In the last window, you may need to choose Ignore all checkbox and press Next. In my experience, those library will not affect too much in the operation of the database. Press Finish and wait for Oracle database to be installed on the machine.

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-11
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-11

Step 7: Fixing some errors and finalize installation

Fix invoking “ins_emagent.mk” error

While installing, you will receive some error like error while invoking ins_emagent.mk then edit “$ORACLE_HOME/sysman/lib/ins_emagent.mk” file, change

$(MK_EMAGENT_NMECTL) 

to:

$(MK_EMAGENT_NMECTL) -lnnz11

Fix invoking “ctx/lib/ins_ctx.mk” error

If you get error while invoking “ctx/lib/ins_ctx.mk“, create this fix.sh file as root:

# Fix ctx/lib/ins_ctx.mk
 
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
 
cat << __EOF__ > /tmp/memcpy_wrap.c
#include <stddef.h>
#include <string.h>
 
asm (".symver wrap_memcpy, memcpy@GLIBC_2.14");
void *wrap_memcpy(void *dest, const void *src, size_t n) {
return memcpy(dest, src, n);
}
__EOF__
 
if [[ -e "${ORACLE_HOME}/ctx/lib/ins_ctx.mk" ]]; then
sed -i -e 's/\$(INSO_LINK)/\$(INSO_LINK) -Wl,--wrap=memcpy_wrap \$(ORACLE_HOME)\/ctx\/lib\/memcpy_wrap.o/g' ${ORACLE_HOME}/ctx/lib/ins_ctx.mk
gcc -c /tmp/memcpy_wrap.c -o ${ORACLE_HOME}/ctx/lib/memcpy_wrap.o && rm /tmp/memcpy_wrap.c
fi

Now run this sh file and press RETRY button.

Related:  Oracle: how to do full text searches on an XMLType?

Fix ORA-00845: MEMORY_TARGET not supported on this system

You need to reduce the MEMORY parameter setting.

Fix ORA-19502: write error on file “…” and ORA-27072: File I/O error

You need to free more space on disk. Not enough disk space left for Oracle install.

Run the script to finalize the install.

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-12
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-12

When the successful dialog appears, press Close button to finish.

oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-13
oraerr.com-install-oracle-database-11gr2-oracle-linux-7-options-13

Now you can access the EM control page from your browser.

https://172.16.23.41:1158/em

You may need to ignore SSL certificate error on your browser.

oraerr.com-install-oracle-database-on-ol6.10-setup-05
oraerr.com-install-oracle-database-on-ol6.10-setup-05

You may check/restart/start/stop the EM with those commands:

emctl status dbconsole
emctl start dbconsole
emctl stop dbconsole

Step 8: Schedule Oracle database to start automatically after reboot

Edit the file “/etc/oratab” as follow:

DG9:/u01/app/oracle/product/11.2.0.1/db_1:Y