Oracle 12c RAC Installation

Install Database Software and Create Database

Run Installer

$ ./runInstaller &

 Oracle12cDB_step1

Oracle12cDB_step2

Oracle12cDB_step3

Oracle12cDB_step4

Oracle12cDB_step5

Oracle12cDB_step6

Oracle12cDB_step7

Oracle12cDB_step8

Oracle12cDB_step9

Oracle12cDB_step10

Oracle12cDB_step11

Oracle12cDB_step12

Oracle12cDB_step13

Oracle12cDB_step13b

Oracle12cDB_step14

Note: Possible Installation error: ‘INS-30502 No ASM disk group found’

Add group asmdba to user oracle on all RAC servers

# usermod -a -G asmdba oracle

Oracle12cDB_step15

Oracle12cDB_step16

Oracle12cDB_step17

Oracle12cDB_step18

Oracle12cDB_step19

Oracle12cDB_step20

Note: If some of the prerequisites fail, the Install can generate a fixup script.

Oracle12cDB_step20b

Oracle12cDB_step21

Oracle12cDB_step22

Oracle12cDB_step22b

Oracle12cDB_step22c

Oracle12cDB_step22d

Oracle12cDB_step23

Database Post-Installation Checks

 [oracle@linuxdba3 ~]$ srvctl status database -d db12rac

Instance DB12RAC11 is running on node linuxdba3
Instance DB12RAC12 is running on node linuxdba4

 

[oracle@linuxdba3 ~]$ srvctl config database -d db12rac

Database unique name: DB12RAC
Database name: DB12RAC
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +DATA/DB12RAC/PARAMETERFILE/spfile.291.942861569
Password file: +DATA/DB12RAC/PASSWORD/pwddb12rac.276.942861007
...
...
OSDBA group: dba
OSOPER group: oper
Database instances: DB12RAC11,DB12RAC12
Configured nodes: linuxdba3,linuxdba4
Database is administrator managed

[oracle@linuxdba3 ~]$ srvctl status nodeapps

VIP linuxdba3-rac1-vip is enabled
VIP linuxdba3-rac1-vip is running on node: linuxdba3
VIP linuxdba4-rac2-vip is enabled
VIP linuxdba4-rac2-vip is running on node: linuxdba4
Network is enabled
Network is running on node: linuxdba3
Network is running on node: linuxdba4
ONS is enabled
ONS daemon is running on node: linuxdba3
ONS daemon is running on node: linuxdba4

Oracle 12c RAC Installation

Prepare Servers for Grid and ASM Installation

 

Install Packages

Install the Oracle Linux packages needed by using the preinstallation RPM included with the Grid installation software : oracle-rdbms-server-12cR1-preinstall

# yum -y install oracle-rdbms-server-12cR1-preinstall -y

Loaded plugins: security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-14.el6 will be installed
--> Processing Dependency: xorg-x11-utils for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
--> Processing Dependency: xorg-x11-xauth for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-12cR1-preinstall-1.0-14.el6.x86_64
. . . . . .

Install and set NTP Clock synchronization

# yum install ntp -y

 # vi /etc/sysconfig/ntpd

. . .
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
SYNC_HWCLOCK=no
NTPDATE_OPTIONS=""

 Start or restart NTP service

# service ntpd start

Starting ntpd:

 # service ntpd restart

Shutting down ntpd:                                               [ OK ]
Starting ntpd:                                                    [ OK ]

Do a full update to be sure

# yum update -y

Network setup and configuration

Each node will have two network interfaces. One for the public IP address and another for the private IP address. This install will use a static IP address configuration. Oracle also provides Grid Naming Service for dynamic IP address assignment.

 Create the following:

              1. A public IP address for each node

              2. A private IP address on a separate subnet

              3. A virtual IP address for each node in the same subnet as the public IP addresses

              4. Three SCAN (single client access name) IP addresses in the public subnet

 Note: Oracle recommends the use of network interfaces of at least 1Gbe, with 10Gbe recommended. Infiniband is an alternative recommended network interface.

              If a NAS server, accessed by ethernet, is used, a third network interface for the NAS I/O is recommended.

 Update /etc/hosts file with node names and IP addresses

