RAC集群静默安装:

前面环境变量等配置同图形安装文档一样。
GRID:
BASE:/u01/app/grid
HOME:/u01/grid/11.2.0.4/

ORACLE:
BASE:/u01/app/oracle
HOME:/u01/app/oracle/product/11.2.0.4/db_1

一、grid

安装之前使用脚本进行校验,确保所有的 failed 选项都可以忽略。
./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose

在 2 个节点上新建/etc/oraInst.loc,文件中的内容如下
vi /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

输入下面的命令在 oraInst.loc 文件上设置合适的拥有者,组和权限:
chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc

/u01/app/oraInventory 的目录必须为空
ls -l /u01/app/oraInventory/*
rm -rf /u01/app/oraInventory/*

vi /home/grid/grid_install.rsp
静默脚本:
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=rac1
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/grid/11.2.0.4
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=racscanip
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.clusterName=rac-cluster
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=rac1:rac1vip,rac2:rac2vip
oracle.install.crs.config.networkInterfaceList=eth0:192.168.0.0:1,eth1:192.168.178.0:2
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=EXTERNAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=EXTERNAL
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=EXTERNAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/mapper/OCR
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/mapper/*
oracle.install.asm.monitorPassword=oracle123
oracle.install.crs.upgrade.clusterNodes=
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=

请使用grid用户在节点1(rac1)上执行以下命令

chmod 775 /home/grid/grid_install.rsp
/u01/grid/runInstaller -ignorePrereq -silent -force -responseFile /home/grid/grid_install.rsp -showProgress

安装完成后,执行脚本:

/u01/grid/11.2.0.4/root.sh     //双节点操作

crsctl stat res -t   //检查

/u01/grid/11.2.0.4/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/grid_install.rsp
Setting the invPtrLoc to /u01/grid/11.2.0.4/oraInst.loc     //单节点执行,即跑脚本的执行

crsctl stat res -t  //检查,多了监听配置

二、ORACLE

首先以 grid 用户运行如下的命令进行检查环境配置:
/u01/grid/runcluvfy.sh stage -pre dbinst -n rac1,rac2 -verbose -fixup

vi /home/oracle/db_install.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=rac1
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/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=rac1,rac2
oracle.install.db.isRACOneInstall=false
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=racdb
oracle.install.db.config.starterdb.SID=racdb1
oracle.install.db.config.starterdb.characterSet=AL32UTF8
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=false
oracle.install.db.config.starterdb.password.ALL=oracle123
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=oracle123
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=SKIP_UPDATES
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

chmod 775 /home/oracle/db_install.rsp
/u01/database/runInstaller -ignorePrereq -silent -force -noconfig -responseFile /home/oracle/db_install.rsp  -showProgress

所有节点跑脚本,并查看日志检查:
/u01/app/oracle/product/11.2.0.4/db_1/root.sh

三、手工建立磁盘组

col name format a10
set line 9999
col path format a15
select GROUP_NUMBER,path,name,disk_number,total_mb,free_mb,CREATE_DATE,MOUNT_STATUS,MOUNT_DATE
from v$asm_disk order by GROUP_NUMBER desc,disk_number;

select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;

CREATE DISKGROUP DATA external REDUNDANCY disk '/dev/mapper/DATA' ATTRIBUTE 'au_size'='1M', 'compatible.asm' = '11.2';

节点2挂载:
alter diskgroup DATA mount;

四、服务器重启,设置集群服务跟随开机启动

reboot

vi /etc/inittab
h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null

五、创建数据库(有点问题,后续有用到改)-->静默DBCA

dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
-gdbname mydb -sid mydb \
-sysPassword oracle -systemPassword oracle \
-datafileDestination 'DATA/' -recoveryAreaDestination 'FRA/' \
-redoLogFileSize 50 \
-storageType ASM -asmsnmpPassword oracle -diskGroupName 'DATA' \
-characterset AL32UTF8 -nationalCharacterSet AL16UTF16 \
-sampleSchema true \
-automaticMemoryManagement true -totalMemory 2048 \
-databaseType OLTP \
-emConfiguration NONE \
-nodeinfo NODE1,NODE2

六、手工建库

h```sql
ttp://blog.itpub.net/26736162/viewspace-2121981/

Related Posts