Saturday, August 22, 2020

INSTALLATION OF ORACLE 12C ON UBUNTU 18

1.DOWNLOADING:

Download the Oracle 12c R2 Database for Linux:
The below Link Contains the List of Oracle 12c R2 Database Releases.

https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

Download  Linux x86-64 bit (or 32 bit based on the system)

 

2.MAKING GROUPS AND USERS :

So make the groups as :

sudo groupadd -g 502 oinstall

 

if got “user is not in Sudoers file” then see: how to enable sudo in the below link

https://tutorialforlinux.com/2012/03/05/linuxsudoerrorisnotinthesudoersfile/

sudo groupadd -g 503 dba

sudo groupadd -g 504 oper

sudo groupadd nobody

sudo groupadd -g 505 asmadmin

 

And Finally the User:

sudo useradd -u 502 -g oinstall -G dba,asmadmin,oper -s /bin/bash -m oracle

 

Set a password with

sudo passwd oracle

Take a note of the oracle User Pass.

[Eg: User : oracle

Password : Admin123]

 

 

 

once user and password updated suceesfully..

 

3.MAKING DIRECTORIES :

 

Next Make Taget Directories

So execute:

sudo mkdir -p /u01/app/oracle/product/12/dbhome_1

 

Again setup ownership:

sudo chown -R oracle:oinstall /u01

 

And Permissions over it:

sudo chmod -R 775 /u01

 

Finally set also the temporary DB ownership

sudo chown -R oracle:oinstall /tmp/database

 

for last directory(Finally set also the temporary DB ownership

) : provide your own directory after oinstall..

Eg: oinstall /home/sss/Downloads/linuxx64_12201_database

 

 

 

4.MAKING NETWORK CONFIGURATION:

First Get Hostname with

hostname

 

And to Get IP

/sbin/ifconfig

 

(Note:  you can get IP with command : IP ADDR SHOW : it will show the ip addres details like below)

 

Check if Host name is already into the enabled host file:

cat /etc/hosts

 

If its not present then insert it with

sudo nano /etc/hosts

 