# vi /etc/hosts

 . . .
# Public IP addresses for the RAC nodes
192.168.2.147 linuxdba3.localdomain linuxdba3
192.168.2.145 linuxdba4.localdomain linuxdba4
# Private IP addresses for the RAC nodes
10.5.1.20 linuxdba3-rac1-priv.localdomain linuxdba3-rac1-priv
10.5.1.30 linuxdba4-rac2-priv.localdomain linuxdba4-rac2-priv
# Virtual IP addresses for the RAC nodes
192.168.2.125 linuxdba3-rac1-vip.localdomain linuxdba3-rac1-vip
192.168.2.126 linuxdba4-rac2-vip.localdomain linuxdba4-rac2-vip
# SCAN IP addresses for the RAC nodes
192.168.2.135 linuxdb-rac-scan.localdomain linuxdb-rac-scan
192.168.2.136 linuxdb-rac-scan.localdomain linuxdb-rac-scan
192.168.2.137 linuxdb-rac-scan.localdomain linuxdb-rac-scan

Create required users and groups

# groupadd oinstall

# groupadd asmadmin

# groupadd asmdba

# groupadd asmoper

# groupadd dba

# groupadd oper

# groupadd backupdba

# groupadd dgdba

# groupadd kmdba

# useradd grid -g oinstall -G asmadmin,asmdba,asmoper

# useradd oracle -g oinstall -G dba,oper,asmdba

# passwd grid

Changing password for user grid.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

 # passwd oracle

Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully

Create Grid and Database Home directories

# mkdir -p /u01/app/12.1.0/grid

# mkdir -p /u01/app/grid

# mkdir -p /u01/app/oracle

# chown -R grid:oinstall /u01

# chown oracle:oinstall /u01/app/oracle

# chmod -R 775 /u01/

 Install and configure ssh, scp

 1. Login as the oracle user

2. Create the directory .ssh

 $ mkdir ~/.ssh

$ chmod 755 ~/.ssh

 3. Generate an RSA key. At the prompts accept the default location and ignore password request

$ /usr/bin/ssh-keygen -t rsa

 A public key is written to ~/.ssh/id_rsa.pub and a private key is written to the file ~/.ssh/id_rsa.

 4. Generate a DSA key.

$ /usr/bin/ssh-keygen -t dsa

 A public key is written to ~/.ssh/id_dsa.pub and a private key is written to the file ~/.ssh/id_dsa.

 5. Copy the contents of the ~/.ssh/id_rsa.pub and ~/.ssh/id_dsa.pub files to the ~/.ssh/authorized_keys file on this node and to the same file on all other cluster nodes.

 Note: The ~/.ssh/authorized_keys file on every node must contain the contents from all of the ~/.ssh/id_rsa.pub and ~/.ssh/id_dsa.pub files that you generated on all cluster nodes.

 6. Change the permissions on the ~/.ssh/authorized_keys file on all cluster nodes:

$ chmod 644 ~/.ssh/authorized_keys

 7. If you have configured SSH correctly, you can now use the ssh or scp commands without being prompted for a password.

To test the SSH configuration, enter the following commands:

 $ ssh nodename1 uname -n

$ ssh nodename2 uname –n

$ scp test1 node2:test1

 You should see the name of the server displayed without a request for a password. If any node prompts for a password, verify that the ~/.ssh/authorized_keys file on that node contains the correct public keys.

 Note: The first time you use SSH to connect to a node from a particular system, you might see a message stating that the authenticity of the host could not be established. Enter yes at the prompt to continue. The node is now added to the ~/.ssh/authorized_hosts file. Connect to each node using the node names and IP addresses so that this prompt will not occur during installation.

 8. To ensure that X11 forwarding will not cause the installation to fail, create the ~oracle/.ssh/config file. Put the following text into the file:

Host * 
ForwardX11 no

Set resource usage settings for user grid and oracle

