文档控制
修改记录
日期 | 作者 | 版本 | 修改记录 |
2022年12月01日 | 王xx | V 1.0 | 新建 |
分发者
姓名 | 单位 | 职位 |
审阅记录
姓名 | 单位 | 职位 |
1 安装目标与规划
两台华为2288 H V5服务器将安装Oracle11gR2 RAC。
1.1 安装介质版本
主机名 | shyorc01 | shyorc02 |
IP地址 | 192.168.25.120 | 192.168.25.121 |
操作系统 | Oracle Linux Server release 6.10 | |
Oracle Grid软件 | Oracle Infrastructure 11g | |
Oracle DB软件版本 | Oracle Enterprise 11g | |
补丁集版本 | Oracle 11.2.0.4 |
1.2 安装目录规划
项目 | 类别 | 目录/ASM磁盘组 | 空间大小 |
Oracle Software | Oracle Grid | /oracle/app/11.2.0/grid | 336G |
Oracle DB | /oracle/app/oracle/product/11.2.0/db_1 | ||
OnlineLog ControlFile DataFile | 控制文件 在线日志 数据文件 | +DATA1/ | 0.8T * 3 |
Voting Disk Ocr Disk | Oracle RAC Grid | +OCR/ | 10G * 3 |
Archivelog | 两个节点归档日志 | +ARCH/ | 0.5T * 1 |
1.3 网络规划
IP分配 | Pubic ip | VIP | San IP | Private IP |
shyorc01 | 192.168.25.120 | 10.10.10.11 | 192.168.25.122 | 192.168.25.125 |
shyorc02 | 192.168.25.121 | 10.10.10.12 | 192.168.25.126 |
1.4 共享存储规划
作用 | 大小 | 节点1 | 节点2 | ASM磁盘组/挂接点 | 冗余度 |
GRID DISK | 10GB | ● | ● | +OCR/ | NORMAL |
10GB | ● | ● | |||
10GB | ● | ● | |||
DATA FILES | 2.4T | ● | ● | +DATA1/ | EXTERNAL |
CONTROL FILES | 2.4T | ● | ● | ||
REDO LOGS | 2.4T | ● | ● | ||
ARCHIVELOG | 500G | ● | ● | +ARCH/ | EXTERNAL |
2 安装环境检查
2.1 软件需求检查
l 操作系统需求
要求:Oracle Enterprise Linux 6.10 (Update 1 or later)
[root@shyorc01 ~]# at /etc/redhat-release
Red Hat Enterprise Linux Server release 6.10 (Santiago)
[root@shyorc02 ~]# at /etc/redhat-release
Red Hat Enterprise Linux Server release 6.10 (Santiago)
l 系统软件包需求
binutils-2.20.51.0.2-5.28.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
gcc-4.4.6-3.el6 (x86_64)
gcc-c++-4.4.6-3.el6 (x86_64)
glibc-2.12-1.47.el6 (x86_64)
glibc-2.12-1.47.el6 (i686)
glibc-devel-2.12-1.47.el6 (x86_64)
glibc-devel-2.12-1.47.el6 (i686)
glibc-headers-2.12-1.149.el6(x86_64)
ksh-20100621-12.el6 (x86_64)
libgcc-4.4.6-3.el6 (x86_64)
libgcc-4.4.6-3.el6 (i686)
libstdc++-4.4.6-3.el6 (x86_64)
libstdc++-4.4.6-3.el6 (i686)
libstdc++-devel-4.4.6-3.el6 (x86_64)
libstdc++-devel-4.4.6-3.el6 (i686)
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (i686)
make-3.81-19.el6 (x86_64)
sysstat-9.0.4-18.el6 (x86_64)
oracleasm-support(x86_64)
elfutils-libelf-devel-0.97(x86_64)
l 挂载yum
mount –o loop /oracle/ora_linux_610.iso /mnt
l 检查命令:
yum list binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 cpp gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 make mpfr.x86_64 sysstat oracleasm-support elfutils-libelf-devel
检查结果
l 补安装软件包:
#cd /etc/yum.repos.d
#vim /etc/yum.repos.d/oel6.repo
[base]
name=iso
baseurl=file:///mnt
gpgcheck=1
enabled=1
gpgkey=file:///mnt/RPM-GPG-KEY-oracle
l 安装命令
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 cpp gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 make mpfr.x86_64 sysstat oracleasm-support elfutils-libelf-devel
l JAVA 版本需求:1.4.2
[root@shyorc01 ~]# java -version
java version "1.7.0_181"
OpenJDK Runtime Environment (rhel-2.6.14.10.0.1.el6-x86_64 u181-b00)
OpenJDK 64-Bit Server VM (build 24.181-b00, mixed mode)
[root@shyorc02 software]# java -version
java version "1.7.0_181"
OpenJDK Runtime Environment (rhel-2.6.14.10.0.1.el6-x86_64 u181-b00)
OpenJDK 64-Bit Server VM (build 24.181-b00, mixed mode)
3 安装前准备工作
3.1 创建安装目录
在所有节点上执行以下
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/11.2.0/grid
mkdir -p /oracle/app/oraInventory
mkdir -p /oracle/app/oracle/product/11.2.0/db_1
3.2 建立用户
安装oracle11g rac软件需要手工创建oracle用户和grid用户,前者用于管理数据库,后者用于管理Grid。
Ø 建立oracle和grid用户
groupadd -g 50001 oinstall
groupadd -g 50002 dba
groupadd -g 50003 oper
groupadd -g 50004 asmadmin
groupadd -g 50005 asmoper
groupadd -g 50006 asmdba
useradd -u 60001 -g oinstall -G dba,asmdba,oper oracle
useradd -u 60002 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
id -a oracle
id -a grid
Ø 修改密码
echo "P@sswordgrid" | passwd --stdin grid
echo "P@sswordoracle" | passwd --stdin oracle
Ø 安装目录授权
oracle | grid |
/oracle | /oracle/app/11.2.0/grid |
/oracle/app/oracle/product/11.2.0/db_1 |
将以上目录及子目录的权限授予相关用户
chown -R grid:oinstall /oracle
chown -R grid:oinstall /oracle/app/oraInventory
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle
3.3 配置和修改参数
Ø 配置英文环境
echo "export LANG=en_US.UTF-8" >> ~/.bash_profile
source ~/.bash_profile
Ø 关闭透明页
cat /sys/kernel/mm/transparent_hugepage/defrag
cat /sys/kernel/mm/transparent_hugepage/enabled
cat >> /etc/rc.d/rc.local <<-EOF
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
EOF
chmod +x /etc/rc.d/rc.local
Ø 关闭NUMA功能、需要重启服务器
sed -i 's#quiet#quiet numa=off#g' /boot/efi/EFI/redhat/grub.confecho
Ø 关闭SELINUX、IPTABLE、NTP
# 关闭 selinux
echo "SELINUX=disabled" > /etc/selinux/config
echo "#SELINUXTYPE=targeted " >> /etc/selinux/config
setenforce 0
# 关闭防火墙
service iptables stop
chkconfig --level 35 iptables off
# 禁止NTP服务
service ntpd stop
chkconfig ntpd off
Ø 配置系统环境资源、内核参数配置
cat >> /etc/security/limits.conf <<-EOF
##############ORACLE SET#####################
grid soft nproc 16384
grid hard nproc 16384
grid soft nofile 65536
grid hard nofile 65536
grid soft stack 32768
grid hard stack 32768
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft stack 32768
oracle hard stack 32768
##############ORACLE SET#####################
EOF
ulimit -a
Ø 配置进程打开最大数量
echo "* - nproc 16384" > /etc/security/limits.d/90-nproc.conf
cat /etc/security/limits.d/90-nproc.conf
Ø 用户资源分配
echo "session required pam_limits.so" >> /etc/pam.d/login
cat /etc/pam.d/login
Ø 配置Linux系统内核文件
cat >> /etc/sysctl.conf <<-EOF
##############ORACLE SET#####################
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 214748364800
kernel.shmall = 52428800
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
vm.nr_hugepages = 81920
vm.swappiness=10
vm.min_free_kbytes=524288
vm.vfs_cache_pressure=200
##############ORACLE SET#####################
EOF
Ø 配置添加UUID参数
echo "optinotallow=--whitelisted --replace-whitespace" > /etc/scsi_id.config
3.4 配置环境变量
Ø 配置oracle用户环境变量
oracle用户需要配置相关的环境变量,在每个节点上上都进行配置
$ echo $SHELL
PS1="[`whoami`@`hostname`:"'$PWD]$'
#alias sqlplus="rlwrap sqlplus"
#alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=shyorc01
export ORACLE_UNQNAME=shydb
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=shydb01; 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.AL32UTF8;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
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
Ø 配置grid用户环境变量
grid用户需要配置相关的环境变量,在每个节点上上都进行配置
$ echo $SHELL
/bin/bash
Bourne shell (sh), Bash shell (bash), or Korn shell (ksh):
$ vi .bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
#alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=shyorc01
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=/oracle/app/11.2.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
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
3.5 配置存储
安装oracle RAC需要对共享的存储空间进行配置,包括集群仲裁磁盘、集群信息盘、ASM数据磁盘和归档日志磁盘
Ø 存储划分
lun | 作用 | 大小 | 节点1 | 节点2 | ASM磁盘组 |
/dev/mapper/asm-ocr01 | Oracle CRS仲裁盘 | 10G | ● | ● | +ocr |
/dev/mapper/asm-ocr02 | 10G | ● | ● | ||
/dev/mapper/asm-ocr03 | 10G | ● | ● | ||
/dev/mapper/asm-data01 | ASM数据盘 | 2.4T | ● | ● | +data1 |
/dev/mapper/asm-data02 | ● | ● | |||
/dev/mapper/asm-data03 | ● | ● | |||
/dev/mapper/asm-arch01 | Oracle 归档盘 | 0.5T | ● | ● | +arch |
Ø 配置UDEV绑定共享磁盘权限
cat > /etc/udev/rules.d/99-oracle-asmdevices.rules <<-EOF
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
010310c200000000", SYMLINK+="asm-ocr01",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
01031d9e00000001", SYMLINK+="asm-ocr02",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
010327b900000002", SYMLINK+="asm-ocr03",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
010341cf00000003", SYMLINK+="asm-arch01",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
0103570900000004", SYMLINK+="asm-data01",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
010364d200000005", SYMLINK+="asm-data02",OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3620658e100aeed0c
010371c900000006", SYMLINK+="asm-data03",OWNER="grid", GROUP="asmadmin",MODE="0660"
EOF
Ø 查看设备权限
[root@shyorc02 software]# ll /dev/asm*
3.6 配置网络
Ø 配置网卡绑定(主备模式)
shyorc01公网网卡绑定:
DEVICE="bond0"
IPADDR=192.168.25.120
NETMASK=255.255.255.0
NETWORK=192.168.25.0
GATEWAY=192.168.25.254
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
TYPE=Ethernet
BONDING_OPTS="miimnotallow=200 mode=1"
shyorc02公网网卡绑定:
DEVICE=bond0
NAME=bond0
IPADDR=192.168.25.121
NETMASK=255.255.255.0
NETWORK=192.168.25.0
GATEWAY=192.168.25.254
ONBOOT=yes
DEFROUTE=yes
BOOTPROTO=none
USERCTL=no
TYPE=Ethernet
BONDING_OPTS="miimnotallow=200 mode=1"
Ø 查看网络绑定状况
[root@shyorc01 ~]# ifconfig
bond0 Link encap:Ethernet HWaddr EC:C0:1B:DA:65:65
inet addr:192.168.25.120 Bcast:192.168.25.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:320391 errors:0 dropped:130069 overruns:0 frame:0
TX packets:376054 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27514003 (26.2 MiB) TX bytes:381588407 (363.9 MiB)
[root@shyorc02 ]# ifconfig
bond0 Link encap:Ethernet HWaddr EC:C0:1B:DA:63:F9
inet addr:192.168.25.121 Bcast:192.168.25.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:301275 errors:0 dropped:130093 overruns:0 frame:0
TX packets:338410 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:25567655 (24.3 MiB) TX bytes:360703608 (343.9 MiB)
3.7 其他配置
编辑/etc/sysconfig/network添加NOZEROCONF=yes参数
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hisserver1
NETWORKING_IPV6=no
NOZEROCONF=yes
安装cvuqdisk-1.0.9-1.rpm包
#CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
#rpm -ivh $STAGE/rpm/cvuqdisk-1.0.9-1.rpm
4 软件安装过程
4.1 安装Grid Infrastructure 11.2.0.4
步骤 | 内容 |
解压安装文件 | 将以下文件解压 p13390677_112040_Linux-x86-64_3of7.zip |
xmanager登录jydb1 | #xhost + #su - grid |
运行Grid的runInstaller | $ cd /oracle/install/grid/grid $ ./runInstaller |
界面1:Download Software Updates | 选择“Skip software updates”.点击“next” |
界面2:Installation Option | 选择“Install and Configure Oracle Grid Infrastructure for a Cluster”.点击“next” |
界面3:Installation Type | 选择“Advanced Installation”.点击“next” |
界面4:Select Product Languages | 从左侧选择“English”到右侧.点击“next” |
界面5:Grid Plug and Play Information | 点击取消“Configure GNS”,在“Cluster Name”中输入“shydb-cluster”, “SCAN Name”为“shydbscan”,“SCAN Port”为11152。.点击“next” |
界面6: Cluster Node Information | 点击“Add”添加其余节点,在弹出的窗口中填入: Public Hostname:shyorc01 Virtual Hostname: shyorc01vip Public Hostname:shyorc02 Virtual Hostname: shyorc02vip 这时应可看到全部两个RAC的节点于"Cluster Nodes"的表上,检查一下 点击“SSH Connectivity”先安装setup再测试双机信任互通性。 点击“next” |
界面7:Specify Network Interface Usage | 会看到多个网络界面,在这画面需要设定哪个界面是公共网络(public network),哪个属于专用网络(private network) 本次安装的设定值为: 完成设定后,点击“next” |
界面8:Storage Option Information | 选择“Oracle Automatic Storage Management(Oracle ASM)” 点击“next”。 |
界面9:Create ASM Disk Group | 在“Disk Group Name”中填入“grid”,选择Redundancy为“Normal”,勾选以下三块磁盘: 点击“next”。 |
界面10:Specify ASM Password | 选择“Use the same password for all the accounts” 输入口令“Oracle123” 点击“next”,忽略出现的警告提示。 |
界面11:Privileged Operating System Groups | 操作系统用户组 Oracle ASM DBA(OSDBA for ASM) Group:asmdba Oracle ASM Operator (OSOPER for ASM) Group(Optional):asmoper Oracle ASM Administrator(OSASM) Group: asmadmin 点击“next”。 |
界面12:Specify Installation Location | Oracle Base: /oracle/app/grid Software Location: /oracle/app/11.2.0/grid 点击“next”。 |
界面13:Create Inventory | 输入oraInventory 的路径 /oracle/11.2.0/grid/oraInventory 点击“next”。 |
界面14:Perform Prerequisite Checks | 等待约安装检查的完成 (由于没有DNS配置scan IP,所以在解析文件resolv.conf会提示报错) |
界面15:Summary | 点击“Install” |
界面16:Install Product | 等待完成 |
Install (Execute Configuration scripts) | 安装接近完成时,需要手使用root用户在每一个节点运行以下脚本: 1. 在两个节点上上执行 #/oracle/11.2.0/grid/oraInventory/orainstRoot.sh 2. 在两个节点上上执行 #/oracle/app/11.2.0/grid/root.sh |
界面17:Finish | 点击“Close”退出 |
检查CRS启动状态 | [root@shyorc01 ~]# crsctl status res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS Local Resources -------------------------------------------------------------------------------- ora.DGDATA1.dg ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.DGOCR.dg ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.LISTENER.lsnr ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.asm ONLINE ONLINE shyorc01 Started ONLINE ONLINE shyorc02 Started ora.gsd OFFLINE OFFLINE shyorc01 OFFLINE OFFLINE shyorc02 ora.net1.network ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.ons ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 --------------------------------------------------------------------------------Cluster Resources --------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE shyorc01 ora.cvu 1 ONLINE ONLINE shyorc01 ora.oc4j 1 ONLINE ONLINE shydb ora.shyorc01.vip 1 ONLINE ONLINE shyorc01 ora.shyorc02.vip 1 ONLINE ONLINE shyorc02 ora.scan1.vip 1 ONLINE ONLINE shyorc01 |
注:在11.2版本的GSD服务状态显示为OFFLINE是正常的。
4.2 安装Oracle DB 11.2.0.4软件
步骤 | 详细操作 |
登录jydb1 | #xhost + #su - oracle |
运行RDBMS的runInstaller | $ cd /oracle/install/db/database ./runInstaller |
界面1:Configure Security Updates | 取消选择“I wish to receive security updates via My Oracle Support” 。点击“next”,忽略提示警告。 |
界面2:Download Software Updates | 选择“Skip software updates”.点击“next” |
界面3:Installation Option | 选择“Install database software only”.点击“next” |
界面4:Grid Installation Options | 选择“Oracle Real Application Clusters database installation” 在列表中点选所有其他节点, 点击下面的SSHconnectivity进行setup安装SSH,完成后点击测试SSH,通过后点击“next” |
界面5:Select Product Languages | 从左侧选择“Simplified Chinese”到右侧.点击“next” |
界面6:Select Database Edition | 选择“Enterprise Edition”点击“Select Option”确认以下选件: Oracle Partitioning Oracle OLAP Oracle Data Mining RDBMS Files Oracle Real Application Testing 点击“Next” |
界面7:Specify Installation Location | 确定Oracle的安装路径: Oracle Base: /oracle/app/oracle Software Location: /oracle/app/oracle/product/11.2.0/db_1 点击“Next” |
界面8:Privileged Operating System Groups | 操作系统用户组 Database Administration (OSDBA) Group : dba Database Operator (OSOPER) Group:oper 点击“next”。 |
界面9:Perform Prerequisite Checks | 等待约安装检查的完成 |
界面10:Summary | 点击“Install” |
界面11:Install Product | 等待完成 |
Install (Execute Configuration scripts) | 安装接近完成时,需要手使用root用户在每一个节点运行以下脚本: 在两个节点上上执行 #/oracle/app/oracle/product/11.2.0/db_1/root.sh 运行root.sh后最后显示: [root@shyorc01~]#/oracle/app/oracle/product/11.2.0/db_1/root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracle/app/oracle/product/11.2.0/db_1 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. 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. Finished product-specific root actions. |
界面12:Finish | 点击“Close”退出 |
4.3 建立RAC数据库
步骤 | 详细操作 |
启动dbca | #su - oracle $dbca |
界面1:Welcome | 选择Oracle Real Application Clusters (RAC) Database,点击next |
界面2: Step 2 of 12: Database Templates | 选择Custom Database,点击next |
界面3:Step 3 of 12: Databases Identifier | Configuration Type:选择“Admin-Managed” Global Database Name:shy SID Prefix: shy 点击“Select All”选择所有节点 点击next |
界面4: Step 4 of 12: Management Options | 取消选择"Configure Enterprise Manager" 取消选择"Automatic Maintenance Tasks" 点击Next |
界面5:Step 5 of 12: Database Credentials | 选择Use the same password for all accounts , 输入口令“123456”并确认输入,点击next |
界面6: Step 6 of 12: Storage Options | 选择存储类型:Automatic Storage Management (ASM) 选择"Use Common Location for All Database files" 选择“+DATA1” 点击Next |
界面7: Step 7 of 12: Recovery Configuration | 取消选择“Specify Fast Recovery Area” 点击Next |
界面8: Step 8 of 12: Database Content | 选择Oracle Text、Oracle JVM、Oracle XML DB和Oracle Application Express 点击Next |
界面9: Step 9 of 12: Initialization Parameters | Block Size=8192, Processes=6000 在Character Sets TAB处选择 字符集:ZHS16GBK, National Character Set: AL16UTF16 在Connection Mode TAB处选择:Dedicated Server Mode 点击Next |
界面10:Step 10 of 12: Database Storage | SYSAUX表空间:5120M SYSTEM表空间:5120M TEMP表空间:10240M UNDOTBS1表空间:10240M UNDOTBS2表空间:10240M USERS表空间:2048M Redo Thread 1: Group1 100M Group2 100M Redo Thread 2: Group3 100M Group4 100M 配置完毕后点击Next |
界面11:Step 11 of 12 | 点击Finish。开始创建数据库。 |
界面12:Finish | 点击“Exit” |
5 其它修正
5.1 后续操作
步骤 | 具体操作 |
备份参数文件 | create pfile='/tmp/inithis.ora' from spfile; |
修改其它数据库实例参数 | alter system set db_files=8192 scope=spfile sid='*'; alter system set audit_trail=none scope=spfile sid='*'; alter system set open_cursors=500 scope=spfile sid='*'; alter system set open_links=30 scope=spfile sid='*'; alter system set open_links_per_instance=30 scope=spfile sid='*'; alter system set optimizer_index_caching=90 scope=spfile sid='*'; alter system set optimizer_index_cost_adj=50 scope=spfile sid='*'; alter system set optimizer_mode='ALL_ROWS' scope=spfile sid='*'; alter system set SEC_CASE_SENSITIVE_LOGON = FALSE scope=spfile sid='*'; alter system set deferred_segment_creatinotallow=false scope=spfile sid='*'; alter system set audit_trail=none scope=spfile sid='*'; alter profile default limit failed_login_attempts unlimited; alter profile default limit password_life_time unlimited; alter profile default limit PASSWORD_LOCK_TIME unlimited; alter profile default limit PASSWORD_GRACE_TIME unlimited; |
修改事件 | alter system set event ="28401 TRACE NAME CONTEXT FOREVER, LEVEL 1" scope=spfile sid='*'; High 'library cache lock' Wait Time Due to Invalid Login Attempts (文档 ID 1309738.1) |
CRS 参数修改 | 所有节点上执行: #crsctl debug log css CSSD:1 在任一节点上执行: #crsctl set css diagwait 13 |
ASM实例 | 调整memory_target参数大小为4G alter system set memory_target=4G scope=spfile sid='*'; 修改_asm_hbeatiowait为120秒 alter system set "_asm_hbeatiowait"=120 scope=spfile sid='*'; |
Crs状态 | [root@shyorc01 ~]# crsctl status res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS Local Resources -------------------------------------------------------------------------------- ora.DGDATA1.dg ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.DGOCR.dg ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.LISTENER.lsnr ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.asm ONLINE ONLINE shyorc01 Started ONLINE ONLINE shyorc02 Started ora.gsd OFFLINE OFFLINE shyorc01 OFFLINE OFFLINE shyorc02 ora.net1.network ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 ora.ons ONLINE ONLINE shyorc01 ONLINE ONLINE shyorc02 --------------------------------------------------------------------------------Cluster Resources --------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE shyorc01 ora.cvu 1 ONLINE ONLINE shyorc01 ora.oc4j 1 ONLINE ONLINE shydb ora.shy.db 1 ONLINE ONLINE shyorc01 Open 2 ONLINE ONLINE shyorc02 Open ora.shyorc01.vip 1 ONLINE ONLINE shyorc01 ora.shyorc02.vip 1 ONLINE ONLINE shyorc02 ora.scan1.vip 1 ONLINE ONLINE shyorc01 |
Select ksppinm,ksppstvl from x$ksppi join x$ksppcv using (indx) where ksppinm like '\_%' escape '\'and ksppinm like '%asm_hb%' order by ksppinm ; |