单机GRID 静默安装教程 虚拟机配置:centos6.5 系统最小化安装 虚拟机网卡为桥接 IP地址为 192.168.31.181
grid软件和oracle 软件下载地址如下:https://pan.baidu.com/s/1ASDJQmxB5VHYH6HCS8OoKA g6bq
https://pan.baidu.com/s/147vs9C0Apv51IdqcUmOyJw g3k4
网卡信息如下
DEVICE=eth0
TYPE=Ethernet
UUID=815ab5cc-91bc-4c8a-830f-5ddc6b0c5e37
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.31.181
NETMASK=255.255.255.0
GATEWAY=192.168.31.1
关闭防火墙
service iptables stop
chkconfig iptables off
vi /etc/resolv.conf
nameserver 192.168.31.1
关闭SELINUX
sed -i ‘s/^SELINUX=.*/SELINUX=disabled/’ /etc/selinux/config
setenforce 0
getenforce
echo “192.168.31.181 node1”>>/etc/hosts
echo "
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft stack 10240
grid hard stack 32768
" >> /etc/security/limits.conf
echo "
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
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 = 1048576
" >> /etc/sysctl.conf
cp /etc/pam.d/login /etc/pam.d/login.bak
echo "
session required pam_limits.so
" >>/etc/pam.d/login
// 本地yum 源设置
mkdir /media/iso
mount -o loop /dev/cdrom /media/iso/
cd /etc/yum.repos.d/
rename .repo .repo.bak *
touch CentOS-Media.repo
echo "
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/iso/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
">>/etc/yum.repos.d/CentOS-Media.repo
– 安装依赖包
yum -y install binutils-2x86_64
yum -y install glibc-2x86_64
yum -y install glibc-2i686
yum -y install nss-softokn-freebl-3x86_64
yum -y install nss-softokn-freebl-3i686
yum -y install elfutils-libelf-0x86_64
yum -y install elfutils-libelf-devel-0x86_64
yum -y install gcc-4x86_64
yum -y install gcc-c+±4x86_64
yum -y install ksh-x86_64
yum -y install numactl-devel-2x86_64
yum -y install sysstat-9x86_64
yum -y install compat-libcap*
yum -y install binutils-2.*
yum -y install compat-libstdc+±33*
yum -y install elfutils-libelf-0.*
yum -y install libaio-0.*
yum -y install libaio-devel-0.*
yum -y install sysstat-9.*
yum -y install glibc-2.*
yum -y install glibc-common-2.*
yum -y install glibc-devel-2.*
yum -y install glibc-headers-2.*
yum -y install ksh-2*
yum -y install make-3.*
yum -y install libgcc-4.*
yum -y install libstdc+±4.*
yum -y install libstdc+±4..i686
yum -y install libstdc+±devel-4.*
yum -y install libcap-2.16-5.2.el6.i686.rpm
yum -y install libattr-2.4.44-4.el6.i686.rpm
yum -y install libtool-ltdli686
yum -y install ncursesi686
yum -y install readlinei686
yum -y install unixODBC
yum -y install unixODBC-devel
yum install readline
yum install readline-devel
yum install -y libcap
yum install xorg-x11-xauth
yum -y install xterm*
yum -y install bind*
yum install libXp
yum -y install binutils compat-libstdc+±33 compat-libstdc+±33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc+±devel make sysstat
rpm -q \binutils \compat-libstdc+±33 \elfutils-libelf \elfutils-libelf-devel \expat \gcc \gcc-c++ \glibc \glibc-common \glibc-devel \glibc-headers \libaio \libaio-devel \libgcc \libstdc++ \libstdc+±devel \make \pdksh \sysstat \unixODBC \unixODBC-devel | grep “not installed”
wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
cd /tmp
rpm -e ksh-20120801-10.el6.x86_64
rpm -Uvh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper grid
useradd -u 1101 -g oinstall -G dba,oper,asmdba oracle
echo “grid” | passwd --stdin grid
echo “oracle” | passwd --stdin oracle
mkdir -p /oracle/app/oracle/product/11.2.0/db_home
mkdir -p /oracle/app/oracle/oraInventory
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/grid/product/11.2.0/grid_home
mkdir -p /oracle/app/oraInventory
chown -R oracle:oinstall /oracle/
chown -R oracle:oinstall /oracle/app/oracle/oraInventory
chown -R grid:oinstall /oracle/app/grid/
chown -R grid:oinstall /oracle/app/oraInventory/
chown -R grid:oinstall /oracle/app/grid/product/11.2.0/grid_home
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle
– GRID 家目录
vi /home/grid/.bash_profile
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=PATH; export PATH
PATH=ORACLE_HOME/OPatch:ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
– ORACLE 家目录
vi /home/oracle/.bash_profile
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=PATH; export PATH
PATH=ORACLE_HOME/OPatch:ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
---- 关机添加4块固定大小的磁盘(一定要固定大小)添加之后重启虚拟机
ll /dev/sd* – 查看4块添加的硬盘名称
– 配置共享存储(根据上一步 ll /dev/sd* 四块硬盘名称 sdb,sdc,sdd,sde)
for i in b c d e;
do
echo “KERNEL==“sd*”, BUS==“scsi”, PROGRAM==”/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i", NAME=“asm-disk$i”, OWNER=“grid”, GROUP=“asmadmin”, MODE=“0660"” >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
/sbin/start_udev
[root@RAC ~]# ll /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Mar 12 16:05 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Mar 12 16:05 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Mar 12 16:05 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 64 Mar 12 16:05 /dev/asm-diske
看到上面的显示说明udev没有问题
---- GRID 和oracle数据安装文件(本实例放置在 /soft目录下)
[root@RAC ~]# ll /soft/
total 8
drwxrwxr-x 7 oracle oinstall 4096 Mar 12 09:05 database
drwxrwxr-x 7 grid oinstall 4096 Mar 12 09:06 grid
需要更改database 和grid 的属组和权限
chmod 775 database/ grid/ -R
chown grid:oinstall grid/ -R
chown oracle:oinstall database/ -R
---------------GRID响应文件设置
下面的脚本在grid用户下执行
cp /soft/grid/response/grid_install.rsp /soft/grid/response/grid_install.rsp.bak
根据需要修改响应文件
– 响应文件配置如下:
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=RAC
INVENTORY_LOCATION=/oracle/app/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=HA_CONFIG
ORACLE_BASE=/oracle/app/grid
ORACLE_HOME=/oracle/app/grid/product/11.2.0/grid_home
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=
oracle.install.crs.config.gpnp.scanPort=
oracle.install.crs.config.clusterName=
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=
oracle.install.crs.config.clusterNodes=
oracle.install.crs.config.networkInterfaceList=
oracle.install.crs.config.storageOption=
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=oracle
oracle.install.asm.diskGroup.name=DATADG
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/asm-diskb,/dev/asm-diskc
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*
oracle.install.asm.monitorPassword=oracle
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=0
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
查看响应文件
cat /soft/grid/response/grid_install.rsp | grep -v ^# | grep -v ^$
/soft/grid/runInstaller -silent -showProgress -ignoreSysPrereqs -ignorePrereq -responseFile /soft/grid/response/grid_install.rsp
--------------------执行结果
Starting Oracle Universal Installer…
Checking Temp space: must be greater than 120 MB. Actual 17941 MB Passed
Checking swap space: must be greater than 150 MB. Actual 5119 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-03-11_06-26-00PM. Please wait …[grid@db grid]$ [WARNING] [INS-30011] The SYS passwo
rd entered does not conform to the Oracle recommended standards. CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case charact
er and 1 digit [0-9]. ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case charact
er and 1 digit [0-9]. ACTION: Provide a password that conforms to the Oracle recommended standards.
You can find the log of this install session at:
/oracle/app/oraInventory/logs/installActions2020-03-11_06-26-00PM.log
Prepare in progress.
… 9% Done.
Prepare successful.
Copy files in progress.
… 14% Done.
… 21% Done.
… 26% Done.
… 31% Done.
… 36% Done.
… 42% Done.
… 50% Done.
… 56% Done.
… 61% Done.
… 66% Done.
… 71% Done.
…
Copy files successful.
Link binaries in progress.
…
Link binaries successful.
…
Setup files in progress.
… 76% Done.
… 89% Done.
Setup files successful.
The installation of Oracle Grid Infrastructure 11g was successful.
Please check ‘/oracle/app/oraInventory/logs/silentInstall2020-03-11_06-26-00PM.log’ for more details.
… 94% Done.
Execute Root Scripts in progress.
As a root user, execute the following script(s):
1. /oracle/app/oraInventory/orainstRoot.sh
2. /oracle/app/grid/product/11.2.0/grid_home/root.sh
… 100% Done.
Execute Root Scripts successful.
As install user, execute the following script to complete the configuration.
1. /oracle/app/grid/product/11.2.0/grid_home/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file>
Note:
1. This script must be run on the same host from where installer was run.
2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).
Successfully Setup Software.
打开新的窗口用root用户执行下面两个脚本
/oracle/app/oraInventory/orainstRoot.sh
/oracle/app/grid/product/11.2.0/grid_home/root.sh
在 grid 用户下面执行
vi /home/grid/cfgrsp.properties
oracle.assistants.asm|S_ASMPASSWORD=oracle
oracle.assistants.asm|S_ASMMONITORPASSWORD=oracle
/oracle/app/grid/product/11.2.0/grid_home/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties
crsctl status res
– 创建新的磁盘组
asmca -silent -configureASM -sysAsmPassword oracle -asmsnmpPassword oracle -diskGroupName DATAVG -diskList /dev/asm-diske,/dev/asm-diskd -redundancy NORMAL
[grid@cqdbsvr-c1 grid_home]$ netca -silent -responsefile /oracle/app/grid/product/11.2.0/grid_home/assistants/netca/netca.rsp
– 安装数据库
– 安装数据库软件
下面的脚本在Oracle用户下执行
– db_install.rsp 文件配置如下
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=RAC
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/oracle/app/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_home
ORACLE_BASE=/oracle/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,ora
cle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=900
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
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=ASM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=DATAVG
oracle.install.db.config.asm.ASMSNMPPassword=oracle
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
查看响应文件
cat /soft/grid/response/db_install.rsp | grep -v ^# | grep -v ^$
/soft/database/runInstaller -silent -showProgress -ignoreSysPrereqs -ignorePrereq -responseFile /soft/database/response/db_install.rsp
— 创建数据库(如果执行DBCA报错,可能是/oracle/app/oracle下面的两个文件没有ORACLE用户的写权限需要修改目录的执行权限)
chmod 775 /oracle/app/oracle -R
dbca -silent
-createDatabase
-asmsnmpPassword oracle
-characterSet AL32UTF8
-continueOnNonFatalErrors false
-disableSecurityConfiguration ALL
-diskGroupName DATAVG
-emConfiguration NONE
-gdbName orcl
-listeners LISTENER
-memoryPercentage 40
-recoveryAreaDestination DATAVG
-sid orcl
-sysPassword oracle
-systemPassword oracle
-storageType ASM
-sampleSchema true
-templateName General_Purpose.dbc