The resource usage should have been set by the oracle-rdbms-server-12cR1-preinstall

package but check the files and update them manually if necessary.

# vi /etc/security/limits.conf

...
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft stack 10240
grid hard stack 32768

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

 Verify that system kernel parameters are correctly set

# vi /etc/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

 If file is manually updated then run the following command to update the kernel parameters

# /sbin/sysctl -p

Disable the Firewall

# chkconfig iptables off

# service iptables stop

 Install ASMLib for managing ASM disks

 Using yum install kmod-oracleasm package

# yum -y install kmod-oracleasm

. . .
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kmod-oracleasm.x86_64 0:2.0.8-13.0.1.el6_8 will be installed
--> Processing Dependency: kernel(get_user_pages_fast) = 0xa2046a95 for package: kmod-oracleasm-2.0.8-13.0.1.el6_8.x86_64
--> Processing Dependency: kernel >= 2.6.32-642.el6 for package: kmod-oracleasm-2.0.8-13.0.1.el6_8.x86_64
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-642.15.1.el6 will be installed
--> Processing Dependency: dracut-kernel >= 004-408.el6 for package: kernel-2.6.32-642.15.1.el6.x86_64
--> Running transaction check
---> Package dracut-kernel.noarch 0:004-335.0.1.el6 will be updated
---> Package dracut-kernel.noarch 0:004-409.0.1.el6_8.2 will be an update
--> Processing Dependency: dracut = 004-409.0.1.el6_8.2 for package: dracut-kernel-004-409.0.1.el6_8.2.noarch
--> Running transaction check
---> Package dracut.noarch 0:004-335.0.1.el6 will be updated
---> Package dracut.noarch 0:004-409.0.1.el6_8.2 will be an update
--> Finished Dependency Resolution
...
...
Installed:
  kmod-oracleasm.x86_64 0:2.0.8-13.0.1.el6_8
Dependency Installed:
  kernel.x86_64 0:2.6.32-642.15.1.el6
Dependency Updated:
  dracut.noarch 0:004-409.0.1.el6_8.2 dracut-kernel.noarch 0:004-409.0.1.el6_8.2

Complete!

Install oracleasm-support package via yum.

# yum -y install oracleasm-support

Loaded plugins: refresh-packagekit, security
Repository google-chrome is listed more than once in the configuration
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracleasm-support.x86_64 0:2.1.8-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================
 Package Arch Version Repository Size
=================================================================================================================
Installing:
 oracleasm-support x86_64 2.1.8-1.el6 public_ol6_latest 73 k

Transaction Summary
=================================================================================================================
Install 1 Package(s)
Total download size: 73 k
Installed size: 216 k
Downloading Packages:
oracleasm-support-2.1.8-1.el6.x86_64.rpm | 73 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : oracleasm-support-2.1.8-1.el6.x86_64 1/1
  Verifying : oracleasm-support-2.1.8-1.el6.x86_64 1/1
 
Installed:
  oracleasm-support.x86_64 0:2.1.8-1.el6

Complete!

Install oracleasmlib rpm directly from oracle.com.

# rpm -Uvh http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm

Retrieving http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
   1:oracleasmlib ########################################### [100%]

On both nodes, configure ASMLib.

# oracleasm configure -i

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting  without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

# service oracleasm start

Initializing the Oracle ASMLib driver:                   [ OK ]
Scanning the system for Oracle ASMLib disks:             [ OK ]

Create ASM disks

On node 1 create the candidate disk for the ASMLib

# oracleasm createdisk asm01 /dev/disk/by-path/ip-10.5.1.106:3260-iscsi-iqn.2005-10.org.nas.ctl:linuxdbiscsi-lun-0-part1

Writing disk header: done
Instantiating disk: done

 # oracleasm listdisks

ASM01

 On the other nodes just scan for the disks and then list them

# oracleasm scandisks

Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ASM01"

 # oracleasm listdisks

ASM01

Next: Install Grid Software

Previous: Setup Storage using NAS and iSCSI

Oracle 12c RAC Installation

