Skip to main content

Oracle Database 12c installation on Ubuntu 16.04

This article describes how to install Oracle 12c 64bit database on Ubuntu 16.04 64bit.

Download software 


Download the Oracle software from OTN or MOS or get a downloaded zip file.

Unpacking 


You should have following two files downloaded now.

linuxamd64_12102_database_1of2.zip
linuxamd64_12102_database_2of2.zip

Unzip and copy them to

\tmp\databases

NOTE: you might have to merge two unzipped folders to create a single folder.


Create new groups and users

Open a terminal and execute following commands. you might need root permission.

groupadd -g 502 oinstall
groupadd -g 503 dba
groupadd -g 504 oper
groupadd -g 505 asmadmin

Now create the oracle user

useradd -u 502 -g oinstall -G dba,asmadmin,oper -s /bin/bash -m oracle
You will prompt to set to password. set a momorable password and write it down.
(mine is oracle)

 

Install required packages

Lets set Ubuntu Extra Packages Repo for
  • libpthread-stubs0
  • libmotif4
  • libtiffxx5

echo 'deb http://cz.archive.ubuntu.com/ubuntu precise main universe' >> /etc/apt/sources.list.d/extra.list

apt-get update

Now execute this script to install all required packages.

apt-get install alien autoconf automake autotools-dev binutils doxygen \
elfutils expat gawk gcc gcc-multilib g++-multilib libstdc++6:i386 ksh less libtiff5 \
libtiff5-dev lib32z1 libaio1 libaio-dev libc6-dev libc6-dev-i386 libc6-i386 \
libelf-dev libltdl-dev libmotif4 libodbcinstq4-1 libodbcinstq4-1:i386 \
libpthread-stubs0 libpth-dev libstdc++5 lsb-cxx make \
pdksh openssh-server rlwrap rpm sysstat unixodbc unixodbc-dev x11-utils \
zlibc libglapi-mesa:i386 libglu1-mesa:i386 libqt4-opengl:i386 \
libpthread-workqueue0 libpthread-workqueue-dev libzthread-2.3-2 libzthread-dev \
libpthread-stubs0-dev libaio-dev

 

DB Directory Permissions

Lets set oinstall group to access  oracle installation.

chown -R oracle:oinstall /tmp/database

 

Host file

Host file should contain the fully qualified name for the local server.

Open hosts file

cat /etc/hosts


It should have a record similar to following

127.0.0.1    localhost

 

Grant Connection to X Server

You need this step to load installation UI as oracle user

Test the x server

xclock

If you see a clock running you are good to go

Now run

xhost


Result should be

xhost SI:localuser:nuwan
(nuwan is my user name)

Now let oracle user to access xhost

xhost +SI:localuser:oracle

 

Symlinks to Binaries and Libraries


Linking Binaries
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename

Linking Libraries
ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
cd /lib64
ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 .

 

Make Target Directories

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



Setup configuration parameters


Add Oracle 12c Kernel Parameters 


Open
nano /etc/sysctl.conf


Add to the end of the file
#### Oracle 12c Kernel Parameters ####
fs.suid_dumpable = 1
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=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

Oracle User Settings 4 Oracle 12c

nano /etc/security/limits.conf

#Add the following lines
#### oracle User Settings 4 Oracle 12c ####
oracle       soft  nproc  2047
oracle       hard  nproc  16384
oracle       soft  nofile 1024
oracle       hard  nofile 65536
oracle       soft  stack  10240


Add Paths to oracle’s .bashrc


Login as Oracle

su oracle

Edit .bashrc file
nano ~/.bashrc

Insert:


# Oracle Settings
TMP=/tmp;
export TMP TMPDIR=$TMP;
export TMPDIR ORACLE_HOSTNAME=127.0.0.1;
export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB12C;
export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle;
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12/dbhome_1;
export ORACLE_HOME
ORACLE_SID=SID;
export ORACLE_SID
PATH=/usr/sbin:$PATH;
export PATH
PATH=$ORACLE_HOME/bin:$PATH;
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH


Installation


Load the New Kernel Parameters.
/sbin/sysctl -p

Load New .bashrc Settings
source ~/.bashrc

Installation
chmod -R +x /tmp/database
/tmp/database/runInstaller

 

UI Steps

Configure Security Updates

    --next


As the Ubuntu isn't a OS supported by oracle this error occurs, click yes.





Installation options
    --create and configure db
    --next

system class
    --server class
    --next


Grid installation options
    --single instance
    --next


Install type
    --advance install
    --next



Product languages
    --engish
    --next

Database edition
    --standard edition one
    --next


Installation location
    --no change
        --ORACCLE_BASE /u01/app/oracle
        --software location /u01/app/oracle/product/12/dbhome_1
    --next



Create inventory
    --no change
        --inventry directory /u01/app/oraInventory
    --next


Configuration type
    --no change
        --general purpose
    --next


Database identifier
    --note
        --global database name - orcl
        --oracle system identifier SID - SID
    --unchecked Create as Container database option
    --next



Configuration options
    --note
        -- Enable Automatic Memory Management: TRUE
        --defoult charset
    --next



Database storage
    --note
        --database file location - /u01/app/oracle/oradata


Management options
    --next


Recovery options
    --next

Specify schema passwords
    --select : Use the same password for all accounts
        --SYS,SYSTEM,DBSNMP
    --PWD: nuwan
    --next



Privileged operating groups
    --next

Summary
    -- save response file
    --install


Installation Begins



Once you clicked on install button real installation begins. After this point you expect a lot of errors can't ignore. When you see a error message don't abort or skip, just refer the troubleshooting section.



NOTE: make sure you do all these changes in a new terminal.

 

Troubleshooting

Issue: links proc gen_pcscfg procob issue

#in a new terminal
su oracle
rm -rf $ORACLE_HOME/lib/stubs/
nano $ORACLE_HOME/rdbms/lib/env_rdbms.mk

#rename
    LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS)
    LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS)
    LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS)
    TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
       $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS)
    RMAN_LINKLINE=$(LINK) $(OPT) $(S0MAIN) $(SSKRMED) $(SKRMPT) \
        $(LLIBDBTOOLS) $(LLIBCLIENT) $(LLIBSQL) $(LLIBPLSQL) \
        $(LLIBSNLSRTL) $(LLIBUNLSRTL) $(LLIBNLSRTL) \
        $(LLIBSLAX) $(LLIBPLSQL) $(LIBPLCN) $(LINKTTLIBS)
#to
    LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS) -lons
    LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS) -Wl,--no-as-needed
    LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS) -Wl,--no-as-needed
    TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
       $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS) -lnnz12
    RMAN_LINKLINE=$(LINK) $(OPT) $(S0MAIN) $(SSKRMED) $(SKRMPT) \
        $(LLIBDBTOOLS) $(LLIBCLIENT) $(LLIBSQL) $(LLIBPLSQL) \
        $(LLIBSNLSRTL) $(LLIBUNLSRTL) $(LLIBNLSRTL) \
        $(LLIBSLAX) $(LLIBPLSQL) $(LIBPLCN) $(LINKTTLIBS) -lons



Issue: ins_net_server.mk

nano /u01/app/oracle/product/12/dbhome_1/network/lib/ins_net_server.mk

# change
    tnslsnr: $(S0NSGL) $(SNSGLP) $(NSGLPNP)
    $(SILENT)$(ECHO) " - Linking $(TNSLSNR)"
    $(RMF) $@
    $(TNSLSNR_LINKLINE)
# to
    tnslsnr: $(S0NSGL) $(SNSGLP) $(NSGLPNP)
    $(SILENT)$(ECHO) " - Linking $(TNSLSNR)"
    $(RMF) $@
    $(TNSLSNR_LINKLINE) -lnnz12 -lons


nano /u01/app/oracle/product/12/dbhome_1/rdbms/lib/ins_rdbms.mk
# change
    $(ORAPWD_LINKLINE)
# to
    $(ORAPWD_LINKLINE) -lnnz12

nano /u01/app/oracle/product/12/dbhome_1/rdbms/lib/env_rdbms.mk
# change
    ORACLE_LINKLINE=$(ORACLE_LINKER) $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
    $(ORACLE_KERNEL_LIBS) $(LINKLDLIBS)
# to
    ORACLE_LINKLINE=$(ORACLE_LINKER) -Wl,--no-as-needed $(PL_FLAGS) $(ORAMAI) $(SSORED) $(TTCSOI) \
    $(ORACLE_KERNEL_LIBS) $(LINKLDLIBS)


Issue:  Error in invoking target 'install' of makefile '/u01/app/oracle/product/12/dbhome_1/network/lib/ins_net_server.mk'.

nano /u01/app/oracle/product/12/dbhome_1/network/lib/ins_net_server.mk

$(TNSLSNR_LINKLINE)
to
$(TNSLSNR_LINKLINE)  -lnnz12 -lons


Installation Ends


Finally we have finished all the linking errors.



Now as per the instructions run the following commands with root / root equivalent user:
    --/u01/app/oraInventory/orainstRoot.sh
    --/u01/app/oracle/product/12/dbhome_1/root.sh
        --       Copying dbhome to /usr/local/bin ...
                   Copying oraenv to /usr/local/bin ...
                   Copying coraenv to /usr/local/bin ...
           --/etc/oratab file

Database Configuration
    --wait till end
    --EM Database Express URL - https://127.0.0.1:5500/em
    --server parameter file - spfileOraSID.ora
    --ok

