RHEL6.6 install Oracle 11g RAC - based experimental environment for VMware

Experimental environment ready
virtual machine: VMware® Workstation 14 Pro
operating systems: Red Hat Enterprise Linux 6.6 x86_64
RHEL-Server-6.6-x86_64-DVD.iso
the Oracle software : the Oracle 11.2.0.4
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7 .zip
p13390677_112040_Linux-x86-64_3of7.zip

virtual server configuration
cpu: 1 core
memory: 2G
HDD: 30G
shared disk: 2G * 3 + 5G + 6G
card * 3

operating system installation
partition :( experimental environment to minimize principles for installation, the actual production environment requires proper planning based on demand)
/ the Boot 200M
swap 3200M
/ all of the remaining space
packages:
select Desktop
time zone:
select shanghai

 

Create a shared disk

vmware-vdiskmanager.exe -c -s 2g -a lsilogic -t 2 "D:\vmware\sharedisk\Shared_Virtual_Disk_OCR1.vmdk"
vmware-vdiskmanager.exe -c -s 2g -a lsilogic -t 2 "D:\vmware\sharedisk\Shared_Virtual_Disk_OCR2.vmdk"
vmware-vdiskmanager.exe -c -s 2g -a lsilogic -t 2 "D:\vmware\sharedisk\Shared_Virtual_Disk_OCR3.vmdk"
vmware-vdiskmanager.exe -c -s 5g -a lsilogic -t 2 "D:\vmware\sharedisk\Shared_Virtual_Disk_FRA.vmdk"
vmware-vdiskmanager.exe -c -s 6g -a lsilogic -t 2 "D:\vmware\sharedisk\Shared_Virtual_Disk_DATA.vmdk"

 After the virtual machine machine, in srac1.vmx / srac2.vmx last file append the following

#shared disks configure
disk.EnableUUID="TRUE"
disk.locking = "FALSE"
scsi1.shared = "TRUE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize= "4096"
diskLib.maxUnsyncedWrites = "0"

scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsil.sharedBus = "VIRTUAL"

scsi1:0.present = "TRUE"
scsi1:0.mode = "independent-persistent"
scsi1:0.fileName = "D:\vmware\sharedisk\Shared_Virtual_Disk_OCR1.vmdk"
scsi1:0.deviceType = "disk"
scsi1:0.redo = ""

scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.fileName = "D:\vmware\sharedisk\Shared_Virtual_Disk_OCR2.vmdk"
scsi1:1.deviceType = "disk"
scsi1:1.redo = ""

scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.fileName = "D:\vmware\sharedisk\Shared_Virtual_Disk_OCR3.vmdk"
scsi1:2.deviceType = "disk"
scsi1:2.redo = ""

scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.fileName = "D:\vmware\sharedisk\Shared_Virtual_Disk_FRA.vmdk"
scsi1:3.deviceType = "disk"
scsi1:3.redo = ""

scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.fileName = "D:\vmware\sharedisk\Shared_Virtual_Disk_DATA.vmdk"
scsi1:4.deviceType = "disk"
scsi1:4.redo = ""

 

 

IP planning

 

hostname

IP

Public Network

srac1

92.0.2.101

srac2

92.0.2.102

Virtual IP (VIP)

srac1

92.0.2.103

srac2

92.0.2.104

Private Interconnect

srac1

192.168.0.101

srac2

192.168.0.102

SCAN IP

srac1/srac2

92.0.2.105




hosts规划
##Public Network
92.0.2.101     srac1.example.com      srac1
92.0.2.102     srac2.example.com      srac2

##Public Virtual IP (VIP) addresses
92.0.2.103     srac1-vip.example.com  srac1-vip
92.0.2.104     srac2-vip.example.com  srac2-vip

##Private Interconnect
192.168.0.101   srac1-priv.example.com srac1-priv
192.168.0.102   srac2-priv.example.com srac2-priv

##SCAN IP
92.0.2.105    srac-scan.example.com    srac-scan

 

Installation
1. Turn off the firewall, SELinux

# chkconfig iptables off
# chkconfig ip6tables off
# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
重启后生效

 

 

2. Check modify the hostname

# Hostname (see hostname) 
# vi / etc / sysconfig / Network (if hostname inappropriate modify the file) 
is recommended to set the appropriate host name when installing the operating system

 

 

3. Modify the / etc / hosts

Vi # / etc / hosts to add the following
 ## Public Network 
 92.0.2.101 srac1.example.com srac1 
