Ivan Kartik - Oracle and Linux Blog

Installation of Oracle Database 12c Release 2 on Redhat 7, Oracle Linux 7

Here is short installation HOWTO for Oracle Database 12c Release 2 for Redhat 7, Oracle Linux 7 (and possibly CentOS 7 which is not officially certified and supported distribution). This post covers Oracle Database software installation (only). In case you want to use ASM or other Grid features and you don't have Grid Infrastructure 12c R2 installed refer to my previous post: http://ivan.kartik.sk/index.php?controller=post&action=view&id_post=76 If you don't need ASM or GI features you can continue with this part directly.
This post also contains some steps which were used during Oracle Grid Infrastructure 12c R2 installation, so you can skip those if you followed my GI installation HOWTO.

1. OS preparation

# - stands for "root" action
$ - stands for "oracle" (owner of Oracle software)

Note: You can skip this step if you have installed the Grid Infrastructure Software.

# groupadd dba
# groupadd oinstall
# useradd -g oinstall -G dba oracle

Create ORACLE_HOME directory. (Note: In my example I use /opt/oracle/12201 directory, change it to your preferred location):

# mkdir -p /opt/oracle/12201
# chown -R oracle:oinstall /opt/oracle

2. Install required packages

Note: You can skip this step completely once you have installed the Grid Infrastructure Software (as described in my previous post related to Grid Infrastructure installation).

First install required packages (use this command if your computer has access to Internet or you have registered and enabled your media as yum repository).

Add/set kernel parameters to/in /etc/sysctl.d/99-sysctl.conf file:

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Execute sysctl -p command to apply settings:

# sysctl -p

Add/set limits to/in /etc/security/limits.d/99-oracle-rdbms.conf file:

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

4. Software download and install

Download installation archive (linuxx64_12201_database.zip) from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html

Unpack the installation archive and start the installer:

$ unzip linuxx64_12201_database.zip
$ cd database
$ ./runInstaller

Next steps after installation

In case you want startup your Oracle Database(s) automatically and you don't have Oracle Grid Infrastructure installed, you can follow the steps described in the post Configuring automatic startup of Oracle Database under systemd on RHEL 7/OEL 7/CentOS 7 at http://ivan.kartik.sk/index.php?controller=post&action=view&id_post=65

 

 

 

Installation of Oracle Grid Infrastructure 12c Release 2 on Redhat Linux 7 and Oracle Linux 7

I prepared short installation HOWTO Oracle Grid Infrastructure 12c Release 2 for Redhat 7, Oracle Linux 7 (and Centos 7). Installation on first two (supported) Linux distros was almost fine, just some workaround were needed. But you can expect some problems on (unsupported) Centos distro where some workarounds were needed in order to have fully working product. These specific workarounds you can at the end of this post. This post also tries to answer some potential questions you may have.

Oracle 12cR2 brought interesting new feature called Oracle ASM Filter Driver (ASMFD) which is in fact replacement for ASMLIB. As official documentation states ASMFD simplifies configuration and management of disk devices for Oracle ASM (just like AMSLIB does) moreover ASMFD is using a "Filter Driver" that rejects any invalid I/O request in order to protect ASM disks by filtering out non-Oracle I/O operations which could cause accidental overwrites thus corruption. Note that ASMFD cannot be used simultaneously with ASMLIB.

So (logically) this article covers installation of Oracle GI 12.2.0.1 aka 12cR2 for x86-64 Linux using ASMFD feature. I've used "Minimal" version of Linux installation.

1. OS preparation

# - stands for "root" user action
$ - stands for "oracle" user (owner of Oracle software) action

# groupadd dba
# groupadd oinstall
# useradd -g oinstall -G dba oracle

Create $GI_HOME directory. (Note: In my example I use /opt/oraclecrs/12201 directory, change it to your preferred location):

# mkdir -p /opt/oraclecrs/12201
# chown -R oracle:oinstall /opt/oraclecrs

2. Install required packages

