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

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

Note on Oracle version support: Starting with Oracle Database 11g Release 2 (, 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 (, 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

Please make sure that you set the DNS Servers to or sometimes you will get error like this will executing yum command:

# yum -y update
 Loaded plugins: refresh-packagekit, security, ulninfo
 Setting up Update Process [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host ''"
 Trying other mirror.
 Error: Cannot retrieve repository metadata (repomd.xml) for repository: public_ol6_UEKR4. Please verify its path and try again

To fix [Errno 14] PYCURL ERROR 6 – “Couldn’t resolve host ‘’ simply check and set your DNS nameserver to and restart server’s network.

Run below commands as root user:

sudo yum install -y wget net-tools telnet curl wget gcc 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-0.3.105 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 htop ntpdate 


yum -y update 

Step 2: Download the Oracle database software

You have 2 options to 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.


Step 3: Edit Host file

Edit /etc/hosts file dg9.localdomain dg9

Edit /etc/hostname


Install Oracle Prerequisites

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

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 

Step 4: Additional Setup

Edit /etc/selinux/config file:


Then run the command

setenforce Permissive

Stop and disable FirewallD

service iptables status
service iptables stop
chkconfig iptables off

Create installation directory

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

Add these lines into the end of /home/oracle/.bash_profile file

# Oracle Settings 
export TMP TMPDIR=$TMP; 
export TMPDIR ORACLE_HOSTNAME=dg9.localdomain; export ORACLE_HOSTNAME 
PATH=/usr/sbin:$PATH; export PATH 

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.

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.

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

cd database

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

Note: I have a separated post about X11 forwarding configuration here.

Step 6: Some important options while installing

At first step, if you have MOS (My Oracle Support) then fill in. If you don’t, uncheck and press next.

Next screen

Choose “Create and configure a database”

Choose “Server class”

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

Choose “Advanced install”

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

Leave Oracle Base & Software location default as we set above. Same with Inventory Directory next screen. Choose General Purpose/Transaction Processing on the next screen.

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.

Your EM Configuration file will be:


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)

Configure Memory. Set it to about 70-80% your total Available Memory.

Character sets

Set the password

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.

Step 7: Fixing some errors (if any) and finalize installation

Fix invoking “” error

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




Fix invoking “ctx/lib/” error

If you get error while invoking “ctx/lib/“, create this file as root:

# Fix ctx/lib/
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);
if [[ -e "${ORACLE_HOME}/ctx/lib/" ]]; 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/
gcc -c /tmp/memcpy_wrap.c -o ${ORACLE_HOME}/ctx/lib/memcpy_wrap.o && rm /tmp/memcpy_wrap.c

Now run this sh file and press RETRY button.

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. If you don’t see those errors, then congratulation.

Run the script to finalize the install.

Login to server as root user and run the scripts above. You will have something like this:

[root@dg9 ~]# /u01/app/oraInventory/
 Changing permissions of /u01/app/oraInventory.
 Adding read,write permissions for group.
 Removing read,write,execute permissions for world.
 Changing groupname of /u01/app/oraInventory to oracle.
 The execution of the script is complete.
 [root@dg9 ~]# /u01/app/oracle/product/
 Running Oracle 11g script…
 The following environment variables are set as:
     ORACLE_OWNER= oracle
     ORACLE_HOME=  /u01/app/oracle/product/
 Enter the full pathname of the local bin directory: [/usr/local/bin]:
    Copying dbhome to /usr/local/bin …
    Copying oraenv to /usr/local/bin …
    Copying coraenv to /usr/local/bin …
 Creating /etc/oratab file…
 Entries will be added to the /etc/oratab file as needed by
 Database Configuration Assistant when a database is created
 Finished running generic part of script.
 Now product-specific root actions will be performed.
 Finished product-specific root actions.

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

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

You may need to ignore SSL certificate error on your browser. EM will ask you for username/password to login the system. Enter your SYS/Password to login. You will have a webpage like this:

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: