oracle

centos7部署oracle 11g rac安装部署(一)

2020-04-10  本文已影响0人  若有所思11

一、安装前准备

1.Oracle RAC 节点内存规划

建议SGA+PGA占整个节点物理内存的65%,其中,SGA大小容量为PGA的3倍。

1.1实际配置内存容量大小为32*16 GB=512 GB,则建议规划的

SGA和PGA分别如下:
SGA大小:512 GB * 65% * 75% = 249.6 GB(向下十位取整为240GB);
PGA大小:512 GB * 65% * 25% = 83.2 GB(向下十位取整为80GB);

1.2实际配置内存容量大小为16*16 GB=256 GB,则建议规划的

SGA和PGA分别如下:
SGA大小:256 GB * 65% * 75% = 124.8 GB(向下十位取整为120GB);
PGA大小:256 GB * 65% * 25% = 41.6 GB(向下十位取整为40GB);

2.网络规划
Hostname short Hostname Type IP Address Interface
rac1 node1 Public IP 192.168.0.190 eth0
node1-vip node1-vip Virtual IP 192.168.0.191 eth0:1
node1-priv node1-priv Private IP 172.168.0.190 eth1
rac2 node2 Public IP 192.168.0.192 eth0
node2-vip node2-vip Virtual IP 192.168.0.193 eth0:1
node2-priv node2-priv Private IP 172.168.0.192 eth1
rac3 node3 Public IP 192.168.0.194 eth0
node3-vip node3-vip Virtual IP 192.168.0.195 eth0:1
node3-priv node3-priv Private IP 172.168.0.194 eth1
scan-cluster scan-cluster Scan IP 192.168.0.196 eth0
3.配置/etc/hosts
#node1
192.168.0.190 node1
192.168.0.191 node1-vip
172.168.0.190 node1-priv

#node2
192.168.0.192 node2
192.168.0.193 node2-vip
172.168.0.192 node2-priv

#node3
192.168.0.194 node3
192.168.0.195 node3-vip
172.168.0.194 node3-priv

#scan-ip
192.168.0.196 scan-cluster
4.关闭透明大页

以防止THP带来的性能问题,最终导致节点和实例意外被移出集群。

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

if test -f /sys/kernel/mm/transparent_hugepage/enabled;then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi

注意一定要执行chmod +x /etc/rc.d/rc.local

5.关闭 iptables
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl list-unit-files firewalld.service 
sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
6.配置ASM磁盘

Oracle Linux 5.

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_", NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

Or this in Oracle Linux 6.

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_", NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

Or this in Oracle Linux 7 and 8.

KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"

6和7有些区别,不然会报错
SYMLINK+=\"asm-disk$i\" centos7
NAME=\"asm-disk$i\" centos6

for i in b c d e f g;
do
echo "KERNEL==\"sd*\", SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT==\"`/usr/lib/udev/scsi_id -g -u -d /dev/sd$i`\", SYMLINK+=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done

配置文件生效

udevadm control --reload-rules
udevadm trigger --type=devices --action=change

7.配置ssh
su - oracle
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ssh node2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh node2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys

二、软件安装

所需软件如下,其中p18370031_112040_Linux-x86-64.zipp19404309_112040_Linux-x86-64.zip是Centos7安装必须要的,否则在执行root.sh脚本的时候会报错。

image.png

8. grid软件安装前预检查

su - grid
unzip p13390677_112040_Linux-x86-64_3of7.zip

./runcluvfy.sh stage -pre crsinst -n node1,node2,node3 -fixup -verbose >result.txt
cat result.txt |grep failed

8.1 软件安装之前,安装 p19404309_112040_Linux-x86-64.zip :
su - grid
unzip p19404309_112040_Linux-x86-64.zip 
cp b19404309/grid/cvu_prereq.xml /soft/grid/stage/cvu/(安装软件包位置)
8.2 安装grid软件
su - grid
sh runInstaller
1.png
2.png
3.png
4.png
5.png
6.png
7.png
8.png
9.png
10.png
11.png
12.png
13.png
14.png
15.png
16.png
17.png
8.3执行root.sh 之前,在所有节点安装p18370031_112040_Linux-x86-64.zip:

NOTE : Before running root.sh, you have to install patch 18370031. This patch is required, because in Linux 7 the init system was changed from ‘SysVinit’ to ‘systemd’. And the patch delivers the necessary changes so that the start procedure of the Grid Infrastructure, which was originally prepared for SysVinit, can be integrated in the new init system.

unzip p18370031_112040_Linux-x86-64.zip
cd 18370031/  
/u01/app/11.2.0/grid/OPatch/opatch apply
[root@node1 scripts]# sh /u01/app/11.2.0.4/grid/root.sh 
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0.4/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.


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.
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding Clusterware entries to oracle-ohasd.service
CRS-2672: Attempting to start 'ora.mdnsd' on 'node1'
CRS-2676: Start of 'ora.mdnsd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'node1'
CRS-2676: Start of 'ora.gpnpd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'node1'
CRS-2672: Attempting to start 'ora.gipcd' on 'node1'
CRS-2676: Start of 'ora.cssdmonitor' on 'node1' succeeded
CRS-2676: Start of 'ora.gipcd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'node1'
CRS-2672: Attempting to start 'ora.diskmon' on 'node1'
CRS-2676: Start of 'ora.diskmon' on 'node1' succeeded
CRS-2676: Start of 'ora.cssd' on 'node1' succeeded

ASM created and started successfully.

Disk Group GRIDDG created successfully.

clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4256: Updating the profile
Successful addition of voting disk 159624448ae44f06bfed3b2fb6adf60a.
Successfully replaced voting disk group with +GRIDDG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   159624448ae44f06bfed3b2fb6adf60a (/dev/asm-diskc) [GRIDDG]
Located 1 voting disk(s).

CRS-2672: Attempting to start 'ora.asm' on 'node1'
CRS-2676: Start of 'ora.asm' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.GRIDDG.dg' on 'node1'
CRS-2676: Start of 'ora.GRIDDG.dg' on 'node1' succeeded
[root@node1 scripts]# sh /u01/app/11.2.0.4/grid/root.sh 
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0.4/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.


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.
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TPConfigure Oracle Grid Infrastructure for a Cluster ... succeeded

依次在node2,node3节点执行root.sh脚本

18.png
19.png
8.4使用asmca命令创建DATA和FLASH磁盘组
20.png
21.png
22.png

9. 安装oracle软件并创建数据库

23.png
24.png
25.png
26.png
27.png
28.png
29.png
30.png
31.png
32.png
33.png
[oracle@node1 ~]$ cd $ORACLE_HOME/sysman/lib
[oracle@node1 lib]$ cp ins_emagent.mk ins_emagent.mk.bak
[oracle@node1 lib]$ vim ins_emagent.mk
SQL
#===========================
#  emdctl
#===========================
$(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL) -lnnz11   在此处修改添加
#===========================
#  nmocat
#===========================

在后面追加参数-lnnz11, 第一个是字母l,后面两个是数字1。

34.png
35.png
36.png
37.png
38.png
39.png
40.png
41.png
42.png
43.png

10.检查集群状态

44.png

11.打补丁

打最新补丁p31720783_112040_Linux-x86-64.zip

上一篇 下一篇

猜你喜欢

热点阅读