Setting permission

On Database Configuration, there's a link to password management.


Set single password for all
sys system dbsnmp
(mine is nuwan)


Post Installation task


To start listener run following as oracle user
    $ORACLE_HOME/bin/lsnrctl start

To start database run following
    sqlplus /nolog
    connect sys as sysdba
    STARTUP;
    EXIT;



Done


Start em
    https://127.0.0.1:5500/em


Login to em
    I can log in as
       user sys
       pwd nuwan


If you can logged into the system successfully
Yes we have completed the installation successfully.


Comments

  1. it didnt prompt me to enter a password and now i need the password for Oracle user

    ReplyDelete
    Replies
    1. Bilal, a late reply. The same happened to me. You can change password for oracle user by using this command: sudo passwd oracle. It will prompt you to enter new password.

      Delete
  2. The most effective method to Solve Oracle Database 12c Installation Issue through DB Installation Support
    Confronting Oracle Database 12c Installation Issue? Not a major ordeal, Cognegic is the main organization that gives world-class answers for database establishment and database design. Our DB Installation and Configuration Support are in charge of execution and accessibility of our customer's most basic frameworks. Here clients will get DB Configuration Support and Database Management Services which is a well-disposed, accommodating and responsive administration.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete
  3. Fix your Oracle Database Installation Issue with Remote DBA Services
    Precisely when business development is principal and you require mission basic help, Oracle Advanced Customer Support Services passes on a gave empower gathering, proactive course, and affirmation associations. This mission basic help is gone on through the Oracle Solution Support Center, our most aggregate yearly help advantage offering over the whole Oracle IT stack - from applications, middleware, and database through servers, putting away, and structure gadgets.
    Gets our Online Oracle DB Support or Database Administration for Oracle to decide your issues as for Oracle
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete
  4. How would I troubleshoot my Installation Issue through Cognegic's DB Installation Support?

    At Cognegic we ensure the secured and productive foundation of your entire database. We are ace in the foundation of different kind of databases including MySQL Database, Oracle database, MongoDB, Cassandra database, MS SQL Server and whatnot. Pick our first class DB Configuration Support and Database Management Services to decide your worry. We have profoundly gifted and confirmed specialized specialists who offer help and help 24*7. Cognegic's primary aphorism is to comprehend your issue by giving development bolster and to that reason we accessible all the time in your administration.

    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete
  5. How does one install cloud control on ubuntu? I am trying to use oracle on ubuntu for self study. EM express does not have the admin features that DB control had. I believe cloud control does.

    ReplyDelete
  6. Hi Nuwan! You are phenomenal. Thank you very much for the installation tutorial. It works! It helped me to install Oracle Database 12.1.0.2 Enterprise Edition on Linux Mint 18.3 Cinnamon 64-bit (based on Ubuntu 16.04).

    ReplyDelete
  7. Such a nice blog, I really like what you write in this blog, I also have some relevant Information about Best HR Training In Hyderabad | Hr training institute in Hyderabad! if you want more information.
    Workday Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training
    Oracle Fusion Financials Online Training

    ReplyDelete
  8. I wish to show thanks to you just for bailing me out of this particular trouble. As a result of checking through the net and meeting techniques that were not productive, Same as your blog I found another one Oracle Fusion Product Hub.Actually I was looking for the same information on internet for Oracle PPM Cloud and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete

Post a Comment

Popular posts from this blog

DBCA : No Protocol specified

when trying to execute dbca from linux terminal got this error message. now execute the command xhost, you probably receiving No protocol specified xhost:  unable to open display ":0" issue is your user is not allowed to access the x server. You can use xhost to limit access for X server for security reasons. probably you are logged in as oracle user. switch back to default user and execute xhost again. you should see something like SI:localuser:nuwan solution is adding the oracle to access control list xhost +SI:localuser:oracle now go back to oracle user and try dbca it should be working

Java Head Dump Vs Thread Dump

JVM head dump is a snapshot of a JVM heap memory in a given time. So its simply a heap representation of JVM. That is the state of the objects. JVM thread dump is a snapshot of a JVM threads at a given time. So thats what were threads doing at any given time. This is the state of threads. This helps understanding such as locked threads, hanged threads and running threads. Head dump has more information of java class level information than a thread dump. For example Head dump is good to analyse JVM heap memory issues and OutOfMemoryError errors. JVM head dump is generated automatically when there is something like OutOfMemoryError has taken place.  Heap dump can be created manually by killing the process using kill -3 . Generating a heap dump is a intensive computing task, which will probably hang your jvm. so itsn't a methond to use offetenly. Heap can be analysed using tools such as eclipse memory analyser. Core dump is a os level memory usage of objects. It has more informaiton t