Friday, October 31, 2014

How To Install Oracle Database 12c On CentOS 7

How To Install Oracle Database 12c On CentOS 7

In this tutorial, we will show you how to install Oracle database 12c on RHEL7 Based linux distros.
OS information:
[root@ora-c7 ~]# cat   /etc/centos-release
CentOS Linux release 7.0.1406 (Core)

Network:
[root@ora-c7 ~]# ip a   | grep inet
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
    inet 192.168.119.139/24 brd 192.168.119.255 scope global dynamic eno16777736
    inet6 fe80::20c:29ff:fe41:1494/64 scope link

Login as root and add required groups:
 /usr/sbin/groupadd -g 501 oinstall
 /usr/sbin/groupadd -g 502 dba
 /usr/sbin/groupadd -g 503 oper
Add user Oracle:
/usr/sbin/useradd -u 502 -g oinstall -G dba,oper oracle
Change password for user:
passwd oracle
Add kernel parameters to /etc/sysctl.conf.
 kernel.shmmni = 4096
 kernel.shmmax = 4398046511104
 kernel.shmall = 1073741824
 kernel.sem = 250 32000 100 128
 fs.aio-max-nr = 1048576
 fs.file-max = 6815744
 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
Apply kernel parameters:
/sbin/sysctl -p
Add following lines to set shell limits for user oracle in file /etc/security/limits.conf
 oracle   soft   nproc    131072
 oracle   hard   nproc    131072
 oracle   soft   nofile   131072
 oracle   hard   nofile   131072
 oracle   soft   core     unlimited
 oracle   hard   core     unlimited
 oracle   soft   memlock  50000000
 oracle   hard   memlock  50000000
Edit /etc/hosts file:
[root@ora-c7 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.119.139 ora-c7.unixmen.local
Verify your network settings:
 [root@ora-c7 ~]# ping -c 1 O7-unixmen
 PING ora-c7.unixmen.local (192.168.119.139) 56(84) bytes of data.
 64 bytes from ora-c7.unixmen.local (192.168.119.139): icmp_seq=1 ttl=64 time=0.017 ms
--- ora-c7.unixmen.local ping statistics ---
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 rtt min/avg/max/mdev = 0.017/0.017/0.017/0.000 ms
 [root@ora-c7 ~]#
Modify .bash_profile for user oracle in his home directory add at the end file /home/oralce/.bash_profile.
# Oracle Settings
 #Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=O7-unixmen
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=orcl

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

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Check which packages are installed and which are missing.
as root copy this and  execute this:
yum groupinstall "GNOME Desktop" -y
yum groupinstall "Development Tools" -y
yum install binutils -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
Create directory structure:
 mkdir -p   /u01/app/oracle/product/12.1.0
 chown  -R oracle:oinstall /u01/
 chmod  775 /u01/app
Disable selinux  by editing the “/etc/selinux/config” file,
SELINUX=permissive
Install database software
Let’s start with database software installation as oracle user.
su - oracle
Unzip the  database  install files:
unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip 
[oracle@ora-c7 ~]$ cd  database/
[oracle@ora-c7 database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 21246 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2447 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-10-29_05-53-46AM. Please wait ..

Oracle1 Oracle2 Oracle3 Oracle4 Oracle5 Oracle6 Oracle7 Oracle8 Oracle9 Oracle10
During the linking phase, you will see the following error.
    Error in invoking target 'links proc gen_pcscfg procob' of makefile
    '/u01/app/oracle/product/12.1.0.2/db_1/precomp/lib/ins_precomp.mk'.
    See
    '/u01/app/oraInventory/logs/installActions2014-10-29_09-07-03PM.log'
    for details.
To fix it, do the following:
    rm -rf $ORACLE_HOME/lib/stubs/*
    cp $ORACLE_HOME/rdbms/lib/env_rdbms.mk $ORACLE_HOME/rdbms/lib/env_rdbms.mk.orig
Perform the following modifications:
vi $ORACLE_HOME/rdbms/lib/env_rdbms.mk
    # Line 176
    # FROM:
    LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS)
    # TO  :
    LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS) -lons

    # Line 279-280
    # FROM:
    LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS)
    LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS)
    # TO  :
    LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS) -Wl,--no-as-needed
    LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS) -Wl,--no-as-needed

    # Line 3041-3042
    # FROM:
    TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
            $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS)
    # TO  :
    TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
            $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS) -lnnz12
Click the “Retry” button.
Now, the installation should continue.
[root@O7-unixmen ~]#  /u01/app/oraInventory/orainstRoot.sh
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 oinstall.
The execution of the script is complete.
[root@O7-unixmen ~]#  /u01/app/oracle/product/12.1.0/db_1/root.sh
Performing root user operation for Oracle 12c

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/db_1

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 root script.
Now product-specific root actions will be performed.
[root@O7-unixmen ~]#

Oracle11
Oracle12 Oracle13 Oracle14

Post installation steps
Edit the “/etc/oratab”,
orcl:/u01/app/oracle/product/12.1.0/db_1:Y

Useful commands
[oracle@O7-unixmen database]$ lsnrctl

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-OCT-2014 14:27:04

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                29-OCT-2014 14:00:03
Uptime                    0 days 0 hr. 27 min. 4 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/O7-unixmen/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=O7-unixmen)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=O7-unixmen)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "pdborcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>

Have a fun :)
if you still have issues with install this database on CentOS 7, please back to install this on cenots6 in the bellow link:
http://www.unixmen.com/install-oracle-database-12-oracle-linux-6-5/

 

No comments: