Oracle 12C 12.1.0.2 RAC部署
Oracle 12C 12.1.0.2 RAC部署一、环境配置二、集群规划三、主机网络规划四、操作系统配置部分五、Grid集群软件安装部分六、Oracle DataBase软件安装七、dbca创建数据库(非容器数据库)八、dbca创建数据库(多租户数据库)九、安装过程中报错处理十、卸载Grid Cluster集群环境十一、集群日志查看十二、客户端配置一、环境配置操作环境:RHEL 7.4 + ..
Oracle 12C 12.1.0.2 RAC部署
一、环境配置
操作环境:RHEL 7.4 + Oracle 12.1.0.2 + UDEV
内存:2G
二、集群规划
ASM磁盘组 | 用途 | 大小 |
---|---|---|
asm-crs | ocr文件,voting disk | 10g |
asm-data | 数据文件 | 20g |
asm-arch | 归档文件 | 2g |
在12C,CRS至少需要5,528 MB
三、主机网络规划
网络配置 | 节点1 | 节点2 |
---|---|---|
主机名称 | rac1 | rac2 |
public ip | 172.16.4.11 | 172.16.4.12 |
private ip | 10.10.10.11 | 10.10.10.12 |
vip | 172.16.4.13 | 172.16.4.14 |
scan ip | 172.16.4.15 | 172.16.4.15 |
四、操作系统配置部分
两个节点主机名设置
hostnamectl set-hostname racnnode1
1、关闭防火墙
在两个节点关闭防火墙
[root@rac1 ~]# systemctl stop firewalld
[root@rac1 ~]# systemctl disabled firewalld
2、关闭selinux
在两个节点关闭selinux
[root@rac1 ~]# vi /etc/selinux/config
SELINUX=disabled
[root@rac1 ~]#setenforce 0
3、hosts文件配置
在两个节点修改hosts文件
[root@rac1 ~]# vi /etc/hosts
#public ip ent0
172.16.4.11 rac1
172.16.4.12 rac2
#priv ip ent1
10.10.10.11 rac1-prv
10.10.10.12 rac2-prv
#vip ip
172.16.4.13 rac1-vip
172.16.4.14 rac2-vip
#scan ip
172.16.4.15 rac-scan
4、依赖包配置
在两个节点安装rac需要的依赖包
[root@rac1 ~]#
yum install -y binutils
yum install -y compat-libcap1
yum install -y compat-libstdc++-33
yum install -y compat-libstdc++-33.i686
yum install -y gcc
yum install -y gcc-c++
yum install -y glibc
yum install -y glibc.i686
yum install -y glibc-devel
yum install -y glibc-devel.i686
yum install -y ksh
yum install -y libgcc
yum install -y libgcc.i686
yum install -y libstdc++
yum install -y libstdc++.i686
yum install -y libstdc++-devel
yum install -y libstdc++-devel.i686
yum install -y libaio
yum install -y libaio.i686
yum install -y libaio-devel
yum install -y libaio-devel.i686
yum install -y libXext
yum install -y libXext.i686
yum install -y libXtst
yum install -y libXtst.i686
yum install -y libX11
yum install -y libX11.i686
yum install -y libXau
yum install -y libXau.i686
yum install -y libxcb
yum install -y libxcb.i686
yum install -y libXi
yum install -y libXi.i686
yum install -y make
yum install -y sysstat
yum install -y unixODBC
yum install -y unixODBC-devel
yum install -y readline
yum install -y libtermcap-devel
yum install -y pdksh
centos7还需单独安装一个独立包rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
5、关闭时间同步ntpd服务
检查两节点时间,时区是否相同,并禁止ntp
[root@rac1 ~]#systemctl disable ntpd.service
[root@rac1 ~]#systemctl stop ntpd.service
[root@rac1 ~]#mv /etc/ntp.conf /etc/ntp.conf.orig
[root@rac1 ~]#systemctl status ntpd
时区设置
# timedatectl list-timezones |grep Shanghai #查找中国时区的完整名称
Asia/Shanghai
# timedatectl set-timezone Asia/Shanghai
6、创建用户及用户组
在两个节点创建oracle,grid用户、组
[root@rac1 ~]
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -g oinstall -G dba,asmdba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
设置grid、oracle密码
[root@rac1 ~]
passwd grid
passwd oracle
7、创建文件目录
在两个节点创建grid、oracle文件目录
[root@rac1 ~]
mkdir -p /u01/app/grid
mkdir -p /u01/app/12.1.0/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
8、修改20-nproc.conf
在两个节点修改/etc/security/limits.d/20-nproc.conf
[root@rac1 ~]vi /etc/security/limits.d/20-nproc.conf
# Change this
#注释这行* soft nproc 1024
# To this增加下面一行
* - nproc 16384
9、修改limits.conf
在两个节点修改/etc/security/limits.conf
[root@rac1 ~]vi /etc/security/limits.conf
#ORACLE SETTING
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
10、修改login
在两个节点修改/etc/pam.d/login文件
[root@rac1 ~]vi /etc/pam.d/login
#ORACLE SETTING
session required pam_limits.so
11、修改/etc/systemd/logind.conf文件
使用centos 7.2 安装grid时,需要修改这个参数,不然asm组件会起不来,crs时好时不好
vim /etc/systemd/logind.conf
RemoveIPC=no
systemctldaemon-reload
systemctlrestart systemcd-logind
12、修改sysctl.conf
在两个节点修改/etc/sysctl.conf
[root@rac1 ~]vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 3865470566
kernel.shmall = 943718
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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 = 1048586
备注:kernel.shmmax = 3865470566
shmmax Linux进程可以分配的单独共享内存段的最大值
2g物理内存,shmmax=2*1024*1024*1024*0.9 大于SGA,小于物理内存
kernel.shmall = 943718
2g物理内存 shmall=shmmax/1024/4
13、停止avahi-daemon服务
两个节点分别操作
[root@rac1 ~]# systemctl disable avahi-daemon.socket
[root@rac1 ~]# systemctl disable avahi-daemon.service
ps -ef|grep avahi-daemon
kill -9 pid avahi-daemon
14、添加NOZEROCONF=yes参数
[root@rac1 rpm]# vi /etc/sysconfig/network
NOZEROCONF=yes
15、修改grid用户环境变量
节点1 grid
[root@rac1 ~]# su - grid
[grid@rac1:/home/grid]$vi ~/.bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/12.1.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
节点2 grid
[root@rac2 ~]# su - grid
[grid@rac2:/home/grid]$vi ~/.bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/12.1.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
16、修改oracle用户环境变量
节点1 oracle
[root@rac1 ~]# su - oracle
[oracle@rac1:/home/oracle]$vi ~/.bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
export ORACLE_UNQNAME=rac1
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME
ORACLE_SID=rac1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/12.1.0/db_1/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
节点2 oracle
[root@rac2 ~]# su - oracle
[oracle@rac2:/home/oracle]$vi ~/.bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
export ORACLE_UNQNAME=rac2
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME
ORACLE_SID=rac2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/12.1.0/db_1/bin:$ORACLE_HOME/bin; export PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
17、修改root环境变量
加入grid用户$ORACLE_HOME
[root@rac1 opt]# vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:/u01/app/12.1.0/grid/bin:$HOME/bin
export PATH
18、修改共享存储、udev规则
在节点1和节点2,固定设备名称并且赋予grid属性,执行如下命令,用来生成udev规则
CentOS/RHEL6
[root@rac1]#
for i in b c d
do
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id--whitelisted --replace-whitespace --device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\""
done
CentOS/RHEL7直接编辑如下文件,修改result
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2916521e6dbec5e963be5ab3947", RUN+="/bin/sh -c 'mknod /dev/asm-crs b $major $minor; chown grid:asmadmin /dev/asm-crs; chmod 0660 /dev/asm-crs'"
MULTIPATH存储规则
for i in asm-crs asm-data asm-arch; do printf "%s %s\n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i | grep -i dm_uuid)"; done
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36005076802810e549800000000000002",OWNER="grid",GROUP="asmadmin",MODE="0660",NAME="asm-crs"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36005076802810e549800000000000003",OWNER="grid",GROUP="asmadmin",MODE="0660",NAME="asm-data"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36005076802810e549800000000000004",OWNER="grid",GROUP="asmadmin",MODE="0660",NAME="asm-arch"
19、将生成的配置添加到 /etc/udev/rules.d/99-oracle-asmdevices.rules中
**节点1 **
[root@rac1 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29c22c2e16b159380d9f83ed83f", RUN+="/bin/sh -c 'mknod /dev/asm-crs b $major $minor; chown grid:asmadmin /dev/asm-crs; chmod 0660 /dev/asm-crs'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c299c861df562dd44cf9491cb70f", RUN+="/bin/sh -c 'mknod /dev/asm-data b $major $minor; chown grid:asmadmin /dev/asm-data; chmod 0660 /dev/asm-data'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c297ff0ccad0340acb23cf228768", RUN+="/bin/sh -c 'mknod /dev/asm-arch b $major $minor; chown grid:asmadmin /dev/asm-arch; chmod 0660 /dev/asm-arch'"
在节点2,添加udev规则
[root@rac1 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29c22c2e16b159380d9f83ed83f", RUN+="/bin/sh -c 'mknod /dev/asm-crs b $major $minor; chown grid:asmadmin /dev/asm-crs; chmod 0660 /dev/asm-crs'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c299c861df562dd44cf9491cb70f", RUN+="/bin/sh -c 'mknod /dev/asm-data b $major $minor; chown grid:asmadmin /dev/asm-data; chmod 0660 /dev/asm-data'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c297ff0ccad0340acb23cf228768", RUN+="/bin/sh -c 'mknod /dev/asm-arch b $major $minor; chown grid:asmadmin /dev/asm-arch; chmod 0660 /dev/asm-arch'"
两个节点重启udev
[root@rac1 ~]#systemctl restart systemd-udev-trigger.service
20、检查共享磁盘分区
在两个节点检查udev重新生效后,有关asm磁盘是否可以识别
[root@rac1 ~]#ls /dev/asm* -l
brw-rw---- 1 grid asmadmin 8, 48 Apr 30 14:20 /dev/asm-arch
brw-rw---- 1 grid asmadmin 8, 16 Apr 30 14:20 /dev/asm-crs
brw-rw---- 1 grid asmadmin 8, 32 Apr 30 14:20 /dev/asm-data
21、禁用HugePages(可选)
1、vi /etc/default/grub
2、增加一行transparent_hugepage=never到尾部
GRUB_CMDLINE_LINUX=
“rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never”
3、grub2-mkconfig -o /boot/grub2/grub.cfg
4、[root@rac1 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
5、grep AnonHugePages /proc/meminfo
AnonHugePages: 0 kB ---------->>>返回值若是零,代表成功禁用THP
五、Grid集群软件安装部分
1、上传集群软件包
在节点1上传grid以及oracle安装包
[root@rac1 orasoft]# ll
total 548
drwxr-xr-x 7 oracle oinstall 4096 Feb 27 14:55 database
-rwxr-xr-x 1 root root 208504 Mar 13 13:35 linuxamd64_12102_grid_1of2.zip
-rwxr-xr-x 1 root root 208504 Mar 13 13:35 linuxamd64_12102_grid_2of2.zip
-rwxr-xr-x 1 root root 208504 Mar 13 13:35 linuxamd64_12102_database_1of2.zip
-rwxr-xr-x 1 root root 208504 Mar 13 13:35 linuxamd64_12102_database_2of2.zip
2、解压安装包
解压grid安装包到新的目录
3、安装集群CVUQDISK包
**节点1 **
[root@rac1 grid]# cd rpm
[root@rac1 rpm]#export CVUQDISK_GRP=oinstall
[root@rac1 rpm]#rpm -ivh cvuqdisk-1.0.9-1.rpm
节点2
[root@rac2 rpm]#export CVUQDISK_GRP=oinstall
[root@rac2 rpm]#rpm -ivh cvuqdisk-1.0.9-1.rpm
4、进入grid集群软件目录执行安装
[grid@rac1 grid]$ ./runInstaller
5、GUI安装步骤
步骤1 选择安装与配置集群
步骤2 选择标准集群
步骤3 选择高级安装
步骤4 添加中文
步骤5 配置scan(与hosts文件scan name相同)
步骤6 添加节点2 vip
步骤7 配置ssh互信以及验证
setup建立验证
配置完毕
ssh 测试验证
步骤8 检查public,private对应网段
步骤9 选择标准asm存储
步骤10 配置crs asm磁盘
步骤11 配置oracle asm密码
步骤12 ipm 配置 保持默认
步骤13 cloud control配置
步骤14 检查所属组
步骤15 grid安装目录保持默认
步骤16 配置安装目录 保持默认
步骤17 配置root.sh执行密码
步骤18 忽略警告
步骤19 配置完成开始,开始安装集群grid
执行root.sh,选择yes
忽略报错
安装完毕
六、Oracle DataBase软件安装
进入软件安装目录,执行安装
[oracle@rac1 opt]$ cd database/
[oracle@rac1 database]$ ./runInstaller
步骤1 忽略软件更新
步骤2 选择只安装数据库软件
步骤3 选择rac数据库安装
步骤4 ssh验证及测试
步骤5 选择语言
步骤6 选择版本
步骤7 安装目录选择
步骤8 操作系统组
步骤9 忽略警告
步骤10 配置完毕,开始安装
步骤11 执行root.sh
完成安装
- 创建脚本
当数据库重启时,oracle下的pdb不会随着cdb启动,需要通过创建触发器,在数据库启动时候自动打开pdb
使用SYS用户创建如下触发器:
CREATE TRIGGER open_all_pdbs
AFTER STARTUP
ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter pluggable database all open';
END open_all_pdbs;
/
七、dbca创建数据库(非容器数据库)
步骤1 创建数据文件asm磁盘组
grid用户下执行asmca
[grid@rac1 ~]$ asmca
步骤2 创建data,arch,磁盘组
步骤3 oracle用户下执行dbca
[oracle@rac1 database]$ dbca
步骤4 创建数据库
步骤5 选择高级模式
步骤6 自定义数据库
步骤7 选择数据库模式
非容器数据库
步骤8 选择所有节点
步骤9 配置em端口
步骤10 设置sys密码
步骤11 设置数据文件以及快闪区目录
步骤12 数据库组件
步骤13 设置数据库参数
sga+pga
连接数
字符集
连接模式
步骤14 开始创建数据库
步骤15 开始创建,忽略警告
步骤16 dbca创建数据库完毕
八、dbca创建数据库(多租户数据库)
创建容器数据库
创建容器数据库
数据库安全选项
其余安装选项与非容器数据库相同
九、安装过程中报错处理
1、GRID执行root.sh报错CLSRSC-258
[root@rac1 rpm]# /u01/app/12.1.0/grid/root.sh
encountered the following error:
ORA-00845: MEMORY_TARGET not supported on this system
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/rac1/crs/trace/ohasd_oraagent_grid.trc".
CRS-2674: Start of 'ora.asm' on 'rac1' failed
CRS-2679: Attempting to clean 'ora.asm' on 'rac1'
CRS-2681: Clean of 'ora.asm' on 'rac1' succeeded
ASM failed to start. Check /u01/app/grid/cfgtoollogs/asmca/asmca-180430PM112314.log for details.
2018/04/30 23:23:29 CLSRSC-184: Configuration of ASM failed
2018/04/30 23:23:29 CLSRSC-258: Failed to configure and start ASM
Died at /u01/app/12.1.0/grid/crs/install/crsinstall.pm line 2017.
The command '/u01/app/12.1.0/grid/perl/bin/perl -I/u01/app/12.1.0/grid/perl/lib -I/u01/app/12.1.0/grid/crs/install /u01/app/12.1.0/grid/crs/install/rootcrs.pl ' execution failed
解决方法
[root@rac1 rpm]# mount -t tmpfs shmfs -o size=2g /dev/shm/
[root@rac1 rpm]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel_rac1-root 26G 16G 8.8G 64% /
devtmpfs 977M 0 977M 0% /dev
shmfs 2.0G 0 2.0G 0% /dev/shm
[root@rac1 rpm]# vi /etc/fstab
shmfs /dev/shm tmpfs size=2g 0
然后再执行root.sh
2、error in invoking target ‘irman ioracle’ of makefile
解决方法:环境变量需要添加
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
3、在RHEL7/OL7上安装Oracle 12.1.0.2的服务器端或者客户端时,报需要"compat-libstdc++"包
来源于:MOS(文档 ID 2062336.1)
原因:
"compat-libstdc+±33-3.2.3 (x86_64)"包在rpm repository中并不存在。
这被当做一个bug21151912
解决方案:
选择忽略 'compat-libstdc+±33-3.2.3 (x86_64)'包,因为这个包并不需要。
然后继续安装。
4、CentOS/RHEL 7.2 集群起不来
故障现象:
重启服务器之后,集群中的asm组件会起不来,导致集群时好时不好
查看日志:
系统日志
vi /var/log/messages
Sep 6 13:28:48 rac1 kernel: traps: oracle[8987] trap divide error ip:387f4e8 sp:7ffc64a47240 error:0 in oracle[400000+ef37000]
asm实例告警日志
vi app/grid/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log
ORA-27157: OS post/wait facility removed
ORA-27300: OS system dependent operation:semop failed with status: 43
ORA-27301: OS failure message: Identifier removed
ORA-27302: failure occurred at: sskgpwwait1
Thu Sep 06 13:20:12 2018
Errors in file /u01/app/grid/diag/asm/+asm/+ASM1/trace/+ASM1_mman_2536.trc:
解决方法:
vim /etc/systemd/logind.conf
RemoveIPC=no
显式改成NO,7.2下默认为YES、7.4默认为NO
systemctldaemon-reload
systemctlrestart systemcd-logind
参考
MOS ID 2081410.1
https://blog.csdn.net/msdnchina/article/details/50864065
5、[INS-40915] The installer has detected the presence of Oracle Clusterware on the following nodes"
解决方法:
rm -rf /etc/oracle/ocr.loc
十、卸载Grid Cluster集群环境
1、卸载oracle数据库软件
su - oracle
cd $ORACLE_HOME/deinstall
[oracle@rac1 deinstall]$ ./deinstall
The details of database(s) orcl have been discovered automatically. Do you still want to modify the details of orcl database(s)? [n]: y
2、卸载grid集群软件
su - grid
cd $ORACLE_HOME/deinstall
[grid@rac1 deinstall]$ ./deinstall
如果不需要保留asm磁盘组,输入N
If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering 'y'. Do you want to modify above information (y|n) [n]: n
Database Check Configuration START
3、重新配置集群、清除grid安装配置,清空OCR配置和Voting disk
如果由于一些原因导致需要重新配置集群,那么需要先deconfig,再reconfig:
第一个节点
ORACLE_HOME/crs/install/rootcrs.sh -verbose -deconfig –force
第二个节点
ORACLE_HOME/crs/install/rootcrs.sh -verbose -deconfig –force -lastnode
rm -rf /etc/oraInst.loc
4、asm磁盘格式化
dd if=/dev/zero of=/dev/asm-crs bs=10240M count=1
dd if=/dev/zero of=/dev/sdb1 bs=1024 count=100
十一、集群日志查看
Oracle已经改变了命名约定开始使用Oracle 12.1.0.2的集群日志。
现在所有的集群日志文件被称为TRACE文件,并用带.trc扩展名(除集群警报日志)结束,而不是.log扩展这是在以前的版本的情况。
su - grid
cd $ORACLE_BASE
asm实例告警日志位置:
vi /u01/app/grid/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log
集群日志位置:
vi /u01/app/grid/diag/crs/rac1/crs/trace/alert.log
十二、客户端配置
tnsnames.ora
orcl_rac =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
(LOAD_BALANCE = yes)
(FAILOVER = ON)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
jdbc:
urlAddr: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.73.234 )(PORT = 1521)))(CONNECT_DATA =(SERVER=DEDICATED)(SERVICE_NAME = racdb)))
更多推荐
所有评论(0)