Install Grid Software

Setup Grid user profile

$ vi .bash_profile

...
umask 022

ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/12.1.0/grid
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_BASE/bin:$ORACLE_HOME/bin
export PATH ORACLE_SID ORACLE_BASE ORACLE_HOME

 Run Cluster verification shell script. Script will verify acceptable connectivity between the nodes

$ ./runcluvfy.sh stage -pre crsinst -fixup -n linuxdba3,linuxdba4 -verbose | tee ./cluster.log

Run Grid Installer

$ ./runInstaller &

Step 1: Choose Cluster type

Orace12cInstall-1

Step 2: Choose between a Standard cluster or a Flex cluster

Oracle12cInstall-2

Step 3: Choose Typical or Advanced installation

Oracle12cInstall-3

Step 4: Choose languages to support

Oracle12cInstall-4

Step 5: Enter the Cluster name, Scan name and Scan port. Choice to configure the Grid Naming Services (GNS) is given.

Oracle12cInstall-5

Step 6: Enter the Public and Virtual hostnames.

Oracle12cInstall-6

Step 7: Enter the network interface names, subnets and indicate whether the interface is public or private

Oracle12cInstall-7

Step 8: Choose the Storage type for the OCR and Voting files

Oracle12cInstall-8

Step 9: Enter the Disk group name and choose configuration parameters.

Oracle12cInstall-9

Enter the Disk Discovery Paths

Oracle12cInstall-9b

Add Disks by choosing from the disk paths listed

Oracle12cInstall-10

Step 10: Enter the account passwords for SYS and ASMSNMP

Oracle12cInstall-11

Step 11: Choose id you wish to use Intelligent Platform Management Interface (IPMI)

Oracle12cInstall-12

Step 12: Register the new service with Enterprise Manager Cloud Control

Oracle12cInstall-13

Step 13: Choose ASM groups to use for operating system authentication

Oracle12cInstall-14

Step 14: Enter the Oracle and Grid base paths

Oracle12cInstall-15

Step 15: Choose to run the root scripts automatically by providing root password.

Oracle12cInstall-16

Step 16:

Step 17: Last chance to make changes to configuration choices before installation

Oracle12cInstall-17

Step 18: Progress window on installation

Oracle12cInstall-18

Request to run the root.sh scripts as root.

Oracle12cInstall-18b

Step 19: Result page

Next: Install Database Software

Previous: Prepare Servers for Grid and ASM Installation

Oracle 12c RAC Installation

Introduction and Storage setup

Introduction:

This document is designed as a step by step explanation of the setup of an Oracle 12c RAC database on an Oracle Linux 6 system using an iSCSI interface to a NAS storage array.

Note:

This document should be used in conjunction with the following documents:

1. Oracle Real Application Clusters Installation Guide, 12c Release 1 (12.1) for Linux and UNIX. (November 2016. part no. E48917-12)

2. Oracle Database Installation Guide for 12c Release 1 (12.1) for Linux  ( August 2016 part no. E41491-16)

Software used:

1. Oracle 12c (12.1.0.2)

2. Oracle Linux 6

Chapters

1. Setup Storage using NAS and iSCSI
2. Prepare Servers for Grid and ASM Installation
3. Install Grid Software
4. Install Database software

Setup Storage using NAS and iSCSI

Step 1: Verify that the iSCSI packages are installed

 # pkginfo SUNWiscsiu SUNWiscsir

 Step 2: Install the iSCSI software

  # yum install iscsi-initiator-utils

Loaded plugins: security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package iscsi-initiator-utils.x86_64 0:6.2.0.873-14.0.1.el6 will be installed
---> Package lsscsi.x86_64 0:0.23-3.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
 Package Arch Version Repository Size
================================================================================
Installing:
 iscsi-initiator-utils x86_64 6.2.0.873-14.0.1.el6 public_ol6_latest 724 k
 lsscsi x86_64 0.23-3.el6 public_ol6_latest 38 k
Transaction Summary
================================================================================
Install 2 Package(s)
. . .