92.0.2.102 srac2.example.com srac2 

## Public Virtual IP (VIP) Addresses 
92.0.2.103 srac1-vip.example.com VIP-srac1 
92.0.2.104 srac2-vip.example.com srac2 VIP- 

## Private Interconnect 
192.168.0.101 srac1-priv.example.com srac1-PRIV 
192.168.0.102 srac2-priv.example.com srac2-PRIV 

## SCAN the IP 
92.0.2.105 srac-scan.example.com srac-scan

 

 

4. Create users and groups

# /usr/sbin/groupadd -g 501 oinstall
# /usr/sbin/groupadd -g 502 dba
# /usr/sbin/groupadd -g 503 oper
# /usr/sbin/groupadd -g 504 asmadmin
# /usr/sbin/groupadd -g 505 asmoper
# /usr/sbin/groupadd -g 506 asmdba

# /usr/sbin/useradd -u 501 -g oinstall -G dba,oper,asmdba,asmadmin,asmoper grid
# /usr/sbin/useradd -u 502 -g oinstall -G dba,oper,asmdba oracle
# passwd grid
# passwd oracle

# id grid
# id oracle

 

5. Set the kernel parameters

VI # / etc / the sysctl.conf
 fs.aio - max = NR-1048576 
fs.file-max = 6815744 
kernel.shmall = 4294967296 # kernel.shmmax / kernel.shmmni be large to small 
kernel.shmmax = 68719476736 # than memory_target, now configured to 64G 
kernel.shmmni = 4096 
kernel.sem =  250 100 128 # 32000 (the PROCESSES + 10 (the PROCESSES + 10) * 10 + 128 128 the PROCESSES ) 
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 = 1048576 
# / sbin / sysctl - P
 Note: kernel.shmall= Kernel.shmmax / kernel.shmmni is a theoretical value, typically larger set point in accordance kernel.shmmax / . 8 can be set
 
# VI /etc/security/limits.conf 
Grid the nproc Soft 2047 
Grid Hard the nproc 16384 
Grid 1024 is Soft nofile 
Hard nofile 65536 Grid 
the Oracle Soft nproc 2047 
the Oracle 16384 Hard nproc 
the Oracle Soft nofile 1024 
the Oracle Hard nofile 65536
 
# vi /etc/pam.d/ the Login
 the session required pam_limits.so
 
# vi / etc / Profile
 IF [the USER $ = "the Oracle"] || [$ the USER = "Grid"]; the then 
IF [$ the SHELL = "/ bin / ksh"]; the then 
the ulimit -p 16384 
the ulimit -n 65536  
the else
the ulimit -n -u 16384 65536 - 
fi the 
umask 022 - 
fi

 

 

6. Stop the NTP service

# / Sbin / Service ntpd STOP 
# ntpd Service Status 
# mv /etc/ntp.conf / etc / ntp.conf.bak 
after disabling NTP service is automatically enabled oracle comes with clock synchronization service grid components are installed.

 

 

7. Increase / dev / shm size

大小要超过memery_target
# mount -o remount,size=4G /dev/shm
# vi /etc/fstab
tmpfs    /dev/shm       tmpfs   defaults,size=4G        0 0

 

 

8. Create a directory and modify permissions

# mkdir -p /u01/app/oracle
# mkdir -p /u01/app/grid
# mkdir -p /u01/app/11.2.0/grid
# chown -R grid:oinstall /u01/app/grid
# chown -R grid:oinstall /u01/app/11.2.0
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01
# mkdir -p /u01/app/oraInventory
# chown -R grid:oinstall /u01/app/oraInventory
# chmod -R 775 /u01/app/oraInventory

 

 

9. modify environment variables

# su – grid
$ vi .bash_profile
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=American_america.ZHS16GBK
export PATH=$ORACLE_HOME/bin:$PATH
$ source .bash_profile

# su - oracle
$ vi .bash_profile
export ORACLE_SID=xdja1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
AMERICAN_AMERICA.ZHS16GBK the NLS_LANG = Export
Export the PATH the PATH = $: $ ORACLE_HOME / bin
$ Source .bash_profile

Note: A portion of the red respectively corresponding to the srac2 + ASM2 and xdja2 node;
Oracle user name according to Example ORACLE_SID corresponding planning setting, for example, for planning named xdja, ORACLE_SID herein are set to xdja1 / xdja2

 

 

10. Installation dependencies

