redhat6.7环境下oracle11gR2 RAC静默安装

(一)基础环境

虚拟机环境 :vmware workstation 12

操作系统    : redhat6.7 - 64bit

数据库版本 :11.2.0.4

(二)安装前的环境准备

(2.1)配置/etc/hosts文件,2个节点都要修改

[[email protected] bin]$vim more /etc/hosts
# 添加2个节点的IP信息
192.168.10.41    standbydb1
192.168.10.42    standbydb2
192.168.10.43    standbydb1-vip
192.168.10.44    standbydb2-vip
192.168.10.40    standbydb-scan

10.10.10.41       standbydb1-priv
10.10.10.42       standbydb2-priv

(2.2)操作系统参数修改,2个节点都要修改

(2.2.1)修改/etc/sysctl.conf

[[email protected]standbydb1 ~]# vi /etc/sysctl.conf
# 在末尾添加

kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1306910720
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
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304

内核参数执行命令sysctl -p生效。

(2.2.2)修改/etc/security/limits.conf

[[email protected]standbydb1 ~]# vi /etc/security/limits.conf
# 在末尾添加

grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

(2.2.3)修改/etc/security/limits.conf

[[email protected]standbydb1 ~]# vi /etc/pam.d/login# 在文件末尾添加
session required pam_limits.so

(2.3)配置共享存储
(2.3.1)分区、格式化磁盘,在一个节点上执行即可

# 在节点1上格式化,以/dev/sdb为例:

[[email protected]standbydb1 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 3824.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3824, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3824, default 3824):
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

(2.3.2)在2个节点上添加裸设备,2个节点都要执行

[[email protected]standbydb1 ~]# vi /etc/udev/rules.d/60-raw.rules
 # 在后面添加

ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdh1", RUN+="/bin/raw /dev/raw/raw7 %N"

KERNEL=="raw[1]", MODE="0660", OWNER="grid", GROUP="asmadmin"
KERNEL=="raw[2]", MODE="0660", OWNER="grid", GROUP="asmadmin"
KERNEL=="raw[3]", MODE="0660", OWNER="grid", GROUP="asmadmin"
KERNEL=="raw[4]", MODE="0660", OWNER="grid", GROUP="asmadmin"
KERNEL=="raw[5]", MODE="0660", OWNER="grid", GROUP="asmadmin"
KERNEL=="raw[6]", MODE="0660", OWNER="grid", GROUP="asmadmin"
KERNEL=="raw[7]", MODE="0660", OWNER="grid", GROUP="asmadmin"

启动裸设备,2个节点都执行

[[email protected]standbydb1 ~]# start_udev

检查裸设备,2个节点都要查看,如果看不到设备信息,重启节点即可

[[email protected]standbydb1 ~]# raw -qa
/dev/raw/raw1:    bound to major 8, minor 17
/dev/raw/raw2:    bound to major 8, minor 33
/dev/raw/raw3:    bound to major 8, minor 49
/dev/raw/raw4:    bound to major 8, minor 65
/dev/raw/raw5:    bound to major 8, minor 81
/dev/raw/raw6:    bound to major 8, minor 97
/dev/raw/raw7:    bound to major 8, minor 113

(2.4)安装依赖包,2个节点都执行

yum install -y binutils-*
yum install -y compat-libstdc++-*
yum install -y elfutils-libelf-*
yum install -y elfutils-libelf-*
yum install -y elfutils-libelf-devel-static-*
yum install -y gcc-*
yum install -y gcc-c++-*
yum install -y glibc-*
yum install -y glibc-common-*
yum install -y glibc-devel-*
yum install -y glibc-headers-*
yum install -y kernel-headers-*
yum install -y ksh-*
yum install -y libaio-*
yum install -y libaio-devel-*
yum install -y libgcc-*
yum install -y libgomp-*
yum install -y libstdc++-*
yum install -y libstdc++-devel-*
yum install -y make-*
yum install -y sysstat-*
yum install -y compat-libcap*