Step 3: Start iSCSI services

# chkconfig iscsi on

# chkconfig iscsid on

# service iscsi start

# service iscsid start

# shutdown -r now

 Step 4: Connect to the NAS via iSCSI

Discover iSCSI targets

# iscsiadm -m discovery -t sendtargets -p nas1

10.5.1.106:3260,257 iqn.2005-10.org.nas.ctl:linuxdbisci

On node startup connect automatically to all iSCSI disks

# iscsiadm -m node –op update -n node.startup -v automatic

 Login to NAS and map iSCSI disks

# iscsiadm -m node -p primary-nas –login

 View the target disks

# ls -l /dev/disk/by-path/

total 0

lrwxrwxrwx. 1 root root 9 Mar 10 11:10 ip-10.5.1.106:3260-iscsi-iqn.2005-10.org.nas.ctl:linuxdbisci-lun-0 -> ../../sdb

lrwxrwxrwx. 1 root root 9 Mar 10 11:10 pci-0000:00:1f.1-scsi-0:0:0:0 -> ../../sr0

lrwxrwxrwx. 1 root root 9 Mar 10 11:10 pci-0000:01:00.0-scsi-0:1:0:0 -> ../../sda

lrwxrwxrwx. 1 root root 10 Mar 10 11:10 pci-0000:01:00.0-scsi-0:1:0:0-part1 -> ../../sda1

lrwxrwxrwx. 1 root root 10 Mar 10 11:10 pci-0000:01:00.0-scsi-0:1:0:0-part2 -> ../../sda2

 # lsscsi

. . .

[2:1:0:0]              disk                  Dell             VIRTUAL DISK           1028            /dev/sda

[3:0:0:0]             disk                   NAS             iSCSI Disk                    0123          /dev/sdb

Step 5: Format iSCSI disks

# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x405ec941.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
 switch off the mode (command 'c') and change display units to
  sectors (command 'u').

Command (m for help): n
Command action
  e extended
  p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-28980, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-28980, default 28980):
Using default value 28980

Command (m for help): p

Disk /dev/sdb: 238.4 GB, 238370684928 bytes
255 heads, 63 sectors/track, 28980 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 8192 bytes
I/O size (minimum/optimal): 8192 bytes / 1048576 bytes
Disk identifier: 0x405ec941
  Device Boot      Start      End      Blocks      Id      System
/dev/sdb1              1      28980    232781818+  83      Linux
Partition 1 does not start on physical sector boundary.

Command (m for help): w

The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Check result of disk format

# ls -l /dev/disk/by-path/

total 0

lrwxrwxrwx. 1 root root 9 Mar 10 11:51 ip-10.5.1.106:3260-iscsi-iqn.2005-10.org.nas.ctl:linuxdbisci-lun-0 -> ../../sdb

lrwxrwxrwx. 1 root root 10 Mar 10 11:51 ip-10.5.1.106:3260-iscsi-iqn.2005-10.org.nas.ctl:linuxdbisci-lun-0-part1 -> ../../sdb1

lrwxrwxrwx. 1 root root 9 Mar 10 11:10 pci-0000:00:1f.1-scsi-0:0:0:0 -> ../../sr0

lrwxrwxrwx. 1 root root 9 Mar 10 11:10 pci-0000:01:00.0-scsi-0:1:0:0 -> ../../sda

lrwxrwxrwx. 1 root root 10 Mar 10 11:10 pci-0000:01:00.0-scsi-0:1:0:0-part1 -> ../../sda1

lrwxrwxrwx. 1 root root 10 Mar 10 11:10 pci-0000:01:00.0-scsi-0:1:0:0-part2 -> ../../sda2

Update the other nodes. On the other servers use the partprobe command.

# partprobe

Clean the headers of the block devices if they already existed before the install

# dd if=/dev/zero of=/dev/sdb1 bs=1024 count=500

500+0 records in

500+0 records out

512000 bytes   (512 kB)   copied,   0.00741156 s,   69.1 MB/s

Next: Prepare Servers for Grid and ASM Installation