(insert:[IP][HOSTNAME] as here below

(EG for a local set up: ‘127.0.0.1 localhost.localdomain’

Ctrl+Shift+c to copy from Shell/Terminal

Ctrl+Shift+v to paste content into nano

Finally Cntrl+X to save and exit from nano editor)

 

Again to grant connection to X server do:

sudo xhost +[myIP]

 

(Replace [myIP] with your actual one)

 

 

5.SETTING UP PARAMETERS : (kernel configuration)

First Edit/etc/sysctl.conf with

 

sudo nano /etc/sysctl.conf

 

Add or amend the following lines:

#### Oracle 12c R2 Kernel Parameters ####

fs.suid_dumpable = 1

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 818227

kernel.shmmax = 4189323264

kernel.shmmni = 4096

kernel.panic_on_oops = 1

# 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=1048576

 

(Note : once you added..press cntl X it will ask for saving ,,, give YES.------ it will be saved..

again recheck  in the  command : sudo nano /etc/sysctl.conf --- whether the files saved or not ..0

 

The Values of ‘shmall‘ and ‘shmmax‘ Need to be Customized following your System Memory Size.
Here above is a Valid Setup for a 8Gb RAM Size!
If you need to Change first Check your Phisical Memory Size with:

cat /proc/meminfo | grep MemTotal

Find in the Output the Current dimension.
Eg. for a 16Gb machine will be shown a:

MemTotal:       16364532 kB

Then ‘shmall‘ should be Set as:

[RamKb] / 10

And instead ‘shmmax‘ as:

[RamKb] * 1024 / 2

For further Instructions See: Oracle Documentation link

https://docs.oracle.com/database/121/LADBI/app_manual.htm#LADBI7865

Check If Exists these lines below that Gives an Error:

 

#net.bridge.bridge-nf-call-ip6tables = 0

#net.bridge.bridge-nf-call-iptables = 0

#net.bridge.bridge-nf-call-arptables = 0

Comment out as here Above! (For Commenting use #)

 

Again Edit /etc/security/limits.conf file:

sudo nano /etc/security/limits.conf

Add the following lines:

#### oracle User Settings 4 Oracle 12c R2 ####

oracle       soft  nproc  2047

oracle       hard  nproc  16384

oracle       soft  nofile 1024

oracle       hard  nofile 65536

oracle       soft  stack  10240

Finally, to Achieve this same Setup ReLoad the New Kernel Parameters:

sudo /sbin/sysctl -p

 

6.INSTALLING PACKAGES & SYMLINKING:

So Execute:

sudo apt update

Next Command :

apt install unixodbc unixodbc-dev unzip lsb-cxx pdksh sysstat gcc g++-multilib

  lib32ncurses5 lib32z1 ksh lesstif2 zlibc rpm libc6 libc6-dev libc6-dev-i386 libc6-i386

  gcc-multilib less lib32z1 libelf-dev binutils libodbcinstq4-1 libpth-dev zenity

  libpthread-stubs0 libstdc++5 autotools-dev bzip2 elfutils g++ rlwrap libltdl-dev

  libxm4:i386 libuil4:i386 libmrm4:i386 libxm4 libuil4 libmrm4 libmotif-common

  libpthread-stubs0-dev build-essential expat gawk alien autoconf automake

  lesstif2-dev --------à incase if it is not working out , check each command indivusally (check each Commands mentioned indivsaully below)

 

sudo apt install libc6-i386

sudo apt install gcc-multilib g++-multilib libc6-dev-i386 libstdc++6:i386

sudo apt install alien autoconf automake autotools-dev elfutils rpm rpm-common

sudo apt install build-essential debhelper expat gawk gsfonts-x11 html2text sysstat

sudo apt install unixodbc unixodbc-dev doxygen ksh openssh-server pax perl-doc rlwrap

sudo apt install lsb lsb-core zlibc

sudo apt install lib32z1-dev lib32ncurses5 libaio1 libaio-dev

sudo apt install libelf-dev libodbcinstq4-1 libpth-dev libpthread-stubs0-dev libpthread-workqueue0 libpthread-workqueue-dev

sudo apt-get install libtiff5-dev libzthread-dev libqt4-opengl:i386 libodbcinstq4-1:i386 libglu1-mesa:i386

sudo apt-get install -s cabextract

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt update

sudo apt install wimtools libwim-dev

 

once all commands worked successfully..

 

Again to Install Old Libraries.
First Enable Precise Repository with:

sudo su -c "echo 'deb [trusted=yes] http://cz.archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list.d/extra.list"

sudo apt update

And the Install the Remaining stuff:

sudo apt install lesstif2 lesstif2-dev pdksh libaio-dev libpthread-stubs0 lsb-cxx

After to Restore the Repositories:

sudo apt remove /etc/apt/sources.list.d/extra.list

sudo apt update

Set to Hold the Installed Libraries without Upgrading:

sudo apt-mark hold libaio-dev lesstif2 lesstif2-dev pdksh libpthread-stubs0 lsb-cxx

Finally, Make a needed Symlink:

sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/libgcc_s.so.1

Making Symlinks

Make Symlinks to Binaries and Libraries
Linking Binaries with:

sudo ln -s /usr/bin/awk /bin/awk

sudo ln -s /usr/bin/rpm /bin/rpm

sudo ln -s /usr/bin/basename /bin/basename

And Link Libraries as:

sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

sudo ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so

sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/libgcc_s.so.1

sudo ln -sf /bin/bash /bin/sh

if you are getting any errors .. check each command individually (Commands mentioned below)

sudo ln -s /usr/bin/basename /bin/basename

sudo ln -s bin/bash /usr/bin/bash

sudo ln -s /usr/bin/rpm /bin/rpm

sudo ln -s /usr/bin/awk /bin/awk

sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/libstdc++.so.6

sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/libgcc_s.so.1

sudo ln -s /usr/lib/i386-linux-gnu/libpthread_nonshared.a /usr/lib/libpthread_nonshared.a

sudo ln -s /lib/lsb/init-functions /etc/init.d/functions

sudo ln -sf /bin/bash /bin/sh

 

7.SETTING THE PATHS :

Follow as per link..

First, Login as the Oracle User with:

su oracle

Then Edit the .bashrc file:

nano ~/.bashrc

Append:

# Oracle Settings

export TMP=/tmp;

export TMPDIR=$TMP;

export ORACLE_HOSTNAME=[HOSTNAME];

export ORACLE_BASE=/u01/app/oracle;

export ORACLE_HOME=$ORACLE_BASE/product/12/dbhome_1;

export ORACLE_SID=[DBSID];

export ORACLE_UNQNAME=$ORACLE_SID;

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

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64;

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

 

Replace [HOSTNAME] with IP and [DBSID] with SID Name

For a Local Setup as here, Respectively:

  • HOSTNAME = 127.0.0.1
  • DBSID = SID

Finally, ReLoad the New .bashrc Settings simply as:

bash

 

 

8.INSTALL SOFTWARE:

We need to download files from Oracle.com website directly…

wget downloaded url path (oracle.com path)

unzip ... Folders name s

2 zip folders

 

 

 

>>> Make a directory ( where we need to download)  We need to download files directly from terminal (Command: WGET)

>>>  unzip it ( Command : UNZIP)

So now Run the Installation Script
First give Execution permissions:

chmod -R +x /tmp/database

And then to Launch the Wizard:

/tmp/database/runInstaller

Then Follow the Installation’s Wizard
Here is Shown in the GUI form.
Especially relevant: 
Confirm for Installation also on Warning about System does Not Meeting Minimum Requirements!

If you Do Not Dispose of a Subcription Uncheck Security Updates and leave Blank Support Password and Pursue!

 

 

Then Choose “Install Software Only”!

 

On “Installation Options” Choose if a “Single Instance” like here or instead a “Cluster”.

Then Choose the “Enterprise Edition”

 

Select the Installation Location.

 

Again for the OraInventory.


 

Next Confirm the Installation Groups.

Review the “Summary” and Eventually take a Copy.

 

 

Finally, Click on “Install” to Start Installation Process

Linux Oracle 12c R2 Database Installation Troubleshooting Errors

 

Finally, Run the Configuration Scripts
As shown on Display or Shell:

 

As in our Setup:

 

sudo /u01/app/oraInventory/orainstRoot.sh

sudo /u01/app/oracle/product/12/dbhome_1/root.sh

Oracle Database 12c R2 Installation for Ubuntu 18.04 Bionic Step 12 of 13

To enter into SQl plus …

 

To quit ::

To enter into SQL developer :

Installation of Oracle  12c Completed Successfull

2 comments:

  1. As a CSE student it was very very helpful for me. I am complete beginner with ubuntu. The guideline is perfect. Keep up the good work guys! I am following your blog from now on. Thanks from Guide for PC.

    ReplyDelete
  2. I am newbie on ubuntu. Have practiced oracle on windows. Thank you for your guidelines. I will definitely try it. Wish me luck :)

    ReplyDelete