Installing enterprise Oracle databases requires two parts: Oracle RAC, Oracle database. Refer to this article for the Oracle RAC principle. This article is the original introduction of the RAC installation of the actual part, the installation of the database section please refer to this post.
Take Oracle 12C as an example.
Download the grid installation package on the Oracle official website:
Http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html
650) this.width=650; "title=" capture. PNG "alt=" wkiom1lkiccgefpkaae0igvtu1w280.png-wh_50 "src=" https://s3.51cto.com/wyfs02/M02/9B/82/ Wkiom1lkiccgefpkaae0igvtu1w280.png-wh_500x0-wm_3-wmp_4-s_3724340592.png "/>
Ready before installation.
Oracle RAC, as a cluster software, requires cluster configuration of each server to be installed before installation, and the following operations need to be done in turn on three servers:
1) IP Address Division
This time with three servers for the cluster node as an example, divide the IP address as follows (see here for an introduction to Oracle RAC IP address classification):
Public IP:
192.168.0.10
192.168.0.11
192.168.0.12
Private IP:
192.168.1.10
192.168.1.11
192.168.1.12
Virtual IP:
192.168.0.13
192.168.0.14
192.168.0.15
Scan IP:
192.168.0.16
So the configuration of the/etc/hosts above three servers (TEST-4,TEST-5,TEST-6) is as follows (after a server has been configured to directly copy to the other two machines):
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.10 test-4 Test-4.localdomain
192.168.0.13 TEST-4-VIP
192.168.0.11 test-5 Test-5.localdomain
192.168.0.14 TEST-5-VIP
192.168.0.12 test-6 Test-6.localdomain
192.168.0.15 TEST-6-VIP
192.168.0.16 Scan4 Scan4.localdomain
192.168.1.10 Test-4-priv
192.168.1.11 Test-5-priv
192.168.1.12 Test-6-priv
From this configuration, you can see the host corresponding to each IP. The public IP and private IP require ifconfig configuration to complete before installation, and virtual Ip,scan IP does not require ifconfig configuration.
2) Create new users (Grid,oracle) and groups (Oinstall,dba,asmadmin,asmdba,asmoper,oper), taking actions on one of the test-5 as an example:
[Email protected] ~]# GROUPADD-G 501 Oinstall
[[email protected] ~]# GROUPADD-G 502 DBA
[Email protected] ~]# Groupadd-g 504 Asmadmin
[Email protected] ~]# GROUPADD-G 506 ASMDBA
[Email protected] ~]# groupadd-g 507 Asmoper
[Email protected] ~]# useradd-u 5001-g oinstall-g dba,asmadmin,asmdba,asmoper-d/home/grid-s/bin/bash-c "Grid" GRI D
[Email protected] ~]# Su-grid
[[email protected] ~]$ ID grid
uid=5001 (GRID) gid=501 (Oinstall) groups=501 (Oinstall), 502 (DBA), 504 (asmadmin), 506 (ASMDBA), 507 (Asmoper)
[Email protected] ~]# GROUPADD-G 503 oper
[Email protected] ~]# useradd-u 5002-g oinstall-g dba,oper,asmdba-d/home/oracle-s/bin/bash-c "Oracle" Oracle
[Email protected] ~]# su-oracle
[[email protected] ~]$ ID Oracle
UID=5002 (Oracle) gid=501 (oinstall) groups=501 (Oinstall), 502 (DBA), 506 (ASMDBA), 503 (oper
3) Modify the system Linux limits file/etc/security/limits.conf:
Cp/etc/security/limits.conf/etc/security/limits.conf.bak
echo "Oracle soft Nproc 2047" >>/etc/security/limits.conf
echo "Oracle hard Nproc 16384" >>/etc/security/limits.conf
echo "Oracle Soft nofile 1024x768" >>/etc/security/limits.conf
echo "Oracle hard Nofile 65536" >>/etc/security/limits.conf
echo "Grid soft Nproc 2047" >>/etc/security/limits.conf
echo "Grid hard Nproc 16384" >>/etc/security/limits.conf
echo "Grid soft nofile 1024x768" >>/etc/security/limits.conf
echo "Grid hard Nofile 65536" >>/etc/security/limits.conf
4) Modify/etc/profile:
Cp/etc/profile/etc/profile.bak
Echo ' if [$USER = ' Oracle ']| | [$USER = "Grid"]; Then ' >>/etc/profile
Echo ' if [$SHELL = '/bin/ksh ']; Then ' >>/etc/profile
Echo ' ulimit-p 16384 ' >>/etc/profile
Echo ' ulimit-n 65536 ' >>/etc/profile
Echo ' Else ' >>/etc/profile
Echo ' ulimit-u 16384-n 65536 ' >>/etc/profile
Echo ' fi ' >>/etc/profile
Echo ' fi ' >>/etc/profile
5) Run the following command on three nodes, respectively:
Cp/etc/sysctl.conf/etc/sysctl.conf.bak
echo "FS.AIO-MAX-NR = 1048576" >>/etc/sysctl.conf
echo "Fs.file-max = 6815744" >>/etc/sysctl.conf
echo "Kernel.shmall = 2097152" >>/etc/sysctl.conf
echo "Kernel.shmmax = 1054472192" >>/etc/sysctl.conf
echo "Kernel.shmmni = 4096" >>/etc/sysctl.conf
echo "Kernel.sem = 32000" >>/etc/sysctl.conf
echo "Net.ipv4.ip_local_port_range = 9000 65500" >>/etc/sysctl.conf
echo "Net.core.rmem_default = 262144" >>/etc/sysctl.conf
echo "Net.core.rmem_max = 4194304" >>/etc/sysctl.conf
echo "Net.core.wmem_default = 262144" >>/etc/sysctl.conf
echo "Net.core.wmem_max = 1048586" >>/etc/sysctl.conf
echo "Net.ipv4.tcp_wmem = 262144 262144 262144" >>/etc/sysctl.conf
echo "Net.ipv4.tcp_rmem = 4194304 4194304 4194304" >>/etc/sysctl.conf
Sysctl-p
6). Bash_profile for grid users:
#. Bash_profile
# Get the aliases and functions
If [-f ~/.BASHRC]; Then
. ~/.bashrc
Fi
# User specific environment and startup programs
tmp=/tmp; Export TMP
Tmpdir= $TMP; Export TMPDIR
#node1: ORACLE_SID=+ASM1; Node2:oracle_sid=+asm2:node3:oracle_sid=+asm3
ORACLE_SID=+ASM1; Export Oracle_sid
Oracle_base=/u01/app/grid/; Export Oracle_base
Oracle_home=/u01/app/grid_home; Export Oracle_home
nls_date_format= "Yyyy-mm-dd HH24:MI:SS"; Export Nls_date_format
threads_flag=native; Export Threads_flag
Path= $ORACLE _home/bin: $PATH; Export PATH
threads_flag=native; Export Threads_flag
Path= $ORACLE _home/bin: $PATH; Export PATH
umask 022
7) Oracle User's. Bash_profile (Oracle SID changes according to the name of the database that you installed later, Sqlplus determines which db instance to connect based on this environment variable):
#. Bash_profile
# Get the aliases and functions
If [-f ~/.BASHRC]; Then
. ~/.bashrc
Fi
# User specific environment and startup programs
Path= $PATH: $HOME/bin
Export PATH
tmp=/tmp; Export TMP
Tmpdir= $TMP; Export TMPDIR
oracle_base=/u01/app/oracle/; Export Oracle_base
Oracle_home=/u01/app/oracle_home; Export Oracle_home
#node1: ORACLE_SID=RACDB1, NODE2:ORACLE_SID=RACDB2, NODE3:ORACLE_SID=RACDB3
ORACLE_SID=RACDB1; Export Oracle_sid
Oracle_term=xterm; Export Oracle_term
Path=/usr/sbin: $PATH; Export PATH
Path= $ORACLE _home/bin: $PATH; Export PATH
Ld_library_path= $ORACLE _home/lib:/lib:/usr/lib; Export Ld_library_path
Classpath= $ORACLE _home/jre: $ORACLE _home/jlib: $ORACLE _home/rdbms/jlib; Export CLASSPATH
nls_date_format= "Yyyy-mm-dd HH24:MI:SS"; Export Nls_date_format
Nls_lang=american_america. Zhs16gbk;export Nls_lang
java_home=/opt/jdk1.8.0_121; Export Java_home
Path= $JAVA _home/bin: $PATH; Export PATH
Umask 022
The configuration of the three hosts to complete the above 1)-7).
8) Configure no password login for grid users and Oracle users on three nodes, that is, three hosts using grid from any host or Oracle user can ssh directly to another machine to execute commands. Run the command below with Oracle and grid users, as an example of an Oracle user running on test-5:
Sed-i ' S/userknownhostsfile \/dev\/null//g '/etc/ssh/ssh_config
Sed-i ' s/stricthostkeychecking no/stricthostkeychecking ask/g '/etc/ssh/ssh_config
Ssh-keygen-n ""-F ~/.ssh/id_rsa
Ssh-keygen-n ""-y-f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
Cat ~/.ssh/id_rsa.pub
Put the last-step cat-obtained public key into the test-4,test-6 Oracle user ~/.ssh/authorized_keys. Run above the test-5:
SSH test-4 Date
SSH test-6 Date
To test. Perform the same steps on test-4 and test-6, placing the public key in the corresponding Authorized_keys of the other two hosts.
9)
Mkdir-p/u01/app/grid
Mkdir-p/u01/app/11.2.0/grid
Mkdir-p/u01/app/oracle
Chown-r oracle:oinstall/u01
Chown-r Grid:oinstall/u01/app/grid
Chown-r grid:oinstall/u01/app/11.2.0
Chmod-r 775/u01
10) Stop the NTP service
Service NTPD Stop
Chkconfig ntpd off
Rm-f/etc/ntp.conf
11)
Oracle RAC cluster installation