(2.5)创建oracle、grid用户相关

(2.5.1)创建用户、用户组、目录,2个节点都要执行

/usr/sbin/groupadd -g 1010 oinstall
/usr/sbin/groupadd -g 1020 asmadmin
/usr/sbin/groupadd -g 1021 asmdba
/usr/sbin/groupadd -g 1022 asmoper
/usr/sbin/groupadd -g 1031 dba
/usr/sbin/groupadd -g 1032 oper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
useradd -u 1101 -g oinstall -G dba,asmdba,oper oracle
mkdir -p /u01/app/12.1.0/grid
mkdir -p /u01/app/grid
mkdir /u01/app/oracle
chown -R grid:oinstall /u01
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

(2.5.2)配置grid的环境变量,2个节点都要执行

[[email protected] ~]$ vim .bash_profile 

#添加
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=+ASM1   #如果是节点2,改为:+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022

(2.5.3)配置oracle的环境变量,2个节点都要执行

[[email protected] ~]$ vim .bash_profile 

#添加
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=standby1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022

(2.5.4)配置grid的节点互信,在一个节点用grid用户执行

./sshUserSetup.sh -hosts "primarydb1 primarydb2" -user grid -advanced

(2.5.5)配置oracle的节点互信,在一个节点用oracle用户执行

./sshUserSetup.sh -hosts "primarydb1 primarydb2" -user grid -advanced

 (2.6)安装前的检查

 2个节点安装cvuqdisk包,进入grid安装包

[[email protected] soft]# cd grid/
[[email protected] grid]# ls
doc  install  response  rpm  runcluvfy.sh  runInstaller  sshsetup  stage  welcome.html
[[email protected] grid]# cd rpm/
[[email protected] rpm]# ls
cvuqdisk-1.0.7-1.rpm
[[email protected] rpm]# rpm -ivh cvuqdisk-1.0.7-1.rpm
Preparing...                ########################################### [100%]
Using default group oinstall to install package
   1:cvuqdisk               ########################################### [100%]

执行grid安装检查

./runcluvfy.sh stage -pre crsinst -n standbydb1,standbydb2 -fixup -verbose

如果没有报错,即可执行安装操作。

(三)安装

(3.1)安装grid

安装命令:

./runInstaller -ignorePrereq -silent -force -responseFile /soft/grid/grid/response/grid_install.rsp -showProgress

响应文件grid_install.rsp的内容为:

oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=standbydb1
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/11.2.0/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=standbydb-scan
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.clusterName=standbydb-scan
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=standbydb1:standbydb1-vip,standbydb2:standbydb2-vip
oracle.install.crs.config.networkInterfaceList=eth0:192.168.10.0:1,eth1:10.10.10.0:2,eth2:192.168.0.0:3
oracle.install.crs.config.storageOption=ASM_STORAGE
oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL

oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=Oracle123
oracle.install.asm.diskGroup.name=OCR
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/raw/raw1,/dev/raw/raw2,/dev/raw/raw3
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/raw/*
oracle.install.asm.monitorPassword=Oracle123
oracle.install.crs.upgrade.clusterNodes=
oracle.install.asm.upgradeASM=false
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=

额外工作:

(1)创建磁盘组

su - grid

sqlplus / as sysasm
create diskgroup data external redundancy disk ‘/dev/raw/raw4‘,‘/dev/raw/raw5‘,‘/dev/raw/raw6‘ attribute ‘compatible.rdbms‘=‘11.2.0.0‘, ‘compatible.asm‘=‘11.2.0.0‘, ‘au_size‘=‘1M‘;
create diskgroup arch external redundancy disk ‘/dev/raw/raw7‘ attribute ‘compatible.rdbms‘=‘11.2.0.0‘, ‘compatible.asm‘=‘11.2.0.0‘, ‘au_size‘=‘1M‘;

启动所有节点上的磁盘组

(2)创建默认监听

su - grid

srvctl add listener
srvctl start listener

(3.2)安装数据库软件

安装命令:

./runInstaller -ignorePrereq -silent -force -responseFile /u01/mysoft/oracle/db_install_20190714.rsp

响应文件db_install_20190714.rsp的内容为:

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=standbydb1
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.CLUSTER_NODES=standbydb1,standbydb2
oracle.install.db.isRACOneInstall=false
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=

(3.3)创建数据库

[[email protected] bin]$ pwd
/u01/app/oracle/product/11.2.0/db_1/bin
[[email protected] bin]$ ./dbca -silent -responseFile /u01/mysoft/oracle/database/response/dbca_20190714.rsp

响应文件db_install_20190714.rsp的内容为:

[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "standby"
DB_UNIQUE_NAME = "standby"
SID = "standby"
NODELIST=standbydb1,standbydb2
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "Oracle123"
SYSTEMPASSWORD = "Oracle123"
DATAFILEDESTINATION = "+DATA"
STORAGETYPE=ASM
DISKGROUPNAME=DATA
CHARACTERSET = "ZHS16GBK"
NATIONALCHARACTERSET= "UTF8"
DB_BLOCK_SIZE=8192
TOTALMEMORY = "1024"

(四)结果确认

查看集群资源

[[email protected] ~]$ crsctl status res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
ora.DATA.dg
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
ora.LISTENER.lsnr
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
ora.OCR.dg
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
ora.asm
               ONLINE  ONLINE       standbydb1               Started
               ONLINE  ONLINE       standbydb2               Started
ora.gsd
               OFFLINE OFFLINE      standbydb1
               OFFLINE OFFLINE      standbydb2
ora.net1.network
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
ora.ons
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
ora.registry.acfs
               ONLINE  ONLINE       standbydb1
               ONLINE  ONLINE       standbydb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       standbydb1
ora.cvu
      1        ONLINE  ONLINE       standbydb1
ora.oc4j
      1        ONLINE  ONLINE       standbydb1
ora.scan1.vip
      1        ONLINE  ONLINE       standbydb1
ora.standby.db
      1        ONLINE  ONLINE       standbydb1               Open
      2        ONLINE  ONLINE       standbydb2               Open
ora.standbydb1.vip
      1        ONLINE  ONLINE       standbydb1
ora.standbydb2.vip
      1        ONLINE  ONLINE       standbydb2                                   

查看数据库状态

SQL> select name,open_mode from v$database;
NAME      OPEN_MODE
--------- --------------------
STANDBY   READ WRITE

SQL> select host_name,instance_name from gv$instance;
HOST_NAME             INSTANCE_NAME
-------------  -----------------
standbydb1         standby1
standbydb2         standby2

结束。

原文地址:https://www.cnblogs.com/lijiaman/p/11185504.html

时间: 2024-11-20 12:27:08

redhat6.7环境下oracle11gR2 RAC静默安装的相关文章

Linux和Ubuntu环境下B2G(Firefox OS)安装、编译、测试教程集合

1在ubuntu上测试Firefox OS(B2G)系统 Firefox OS,项目代号为"Boot 2 Gecko",是一个开放的完全基于WEB标准的智能手机操作系统,由Mozilla公司开发.Firefox OS 底层属于Linux,开放的Web技术,而不是特定于平台的原生API,用HTML5 编写应用程序.Firefox OS 每日构建版目前可在电脑桌面上试用. 安装过程非常简单,下面是详细的步骤说明: 点 这里 下载 ... 2在 ubuntu系统上建立b2g系统(翻译) 你已

Windows Azure+Windows+Linux多环境下Tomcat服务的安装及配置集合

Windows Azure+Windows+Linux多环境下的Tomcat服务的安装及配置集合 说到Tomcat服务,相信大家都很熟悉了,当然也这包括安装及配置:我们都知道Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP 程序的首选.对于一个初学者来说,可以这样认为,当在一台机器上配置好Apache 服务器,可利用它响应HTML(标准通用标记语言下的一个应用)页面的访问请求.实际上To

Jupiter 页面环境下使用pip无法安装(AttributeError: module 'pip' has no attribute 'main')

异常: AttributeError Traceback (most recent call last) <ipython-input-5-880e5dfa627c> in <module> 1 def install(package): 2 pip.main(["install", package]) ----> 3 install("syslog_parse") <ipython-input-5-880e5dfa627c>

CentOS7.X环境下源码包安装部署RabbitMQ3.7.17

本文介绍在CentOS7.X环境下源码包安装部署RabbitMQ3.7.17,使用docker安装很简单,这里我就不往文章中添加.在CentOS7.X环境下使用源码包安装还是有遇到不少坑的(使用yum安装的方式官方网站有介绍,比较简单),通过这篇我的个人实践操作,能够帮助到有需要的人.搭建环境:操作系统:CentOS7.5内存大小:16GB硬盘:100G注:正文中的参数与部署路径等,请根据实际需求修改.1.软件准备:wxWidgets-3.1.2.tar.bz2otp_src_22.0.tar.

内网环境下centos7.4离线安装oracle,及不同用户表空间迁移数据

初始环境为Centos7.4 Mini安装后的系统,最开始用镜像iso做为yum源,安装oracle,在静默安装的时候报错,后来用一台同样环境的系统,开启yum缓存,下载安装依赖环境,让rpm包离线下载后,传到这台服务器,在静默安装,还是失败,最后网上找了个离线安装依赖包,成功静默安装及建库,将源oracle下的用户及表空间数据迁移到新安装的oracle用户和表空间下.以后安装可以直接安装离线依赖包 安装前的准备: 1. 修改主机名 #sed -i "s/HOSTNAME=localhost.l

《高可用MySQL》1 – Windows环境下压缩版MySQL安装

近日在读O'REILIY系列的<高可用MySQL>, 自然少不了主从(Master-Slave)配置和横向扩展相关的内容. Master-Slave这东西吧.在很多公司都是标配.开发中基本天天都用.遇到的问题自然也不少(如主从不同步,Master宕机).但操作权限很有限.有些东西,仅仅有自己看了.做了,才干真正知道原理是什么,也才干更好的去把握. 本文是高可用MySQL的第一篇读书笔记,主要记录Windows环境下压缩版MySQL(基于安装版的傻瓜式安装过程这里不再提及)的安装过程. 1. 从

Mac环境下Myeclispe2015工具的安装与破解

首先是Myeclispe2015的下载,废话不多说,已传至百度云,直接下载即可. Myeclispe2015 for mac下载地址: 链接: http://pan.baidu.com/s/1qWzKzOK 密码: recx 然后是破解工具的下载(适用于2014与2015): 链接: http://pan.baidu.com/s/1jGxULnS 密码: crz3 Myeclispe工具下载完之后,直接安装即可, 打开myeclipse-2015-stable-2.0-offline-insta

《高可用MySQL》读书笔记1 – Windows环境下压缩版MySQL安装

近日在读O'REILIY系列的<高可用MySQL>, 自然少不了主从(Master-Slave)配置和横向扩展相关的内容.Master-Slave这东西吧,在许多公司都是标配,开发中基本天天都用,遇到的问题自然也不少(如主从不同步,Master宕机),但操作权限非常有限.有些东西,只有自己看了.做了,才能真正知道原理是什么,也才能更好的去把握. 本文是高可用MySQL的第一篇读书笔记,主要记录Windows环境下压缩版MySQL(基于安装版的傻瓜式安装过程这里不再提及)的安装过程. 1. 从官

Linux环境下JDK/Eclipse一键安装脚本

-------------------------------------------------------------------- author:jiangxin Email:[email protected] Blog:http://blog.csdn.net/jiangxinnju -------------------------------------------------------------------- 假设大家必须在Linux环境下使用java开发应用程序,会感觉Lin