First configure the local source yum, yum installs all the dependencies using the soft package 
# yum - Y the install \ 
binutils \ 
compat - libcap1 \ 
compat -libstdc ++ - 33 is \ 
elfutils -libelf- devel \ 
GCC \ 
GCC -C ++ \ 
the glibc \ 
the glibc - devel \ 
ksh \ 
libgcc \ 
libstdc ++ \ 
libstdc ++ - devel \ 
libaio \ 
libaio - devel \ 
the make \ 
sysstat \ 
unixODBC \ 
unixODBC - devel \ 
libXp \ 
parted \ 
vim \
xorg-x11-utils \
xorg-x11-xauth \
unzip

 

 

11. Configure shared storage

View is denied a previously configured shared disk 
# LL / dev / SD * 

identify each shared disk WWID 
# scsi_id --whitelisted --replace-whitespace --device = / dev / sdb
 36000c29cc2059bd2971fa2c85def1bb7 
# scsi_id --whitelisted - --device-whitespace = Replace / dev / SDC
 36000c29291defedaa634a5b6edcf005d 
# the scsi_id --whitelisted --replace-whitespace --device = / dev / SDD
 36000c29b22662652d2aed62610921779 
# the scsi_id --whitelisted --replace-whitespace --device = / dev / SDE
 36000c297efa48942f5c92f20c5301103 
the scsi_id # --whitelisted --replace-whitespace --device = / dev / SDF
 36000c295385cc5aec648a12c665d88e0

根据wwid对共享磁盘进行绑定
# vim /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29cc2059bd2971fa2c85def1bb7", NAME="asm-diskb", OWNER="grid",GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29291defedaa634a5b6edcf005d", NAME="asm-diskc", OWNER="grid",GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29b22662652d2aed62610921779", NAME="asm-diskd", OWNER="grid",GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c297efa48942f5c92f20c5301103", NAME="asm-diske", OWNER="grid",GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c295385cc5aec648a12c665d88e0", NAME="asm-diskf", OWNER="grid",GROUP="oinstall", MODE="0660"

重启udev,使配置生效
# start_udev

 

 

12. Install GI

Select the third item, skip update 


Select the first item, the cluster deployment

 

Choose the second, advanced installation

 

The default selection can

 

Cluster name their own definition, SCAN Name according to / etc / hosts in the set, the default port 1521 plan, check off the box Configure GNS


2 configuration of nodes increases, according to add / etc / hosts in planning 

Configuring SSH trust, enter the grid user's password, click on the Setup 

Select the type of card, public and private networks to make it clear 

Select the first item, ASM management 

Enter the name of the disk group OCR, level of redundancy select Normal, select the disk asm-diskb / asm-diskc / asm-diskd 

The second option, use the password, the password is defined according to the needs of their own 

Click Yes to force password 

Select the second item, do not use IPMI 

Check the user groups, the general default is right 

Check the Oracle Base and Software Location, and environment variables should be consistent, otherwise check the environment variables 

Keep the default 

2 Click Ignore error on the interface 

Click Install to install 

两个节点依次执行root脚本,一定要等第一个节点执行完成后,再在第二个节点上执行 

点击OK忽略报错 

点击Yes继续 

安装完成,点击Close关闭安装界面
 

 

13.    创建ASM磁盘

创建磁盘组DATA,选择asm-diskf,冗余级别选择External

创建磁盘组FRA,选择asm
-diske,冗余级别选择External
 

 

 

14.    安装database

勾选掉MOS的复选框
 
选择第三项,跳过升级

选择第二项,仅安装数据库软件
选择2个节点,输入oracle用户密码,点击Setup配置SSH互信 保持默认即可
现在第一项,企业版
检查Oracle Base和Software Location,应该与环境变量保持一致,否则检查环境变量
检查用户组设置,一般默认设置是对的
界面中的3个报错点击忽略即可
点击Yes继续
点击Install安装
依次在两节点执行root脚本
安装完成,点击Close关闭界面

 

 

15.    dbca建库

选择RAC数据库


选择创建数据库


选择一般用途


输入实例名,要跟环境变量保持一致


选择配置EM


设置密码


选择ASM


Database Area 选择 +DATA


设置ASMSNMP的密码


为闪回区选择 +FRA


不创建示例


内存根据实际情况进行分配


设置连接数


设置字符集,一定要设置正确,无法修改


可以修改一些控制文件信息和Redo大小数量等,实验环境直接下一步即可


点击Finish开始创建数据库

Guess you like

Origin www.cnblogs.com/rayso/p/12170675.html