Install required packages (use this command if your computer has access to Internet or you have registered and enabled your media as yum repository). Note: Some packages are required by Database installation which I expect it will be the next step once Oracle GI has been installed. If you are using Oracle Linux or in case of Redhat if have configured OL public YUM repository then you can use "yum install oracle-database-server-12cR2-preinstall" and it will install all required packages and also perform Linux parameters configuration described in next step (So, you can skip this step and step#3 as well). Note, in case of Redhat this package will install also UEK kernel.

# yum install unzip xorg-x11-utils xorg-x11-apps xorg-x11-utils compat-libcap1 libstc++-devel \ 
gcc-c++ glibc-devel nfs-utils-1.2.3-15 ksh libaio-devel sysstat smartmontools

3. Set OS kernel parameters and user limits

Add/set kernel parameters to/in /etc/sysctl.d/99-sysctl.conf

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Execute sysctl -p command:

# sysctl -p

Add/set limits to/in /etc/security/limits.d/99-oracle-rdbms.conf:

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

4. Software download and deploy

Create install directory in /home/oracle for downloaded software:

$ mkdir /home/oracle/install

Download linuxx64_12201_grid_home.zip file from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html to the /home/oracle/install directory.

Deploy GRID software:

$ cd /opt/oraclecrs/12201
$ unzip -q /home/oracle/install/linuxx64_12201_grid_home.zip

Note: Since Oracle 12cR2 you can unzip archive within $GI_HOME.

5. Install package cvuqdisk RPM package

Install $GI_HOME/cv/rpm/cvuqdisk-1.0.10-1.rpm package from $GI_HOME. Note in case of Oracle Linux with internet connection or Redhat with configured OL public YUM repository you can use "yum install cvuqdisk" command.

# yum localinstall /opt/oraclecrs/12201/cv/rpm/cvuqdisk-1.0.10-1.rpm

6. ASM disk configuration (ASMFD)

Now we need to prepare (stamp) the disks that will be used for Oracle ASM. Note in my case /dev/sdb and /dev/sdc are dedicated for ASM.

# /opt/oraclecrs/12201/bin/asmcmd afd_label DATA_0000 /dev/sdb --init
# /opt/oraclecrs/12201/bin/asmcmd afd_label DATA_0001 /dev/sdc --init

Just simple check if disks are prepared:

# /opt/oraclecrs/12201/bin/asmcmd afd_lslbl /dev/sdb
--------------------------------------------------------------------------------
Label                     Duplicate  Path
================================================================================
DATA_0000                             /dev/sdb

# /opt/oraclecrs/12201/bin/asmcmd afd_lslbl /dev/sdc
--------------------------------------------------------------------------------
Label                     Duplicate  Path
================================================================================
DATA_0001                             /dev/sdc

Possible error:

# ./bin/asmcmd afd_label DATA_0000 /dev/sdb
/opt/oraclecrs/12201/bin/kfod: line 22: /scratch/app/user/product/12.2.0/grid/bin/kfod.bin: No such file or directory

Solution:

Modify $GI_HOME/bin/kfod (in my case /opt/oraclecrs/12201/bin/kfod ) and replace path in OHOME variable to correct one.
Change this entry: OHOME=/scratch/app/user/product/12.2.0/grid to this: OHOME=/opt/oraclecrs/12201

 

7. Run gridSetup in order to configure Grid infrastructure

$ cd /opt/oraclecrs/12201
$ ./gridSetup.sh

 8. Use "Configure Oracle ASM Filter Driver" option during ASM disk group creation

 undefined

When your installation was finished successfully you can log on to ASM instance in order to check v$asm_disk.

 

SQL> select path, name, library, header_status from v$asm_disk;

PATH            NAME            LIBRARY                                                          HEADER_STATU
--------------- --------------- ---------------------------------------------------------------- ------------
AFD:DATA_0000   DATA_0000       AFD Library - Generic , version 3 (KABI_V3)                      MEMBER
AFD:DATA_0001   DATA_0001       AFD Library - Generic , version 3 (KABI_V3)                      MEMBER

As you can see AFD Library (thus ASMFD) is being used. Output is very similar to output from ASM Library (ASMLIB).
Just for comparison there is output from ASMLIB configuration:

SQL> select path, name, library, header_status from v$asm_disk;

PATH            NAME            LIBRARY                                                          HEADER_STATU
--------------- --------------- ---------------------------------------------------------------- ------------
ORCL:DATA_0000  DATA_0000       ASM Library - Generic Linux, version 2.0.12 (KABI_V2)            MEMBER
ORCL:DATA_0001  DATA_0001       ASM Library - Generic Linux, version 2.0.12 (KABI_V2)            MEMBER

 

Possible Errors and Solutions:

Problem:
[INS-41223] ASM Filter Driver is not supported on this platform

AFD-620: AFD is not supported on this operating system version: ...
AFD-9201: Not Supported

Solution: Well, message is clear, you are using unsupported Linux distribution (e.g.: Centos). If you have a good reason to play with Centos see "Centos specific important steps" bellow, otherwise I would suggest to use certified Linux distribution (e.g.: Redhat Enteprise Linux, Oracle Linux).


Problem:
[INS-41223] ASM Filter Driver is not supported on this platform
Action - To proceed, do not specify or select the Oracle ASM Filter Driver option.
Additional Information:
AFD-9202: AFD can not be installed/loaded because ASMLib is installed.
AFD-9201: Not Supported

Solution: Again, message is very clear. You can not use ASMFD while ASMLIB is in use. So you have to choose one. If there is reason for using ASMLIB then don't check the "Configure Oracle ASM Filter Driver" option during ASM disk group creation.

Problem:
bin/kfod: line 22: /scratch/app/user/product/12.2.0/grid/bin/kfod.bin: No such file or directory

Solution:
Edit $GI_HOME/bin/kfod script and replace path in OHOME=/scratch/app/user/product/12.2.0/grid to correct one.

 

Centos specific important steps:

So you are stubborn, well then... :-) Couple of tweaks have to be perfomed prior "gridSetup" execution (before step #7).

1. Edit $GI_HOME/lib/osds_acfslib.pm file and add following line:

($release =~ /^centos-release/) ||    # Centos Linux

- after line 359 (as next line after "enterprise-release" condition)
- after line 911 (as next line "enterprise-release" condition, originally at 910 line)
- after line 1146 (as next line "enterprise-release" condition, originally at 1144 line)

2. Edit /etc/redhat-release file

# cp /etc/redhat-release /etc/redhat-release.old
# sed -e 's/Centos/Redhat/' /etc/redhat-release.old > /etc/redhat-release

 Now you can execute gridSetup.

 

Next step after installation:

Installation of Oracle Database 12c Release 2 Database Software - http://ivan.kartik.sk/index.php?controller=post&action=view&id_post=78

 

Home