rac install
来源:互联网 发布:javascript练手项目 编辑:程序博客网 时间:2024/05/18 08:47
Luocs Technology Blog
Oracle Database 11g R2 RAC 静默安装文档(Silent Installation Experiences with Oracle Database 11g R2 RAC on Linux)
前段时间有个朋友问我一般在生产怎么装Oracle,我当时就回答图形方式安装。他又紧接着问生产服务器很少装图形相关包吧,而且远程怎么装?我回答用Xmnager或者VNC。他说VNC的话会在服务端开启图形相关(Gnome或KDE)进程,我就说我觉得不应该那么在意这些,DBA只要有一套自己的处理模式就可以了,有些DBA选择Xmanager,甚至有些DBA会安装图形安装完Oracle RDBMS然后切换到字符模式,我也相信肯定有DBA在生产环境里使用过VNC,当然我们也可以选择静默方式来安装。
今天文章的主要内容就是静默安装,单实例数据库静默安装非常简单,不做实验,而选择Oracle DATABASE 11g R2 RAC来进行静默安装的实验。
Oracle RAC静默安装的资料非常少,更不用说详细的了,因此我在实验过程中遇到过各种各样的问题,我会在文章里指出。
我相信,有了这个文章,可以减少大家走很多弯路!
好,开始!
Oracle Database 11g R2 RAC 静默安装有如下步骤:
- 准备环境;
- 静默安装Grid Infrastructure;
- 创建ASM磁盘组;
- 静默安装Oracle RDBMS Software;
- DBCA静默创建数据库;
- 检查与后期完善。
1、准备环境
准备环境包括:
- 安装一台DNS、一台SAN、两台数据库节点服务器操作系统安装与配置;
- 配置DNS服务(scan解析);
- 划分LUN;
- RPM安装所需软件包;
- 满足RAC安装相关系统配置;
- 创建grid、oracle用户并授权;
- 创建所需目录并授权;
- 环境变量设置;
- iscsi挂载磁盘并分区格式化;
- ASMLIB驱动安装及创建ASM磁盘;
- NTP服务禁止;
- 上传介质并解压。
其中,数据库节点服务器和DNS服务器我都安装了Oracle Enterprise Linux 5.5 64bit,SAN服务器安装了Openfiler 2.3 64bit;
而数据库软件版本选择11.2.0.3。
准备环境部分可参考: 《Oracle Enterprise Linux 5.5(64位)部署安装Oracle 11g R2 RAC(11.2.0.1)教程》
我这里就PASS之。
2、静默安装Grid Infrastructure(Oracle Grid Infrastructure silent mode installation)
我将Oracle提供的模板复制加以修改之后使用,这些模板在GI和DATABASE解压之后根目录下的response里。
GI只有一个模板:grid_install.rsp
DATABASE有三个模板:db_install.rsp、netca.rsp、dbca.rsp
我不会详细解释模板里面的各项涵义,建议大家打开默认模板详细阅读。
[grid@rac1 response]$ pwd/install/grid/response[grid@rac1 response]$ vi grid_install.rsp[grid@rac1 response]$ cat grid_install.rsp | grep -v ^# | grep -v ^$ > /tmp/gi.rsp[grid@rac1 response]$ cat gi.rsp oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0ORACLE_HOSTNAME=rac1INVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=enoracle.install.option=CRS_CONFIGORACLE_BASE=/u01/app/gridORACLE_HOME=/u01/app/11.2.0/gridoracle.install.asm.OSDBA=asmdbaoracle.install.asm.OSOPER=asmoperoracle.install.asm.OSASM=asmadminoracle.install.crs.config.gpnp.scanName=scan.luocs.comoracle.install.crs.config.gpnp.scanPort=1521oracle.install.crs.config.clusterName=rac-clusteroracle.install.crs.config.gpnp.configureGNS=falseoracle.install.crs.config.gpnp.gnsSubDomain=oracle.install.crs.config.gpnp.gnsVIPAddress=oracle.install.crs.config.autoConfigureClusterNodeVIP=falseoracle.install.crs.config.clusterNodes=rac1:rac1-vip,rac2:rac2-viporacle.install.crs.config.networkInterfaceList=eth0:192.168.53.0:1,eth1:10.0.3.0:2oracle.install.crs.config.storageOption=ASM_STORAGEoracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=oracle.install.crs.config.useIPMI=falseoracle.install.crs.config.ipmi.bmcUsername=oracle.install.crs.config.ipmi.bmcPassword=oracle.install.asm.SYSASMPassword=Oracle_12345oracle.install.asm.diskGroup.name=CRSoracle.install.asm.diskGroup.redundancy=EXTERNALoracle.install.asm.diskGroup.AUSize=4oracle.install.asm.diskGroup.disks=/dev/oracleasm/disks/CRS1oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracleasm/disks/*oracle.install.asm.monitorPassword=Oracle_12345oracle.install.crs.upgrade.clusterNodes=oracle.install.asm.upgradeASM=falseoracle.installer.autoupdates.option=SKIP_UPDATESoracle.installer.autoupdates.downloadUpdatesLoc=AUTOUPDATES_MYORACLESUPPORT_USERNAME=AUTOUPDATES_MYORACLESUPPORT_PASSWORD=PROXY_HOST=PROXY_PORT=0PROXY_USER=PROXY_PWD=PROXY_REALM=
说明:11g图形安装的时候我们无法使用裸设备,Oracle从11g开始也不建议使用裸设备,而选择ASM。但静默安装的时候我们可以通过配置这个模板来使用裸设备,但因为我一直超级喜欢ASM也是ASM支持者,所以这里不做裸设备的实验。
注意:oracle.install.asm.OSDBA=,oracle.install.asm.OSOPER=,oracle.install.asm.OSASM= 这三项,如果全部设置为oinstall,会给出警告,下面详细解释。
oracle.install.asm.OSDBA=
oracle.install.asm.OSOPER=
oracle.install.asm.OSASM=
ASM database administrator (osdba) group
ASM instance administrator operator(osoper) group
ASM instance administrator (osasm) group
这里三个权限的选择很容易抛出点问题来,我之前全部设置为oinstall,结果执行runInstaller的时候提示警告,后期也因为这个有了点问题。
警告类似:
[WARNING] [INS-41809] Possible invalid choice for OSDBA Group.
CAUSE: The group name you selected as the OSDBA for ASM group is commonly used for Oracle Database administrator privileges.
ACTION: Oracle recommends that you designate asmdba as the OSDBA for ASM group, and that the group should not be the same group as an Oracle Database OSDBA group.
[WARNING] [INS-41812] OSOPER and OSASM are the same OS group.
CAUSE: The chosen values for OSOPER group and the chosen value for OSASM group are the same.
ACTION: Select an OS group that is unique for ASM administrators. The OSASM group should not be the same as the OS groups that grant privileges for Oracle ASM access, or for database administration.
参考了Maclean的《Oracle安装与操作系统用户组》,然后我就改成如下,问题也就解决。
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
先检测环境有没有配置准备完毕:
[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbosePerforming pre-checks for cluster services setup Checking node reachability...Check: Node reachability from node "rac1" Destination Node Reachable? ------------------------------------ ------------------------ rac2 yes rac1 yes Result: Node reachability check passed from node "rac1"Checking user equivalence...Check: User equivalence for user "grid" Node Name Status ------------------------------------ ------------------------ rac2 failed rac1 failed Result: PRVF-4007 : User equivalence check failed for user "grid"ERROR: User equivalence unavailable on all the specified nodesVerification cannot proceedPre-check for cluster services setup was unsuccessful on all the nodes.
– 这里遇到了些问题,网上查了一下这个错误,有如下解决方式:
# mkdir -p /usr/local/bin
# ln -s -f /usr/bin/ssh /usr/local/bin/ssh
# ln -s -f /usr/bin/scp /usr/local/bin/scp
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
但上面方法都无效,其实问题根源就是没有做SSH用户等效性配置。
Oracle从11g里可以在OUI图形安装过程中自动建立SSH用户等效性配置,但静默方式看来搞不定,我就尝试了手动建立方法。
手动建立SSH用户等效性配置方法玩过10g RAC的朋友都不陌生吧,我这里就只列出步骤:
节点1:# su - grid$ mkdir ~/.ssh$ chmod 700 ~/.ssh$ ssh-keygen -t rsaenterenterenter$ ssh-keygen -t dsaenterenterenter节点2:# su - grid$ mkdir ~/.ssh$ chmod 700 ~/.ssh$ ssh-keygen -t rsaenterenterenter$ ssh-keygen -t dsaenterenterenter节点1:$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys $ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysyesrac2的密码$ ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keysrac2的密码$ scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys手动执行测试:节点1:$ ssh rac1 date$ ssh rac2 date$ ssh rac1.luocs.com date$ ssh rac2.luocs.com date节点2:$ ssh rac1 date$ ssh rac2 date$ ssh rac1.luocs.com date$ ssh rac2.luocs.com date
重新进行CVU检测:
[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
……省略N个PASSED行
Check: Membership of user "grid" in group "dba"
Node Name User Exists Group Exists User in Group Status
—————- ———— ———— ———— —————-
rac2 yes yes no failed
rac1 yes yes no failed
Result: Membership check for user "grid" in group "dba" failed
……省略N个PASSED行
Pre-check for cluster services setup was unsuccessful on all the nodes.
– 有一个问题导致最后抛出了个unsuccessful问题,我以前也说过,这个CVU安装前检测只是一种参考,结果未必都要一个SUCCESSFUL,
你只要能够确信Failed项并不影响你的后续安装计划,那么你大可以忽略这个未成功的结果。
– 我能确信grid不在dba组也并不影响RAC的安装与使用,所以忽略之。
– 如果你想去除这个问题,用root用户在每个节点执行# gpasswd -a grid dba。
执行runInstaller
[grid@rac1 grid]$ ./runInstaller -ignorePrereq -silent -force -responseFile /tmp/gi.rspStarting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 25347 MB PassedChecking swap space: must be greater than 150 MB. Actual 3098 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2012-11-01_03-31-18AM. Please wait ...[grid@rac1 grid]$ You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2012-11-01_03-31-18AM.logThe installation of Oracle Grid Infrastructure was successful.Please check '/u01/app/oraInventory/logs/silentInstall2012-11-01_03-31-18AM.log' for more details.As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/11.2.0/grid/root.shExecute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [rac1, rac2]Execute /u01/app/11.2.0/grid/root.sh on the following nodes: [rac1, rac2]As install user, execute the following script to complete the configuration. 1. /u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands Note: 1. This script must be run on the same system 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.按照提示执行脚本节点1:[root@rac1 ~]# /u01/app/oraInventory/orainstRoot.shChanging permissions of /u01/app/oraInventory.Adding read,write permissions for group.Removing read,write,execute permissions for world.Changing groupname of /u01/app/oraInventory to oinstall.The execution of the script is complete.节点2:[root@rac2 ~]# /u01/app/oraInventory/orainstRoot.shChanging permissions of /u01/app/oraInventory.Adding read,write permissions for group.Removing read,write,execute permissions for world.Changing groupname of /u01/app/oraInventory to oinstall.The execution of the script is complete.节点1:[root@rac1 ~]# /u01/app/11.2.0/grid/root.shCheck /u01/app/11.2.0/grid/install/root_rac1.luocs.com_2012-11-01_03-41-30.log for the output of root script查看这个日志输出:[root@rac1 dbs]# cat /u01/app/11.2.0/grid/install/root_rac1.luocs.com_2012-11-01_03-41-30.logPerforming root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /u01/app/11.2.0/gridCreating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_paramsCreating trace directoryUser ignored Prerequisites during installationOLR initialization - successful root wallet root wallet cert root cert export peer wallet profile reader wallet pa wallet peer wallet keys pa wallet keys peer cert request pa cert request peer cert pa cert peer root cert TP profile reader root cert TP pa root cert TP peer pa cert TP pa peer cert TP profile reader pa cert TP profile reader peer cert TP peer user cert pa user certAdding Clusterware entries to inittabCRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeededCRS-2676: Start of 'ora.gipcd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.cssd' on 'rac1'CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'CRS-2676: Start of 'ora.diskmon' on 'rac1' succeededCRS-2676: Start of 'ora.cssd' on 'rac1' succeededASM created and started successfully.Disk Group CRS created successfully.clscfg: -install mode specifiedSuccessfully accumulated necessary OCR keys.Creating OCR keys for user 'root', privgrp 'root'..Operation successful.CRS-4256: Updating the profileSuccessful addition of voting disk 773f8f28fd984f00bf70c5b7b56228ae.Successfully replaced voting disk group with +CRS.CRS-4256: Updating the profileCRS-4266: Voting file(s) successfully replaced## STATE File Universal Id File Name Disk group-- ----- ----------------- --------- --------- 1. ONLINE 773f8f28fd984f00bf70c5b7b56228ae (/dev/oracleasm/disks/CRS1) [CRS]Located 1 voting disk(s).CRS-2672: Attempting to start 'ora.asm' on 'rac1'CRS-2676: Start of 'ora.asm' on 'rac1' succeededCRS-2672: Attempting to start 'ora.CRS.dg' on 'rac1'CRS-2676: Start of 'ora.CRS.dg' on 'rac1' succeededCRS-2672: Attempting to start 'ora.registry.acfs' on 'rac1'CRS-2676: Start of 'ora.registry.acfs' on 'rac1' succeededConfigure Oracle Grid Infrastructure for a Cluster ... succeeded节点2:[root@rac2 ~]# /u01/app/11.2.0/grid/root.shCheck /u01/app/11.2.0/grid/install/root_rac2.luocs.com_2012-11-01_03-52-03.log for the output of root script查看输出日志:[root@rac2 ~]# cat /u01/app/11.2.0/grid/install/root_rac2.luocs.com_2012-11-01_03-52-03.logPerforming root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /u01/app/11.2.0/gridCreating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_paramsCreating trace directoryUser ignored Prerequisites during installationOLR initialization - successfulAdding Clusterware entries to inittabCRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminatingAn active cluster was found during exclusive startup, restarting to join the clusterConfigure Oracle Grid Infrastructure for a Cluster ... succeeded
我参考的文档里说是会在ORACLE_HOME目录下生成名为“cfgrsp.properties”的文件,但我的环境里始终没有看到。
所以我就手动创建一个cfgrsp.properties文件:
[grid@rac1 ~]$ cd $ORACLE_HOME/cfgtoollogs[grid@rac1 cfgtoollogs]$ touch cfgrsp.properties然后填写口令内容:[grid@rac1 cfgtoollogs]$ cat cfgrsp.properties oracle.assistants.asm|S_ASMPASSWORD=Oracle_12345oracle.assistants.asm|S_ASMMONITORPASSWORD==Oracle_12345[root@rac1 ~]# whoamiroot[root@rac1 ~]# chmod 600 /u01/app/11.2.0/grid/cfgtoollogs/cfgrsp.properties 执行语句:[grid@rac1 cfgtoollogs]$ whoamigrid[grid@rac1 cfgtoollogs]$ pwd/u01/app/11.2.0/grid/cfgtoollogs[grid@rac1 cfgtoollogs]$ [grid@rac1 cfgtoollogs]$ ./configToolAllCommands RESPONSE_FILE=./cfgrsp.propertiesSetting the invPtrLoc to /u01/app/11.2.0/grid/oraInst.locperform - mode is starting for action: configureperform - mode finished for action: configureYou can see the log file: /u01/app/11.2.0/grid/cfgtoollogs/oui/configActions2012-10-31_06-38-03-PM.log查看日志:[root@rac1 ~]# cat /u01/app/11.2.0/grid/cfgtoollogs/oui/configActions2012-10-31_06-38-03-PM.log###################################################The action configuration is performing------------------------------------------------------The plug-in Update Inventory is running/u01/app/11.2.0/grid/oui/bin/runInstaller -nowait -noconsole -waitforcompletion -ignoreSysPrereqs -updateNodeList -silent CRS=true "CLUSTER_NODES={rac1,rac2}" ORACLE_HOME=/u01/app/11.2.0/grid Starting Oracle Universal Installer...Checking swap space: must be greater than 500 MB. Actual 3098 MB PassedThe inventory pointer is located at /etc/oraInst.locThe inventory is located at /u01/app/oraInventoryThe plug-in Update Inventory has successfully been performed------------------------------------------------------------------------------------------------------------The plug-in Oracle Net Configuration Assistant is runningParsing command line arguments: Parameter "orahome" = /u01/app/11.2.0/grid Parameter "orahnam" = Ora11g_gridinfrahome1 Parameter "instype" = typical Parameter "inscomp" = client,oraclenet,javavm,server Parameter "insprtcl" = tcp Parameter "cfg" = local Parameter "authadp" = NO_VALUE Parameter "responsefile" = /u01/app/11.2.0/grid/network/install/netca_typ.rsp Parameter "silent" = true Parameter "silent" = trueDone parsing command line arguments.Oracle Net Services Configuration:Profile configuration complete.Profile configuration complete.Listener "LISTENER" already exists.Oracle Net Services configuration successful. The exit code is 0The plug-in Oracle Net Configuration Assistant has successfully been performed------------------------------------------------------------------------------------------------------------The plug-in Automatic Storage Management Configuration Assistant is runningThe plug-in Automatic Storage Management Configuration Assistant has successfully been performed------------------------------------------------------------------------------------------------------------The plug-in Oracle Cluster Verification Utility is runningPerforming post-checks for cluster services setup Checking node reachability...Node reachability check passed from node "rac1"Checking user equivalence...User equivalence check passed for user "grid"Checking node connectivity...Checking hosts config file...Verification of the hosts config file successfulCheck: Node connectivity for interface "eth0"Node connectivity passed for interface "eth0"TCP connectivity check passed for subnet "192.168.53.0"Check: Node connectivity for interface "eth1"Node connectivity passed for interface "eth1"TCP connectivity check passed for subnet "10.0.3.0"Checking subnet mask consistency...Subnet mask consistency check passed for subnet "192.168.53.0".Subnet mask consistency check passed for subnet "10.0.3.0".Subnet mask consistency check passed.Node connectivity check passedChecking multicast communication...Checking subnet "192.168.53.0" for multicast communication with multicast group "230.0.1.0"...Check of subnet "192.168.53.0" for multicast communication with multicast group "230.0.1.0" passed.Checking subnet "10.0.3.0" for multicast communication with multicast group "230.0.1.0"...Check of subnet "10.0.3.0" for multicast communication with multicast group "230.0.1.0" passed.Check of multicast communication passed.Time zone consistency check passedChecking Oracle Cluster Voting Disk configuration...ASM Running check passed. ASM is running on all specified nodesOracle Cluster Voting Disk configuration check passedChecking Cluster manager integrity... Checking CSS daemon...Oracle Cluster Synchronization Services appear to be online.Cluster manager integrity check passedUDev attributes check for OCR locations started...UDev attributes check passed for OCR locations UDev attributes check for Voting Disk locations started...UDev attributes check passed for Voting Disk locations Default user file creation mask check passedChecking cluster integrity...Cluster integrity check passedChecking OCR integrity...Checking the absence of a non-clustered configuration...All nodes free of non-clustered, local-only configurationsASM Running check passed. ASM is running on all specified nodesChecking OCR config file "/etc/oracle/ocr.loc"...OCR config file "/etc/oracle/ocr.loc" check successfulDisk group for ocr location "+CRS" available on all the nodesNOTE: This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.OCR integrity check passedChecking CRS integrity...Clusterware version consistency passedCRS integrity check passedChecking node application existence...Checking existence of VIP node application (required)VIP node application check passedChecking existence of NETWORK node application (required)NETWORK node application check passedChecking existence of GSD node application (optional)GSD node application is offline on nodes "rac2,rac1"Checking existence of ONS node application (optional)ONS node application check passedChecking Single Client Access Name (SCAN)...Checking TCP connectivity to SCAN Listeners...TCP connectivity to SCAN Listeners exists on all cluster nodesChecking name resolution setup for "scan.luocs.com"...Verification of SCAN VIP and Listener setup passedChecking OLR integrity...Checking OLR config file...OLR config file check successfulChecking OLR file attributes...OLR file check successfulWARNING: This check does not verify the integrity of the OLR contents. Execute 'ocrcheck -local' as a privileged user to verify the contents of OLR.OLR integrity check passedOCR detected on ASM. Running ACFS Integrity checks...Starting check to see if ASM is running on all cluster nodes...ASM Running check passed. ASM is running on all specified nodesStarting Disk Groups check to see if at least one Disk Group configured...Disk Group Check passed. At least one Disk Group configuredTask ACFS Integrity check passedUser "grid" is not part of "root" group. Check passedChecking if Clusterware is installed on all nodes...Check of Clusterware install passedChecking if CTSS Resource is running on all nodes...CTSS resource check passedQuerying CTSS for time offset on all nodes...Query of CTSS for time offset passedCheck CTSS state started...CTSS is in Active state. Proceeding with check of clock time offsets on all nodes...Check of clock time offsets passedOracle Cluster Time Synchronization Services check passedChecking VIP configuration.Checking VIP Subnet configuration.Check for VIP Subnet configuration passed.Checking VIP reachabilityCheck for VIP reachability passed.Post-check for cluster services setup was successful. The plug-in Oracle Cluster Verification Utility has successfully been performed------------------------------------------------------The action configuration has successfully completed###################################################
扩展内容:
这里我刚开始做的时候没有加上cfgrsp.properties,直接运行./configToolAllCommands,结果没有创建ASM口令文件。
[root@rac1 ~]# cd /u01/app/11.2.0/grid/dbs/
[root@rac1 dbs]# ls
ab_+ASM1.dat hc_+ASM1.dat init.ora
然后我手动创建个:
节点1:
[root@rac1 ~]# su – grid
[grid@rac1 ~]$ cd $ORACLE_HOME/dbs
[grid@rac1 dbs]$ orapwd file='orapw+ASM' entries=5 password=Oracle_12345
节点2:
[root@rac2 ~]# su – grid
[grid@rac2 ~]$ cd $ORACLE_HOME/dbs
[grid@rac2 dbs]$ orapwd file='orapw+ASM' entries=5 password=Oracle_12345
但最后依然遇到了些问题,所以这个步骤上务必带上cfgrsp.properties项。
简单检测:
看CRS服务资源状态:[grid@rac1 grid]$ crs_stat -tName Type Target State Host ------------------------------------------------------------ora.CRS.dg ora....up.type ONLINE ONLINE rac1 ora....ER.lsnr ora....er.type ONLINE ONLINE rac1 ora....N1.lsnr ora....er.type ONLINE ONLINE rac2 ora....N2.lsnr ora....er.type ONLINE ONLINE rac1 ora....N3.lsnr ora....er.type ONLINE ONLINE rac1 ora.asm ora.asm.type ONLINE ONLINE rac1 ora.cvu ora.cvu.type ONLINE ONLINE rac1 ora.gsd ora.gsd.type OFFLINE OFFLINE ora....network ora....rk.type ONLINE ONLINE rac1 ora.oc4j ora.oc4j.type ONLINE ONLINE rac1 ora.ons ora.ons.type ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application OFFLINE OFFLINE ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip ora....t1.type ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application OFFLINE OFFLINE ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip ora....t1.type ONLINE ONLINE rac2 ora....ry.acfs ora....fs.type ONLINE ONLINE rac1 ora.scan1.vip ora....ip.type ONLINE ONLINE rac2 ora.scan2.vip ora....ip.type ONLINE ONLINE rac1 ora.scan3.vip ora....ip.type ONLINE ONLINE rac1 继续执行几个命令来确保集群服务的启动情况[grid@rac1 grid]$ crsctl stat res -t--------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.registry.acfs ONLINE ONLINE rac1 ONLINE ONLINE rac2 --------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.scan1.vip 1 ONLINE ONLINE rac2 ora.scan2.vip 1 ONLINE ONLINE rac1 ora.scan3.vip 1 ONLINE ONLINE rac1 [grid@rac1 grid]$ crsctl stat res -t -init--------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS --------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.asm 1 ONLINE ONLINE rac1 Started ora.cluster_interconnect.haip 1 ONLINE ONLINE rac1 ora.crf 1 ONLINE ONLINE rac1 ora.crsd 1 ONLINE ONLINE rac1 ora.cssd 1 ONLINE ONLINE rac1 ora.cssdmonitor 1 ONLINE ONLINE rac1 ora.ctssd 1 ONLINE ONLINE rac1 ACTIVE:0 ora.diskmon 1 OFFLINE OFFLINE ora.drivers.acfs 1 ONLINE ONLINE rac1 ora.evmd 1 ONLINE ONLINE rac1 ora.gipcd 1 ONLINE ONLINE rac1 ora.gpnpd 1 ONLINE ONLINE rac1 ora.mdnsd 1 ONLINE ONLINE rac1 [grid@rac1 grid]$ crsctl check cluster -all**************************************************************rac1:CRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online**************************************************************rac2:CRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online**************************************************************
OK,非常顺利,到此GI成功安装完毕!
3、创建ASM磁盘组
我们目前只创建了OCRVOTE ASM磁盘组,其实我们可以使用ASMCA图形方式很方便容易地创建其他ASM磁盘,ASMCA也提供了静默方式,请参考MOS ID 1068788.1。
[root@rac1 ~]# oracleasm listdisksARCHCRS1CRS2DATAMYDATA[grid@rac1 ~]$ asmca -silent -configureASM -sysAsmPassword Oracle_12345 -asmsnmpPassword Oracle_12345 -diskString '/dev/oracleasm/disks/*' -diskGroupName MYDATA -disk '/dev/oracleasm/disks/MYDATA' -redundancy EXTERNAL
当然我们也可以使用命令来创建其他ASM磁盘组,参考下面我的操作:
SQL> set pagesize 9999SQL> set line 130SQL> col NAME for a20SQL> select name,type,state,total_mb,free_mb from v$asm_diskgroup;NAME TYPE STATE TOTAL_MB FREE_MB-------------------- ------------ ---------------------- ---------- ----------OCRVOTE EXTERN MOUNTED 1012 580-- 可见当前只有OCRVOTE磁盘组SQL> col FAILGROUP for a30SQL> col PATH for a40SQL> select name, failgroup, path, disk_number from v$asm_disk;NAME FAILGROUP PATH DISK_NUMBER-------------------- ------------------------------ ---------------------------------------- ----------- /dev/oracleasm/disks/MYDATA 0 /dev/oracleasm/disks/ARCH 2OCRVOTE_0000 OCRVOTE_0000 /dev/oracleasm/disks/MYCRS 0-- 这里还有/dev/oracleasm/disks/MYDATA和/dev/oracleasm/disks/ARCH磁盘组。SQL> create diskgroup MYDATA external redundancy disk '/dev/oracleasm/disks/MYDATA';Diskgroup created.SQL> select name,type,state,total_mb,free_mb from v$asm_diskgroup;NAME TYPE STATE TOTAL_MB FREE_MB-------------------- ------------ ---------------------- ---------- ----------OCRVOTE EXTERN MOUNTED 1012 580MYDATA EXTERN MOUNTED 5962 5912-- OK,加载进来了,但这不表示其他节点也加载进来了。SQL> select name,type,state,total_mb,free_mb from gv$asm_diskgroup;NAME TYPE STATE TOTAL_MB FREE_MB-------------------- ------------ ---------------------- ---------- ----------OCRVOTE EXTERN MOUNTED 1012 580MYDATA EXTERN MOUNTED 5962 5912OCRVOTE EXTERN MOUNTED 1012 580MYDATA DISMOUNTED 0 0-- 第二个节点MYDATE磁盘组状态为DISMOUNTED。节点2:[root@rac2 ~]# su - grid[grid@rac2 ~]$ sqlplus / as sysasmSQL> alter diskgroup mydata mount;Diskgroup altered.节点1:SQL> select name,type,state,total_mb,free_mb from gv$asm_diskgroup;NAME TYPE STATE TOTAL_MB FREE_MB-------------------- ------------ ---------------------- ---------- ----------OCRVOTE EXTERN MOUNTED 1012 580MYDATA EXTERN MOUNTED 5962 5869OCRVOTE EXTERN MOUNTED 1012 580MYDATA EXTERN MOUNTED 5962 5869-- OK已经都加载了。
4、静默安装RDBMS Softwar
首先,做SSH用户等效性配置,这里操作略。
依然进行CVU检测
[root@rac1 ~]# su – grid
[grid@rac1 ~]$ cd /install/grid/
[grid@rac1 grid]$ ./runcluvfy.sh stage -pre dbinst -n rac1,rac2 -r 11gR2 -verbose
……省略N个PASSED行
Check: Membership of user "grid" in group "dba"
Node Name User Exists Group Exists User in Group Status
—————- ———— ———— ———— —————-
rac2 yes yes no failed
rac1 yes yes no failed
Result: Membership check for user "grid" in group "dba" failed
……省略N个PASSED行
– 依然是同样的问题,这里忽略之
这次我使用database目录下的db_install.rsp
[oracle@rac1 response]$ vi db_install.rsp编辑之后[oracle@rac1 response]$ cat db_install.rsp | grep -v ^# | grep -v ^$ > /tmp/db_install.rsp[oracle@rac1 database]$ cat /tmp/db_install.rsp oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0oracle.install.option=INSTALL_DB_AND_CONFIGORACLE_HOSTNAME=rac1UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=enORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=oracle.install.db.EEOptionsSelection=falseoracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=operoracle.install.db.CLUSTER_NODES=rac1,rac2oracle.install.db.isRACOneInstall=oracle.install.db.racOneServiceName=oracle.install.db.config.starterdb.type=GENERAL_PURPOSEoracle.install.db.config.starterdb.globalDBName=www.luocs.comoracle.install.db.config.starterdb.SID=luocsoracle.install.db.config.starterdb.characterSet=AL32UTF8oracle.install.db.config.starterdb.memoryOption=trueoracle.install.db.config.starterdb.memoryLimit=700oracle.install.db.config.starterdb.installExampleSchemas=tureoracle.install.db.config.starterdb.enableSecuritySettings=falseoracle.install.db.config.starterdb.password.ALL=Oracle12345oracle.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_CONTROLoracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=oracle.install.db.config.starterdb.automatedBackup.enable=falseoracle.install.db.config.starterdb.automatedBackup.osuid=oracle.install.db.config.starterdb.automatedBackup.ospwd=oracle.install.db.config.starterdb.storageType=ASM_STORAGEoracle.install.db.config.starterdb.fileSystemStorage.dataLocation=oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=oracle.install.db.config.asm.diskGroup=MYDATAoracle.install.db.config.asm.ASMSNMPPassword=Oracle12345MYORACLESUPPORT_USERNAME=MYORACLESUPPORT_PASSWORD=SECURITY_UPDATES_VIA_MYORACLESUPPORT=falseDECLINE_SECURITY_UPDATES=truePROXY_HOST=PROXY_PORT=PROXY_USER=PROXY_PWD=PROXY_REALM=COLLECTOR_SUPPORTHUB_URL=oracle.installer.autoupdates.option=SKIP_UPDATESoracle.installer.autoupdates.downloadUpdatesLoc=AUTOUPDATES_MYORACLESUPPORT_USERNAME=AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
说明:这里我们采用仅安装RDBMS Software only,但我建议其他参数也最好配置上,免得出现Warning。
另外ORACLE_HOME我们需要注意一下,我们在图形方式安装的时候只要创建ORACLE_BASE目录即可,家目录会自动创建,但静默方式不可以。
我们先检查一下:
节点1:[root@rac1 ~]# su - oracle[oracle@rac1 ~]$ echo $ORACLE_HOME/u01/app/oracle/product/11.2.0/dbhome_1[oracle@rac1 ~]$ ls $ORACLE_HOMEls: /u01/app/oracle/product/11.2.0/dbhome_1: No such file or directory-- 可见这个目录尚不存在,下面创建个[oracle@rac1 ~]$ mkdir $ORACLE_BASE/product/11.2.0/dbhome_1 -p节点2:[root@rac2 ~]# su - oracle[oracle@rac2 ~]$ mkdir $ORACLE_BASE/product/11.2.0/dbhome_1 -p
开始执行runInstaller:
[oracle@rac1 database]$ ./runInstaller -ignorePrereq -silent -force -responseFile /tmp/db_install.rspStarting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 21986 MB PassedChecking swap space: must be greater than 150 MB. Actual 3098 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2012-11-01_05-01-59AM. Please wait ...[oracle@rac1 database]$ You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2012-11-01_05-01-59AM.logThe installation of Oracle Database 11g was successful.Please check '/u01/app/oraInventory/logs/silentInstall2012-11-01_05-01-59AM.log' for more details.As a root user, execute the following script(s): 1. /u01/app/oracle/product/11.2.0/dbhome_1/root.shExecute /u01/app/oracle/product/11.2.0/dbhome_1/root.sh on the following nodes: [rac1, rac2]Successfully Setup Software.在两个节点执行脚本:节点1:[root@rac1 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.shCheck /u01/app/oracle/product/11.2.0/dbhome_1/install/root_rac1.luocs.com_2012-11-01_05-15-34.log for the output of root script输出的日志:[root@rac1 ~]# cat /u01/app/oracle/product/11.2.0/dbhome_1/install/root_rac1.luocs.com_2012-11-01_05-15-34.logPerforming root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions.节点2:[root@rac2 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.shCheck /u01/app/oracle/product/11.2.0/dbhome_1/install/root_rac2.luocs.com_2012-11-01_05-16-06.log for the output of root script输出的日志:[root@rac2 ~]# cat /u01/app/oracle/product/11.2.0/dbhome_1/install/root_rac2.luocs.com_2012-11-01_05-16-06.logPerforming root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions.
OK,到这里Oracle RDBMS Software已经安装完毕!
5、DBCA静默创建数据库
参考官方联机文档,执行如下语句
[oracle@rac1 ~]$ $ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName www.luocs.com -sid luocs -sysPassword oracle_12345 -systemPassword oracle_12345 -storageType ASM -diskGroupName MYDATA -datafileJarLocation $ORACLE_HOME/assistants/dbca/templates -nodeinfo rac1,rac2 -characterset AL32UTF8 -obfuscatedPasswords false -sampleSchema false -asmSysPassword Oracle_12345Copying database files1% complete3% complete9% complete15% complete21% complete27% complete30% completeCreating and starting Oracle instance32% complete36% complete40% complete44% complete45% complete48% complete50% completeCreating cluster database views52% complete70% completeCompleting Database Creation73% complete76% complete85% complete94% complete100% completeLook at the log file "/u01/app/oracle/cfgtoollogs/dbca/www/www.log" for further details.查看日志信息:[oracle@rac1 ~]$ cat /u01/app/oracle/cfgtoollogs/dbca/www/www.logCopying database filesDBCA_PROGRESS : 1%DBCA_PROGRESS : 3%DBCA_PROGRESS : 9%DBCA_PROGRESS : 15%DBCA_PROGRESS : 21%DBCA_PROGRESS : 27%DBCA_PROGRESS : 30%Creating and starting Oracle instanceDBCA_PROGRESS : 32%DBCA_PROGRESS : 36%DBCA_PROGRESS : 40%DBCA_PROGRESS : 44%DBCA_PROGRESS : 45%DBCA_PROGRESS : 48%DBCA_PROGRESS : 50%Creating cluster database viewsDBCA_PROGRESS : 52%DBCA_PROGRESS : 70%Completing Database CreationDBCA_PROGRESS : 73%DBCA_PROGRESS : 76%DBCA_PROGRESS : 85%DBCA_PROGRESS : 94%DBCA_PROGRESS : 100%Database creation complete. For details check the logfiles at: /u01/app/oracle/cfgtoollogs/dbca/www.Database Information:Global Database Name:www.luocs.comSystem Identifier(SID) Prefix:luocs
OK,至此数据库创建完毕!
6、检查与后期完善
[root@rac1 ~]# su - grid[grid@rac1 ~]$ crs_stat -tName Type Target State Host ------------------------------------------------------------ora.CRS.dg ora....up.type ONLINE ONLINE rac1 ora....ER.lsnr ora....er.type ONLINE ONLINE rac1 ora....N1.lsnr ora....er.type ONLINE ONLINE rac2 ora....N2.lsnr ora....er.type ONLINE ONLINE rac1 ora....N3.lsnr ora....er.type ONLINE ONLINE rac1 ora.MYDATA.dg ora....up.type ONLINE ONLINE rac1 ora.asm ora.asm.type ONLINE ONLINE rac1 ora.cvu ora.cvu.type ONLINE ONLINE rac1 ora.gsd ora.gsd.type OFFLINE OFFLINE ora....network ora....rk.type ONLINE ONLINE rac1 ora.oc4j ora.oc4j.type ONLINE ONLINE rac1 ora.ons ora.ons.type ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application OFFLINE OFFLINE ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip ora....t1.type ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application OFFLINE OFFLINE ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip ora....t1.type ONLINE ONLINE rac2 ora....ry.acfs ora....fs.type ONLINE ONLINE rac1 ora.scan1.vip ora....ip.type ONLINE ONLINE rac2 ora.scan2.vip ora....ip.type ONLINE ONLINE rac1 ora.scan3.vip ora....ip.type ONLINE ONLINE rac1 ora.www.db ora....se.type ONLINE ONLINE rac1 [oracle@rac1 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 1 05:34:36 2012Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> select * from global_name;GLOBAL_NAME--------------------------------------------------------------------------------WWW.LUOCS.COMSQL> select instance_name, status from gv$instance;INSTANCE_NAME STATUS-------------------------------- ------------------------luocs1 OPENluocs2 OPENSQL> archive log listDatabase log mode No Archive ModeAutomatic archival DisabledArchive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/archOldest online log sequence 3Current log sequence 4
我们就简单检查这些,然后我们后期完善一下,比如开启归档、开启闪回恢复区、添加日志组与日志成员并调整大小、配置客户端等一系列操作,这里并不记录。
最后,在生产应用之前,请务必在测试环境操作一遍!
参考文章:
- Silent Installation Experiences with Oracle Database 11g R2 Real Application Clusters on Linux on System
- How to use ASMCA in silent mode to configure ASM for a stand-alone server [ID 1068788.1]
- Using DBCA Noninteractive (Silent) Configuration for Oracle RAC
- Oracle安装与操作系统用户组
- rac install
- AIX install RAC 看不到节点
- oracle 11g r2 Rac install
- oracle 11gR2 11.2.0.3 RAC install
- Install Goldengate On Oracle Rac 11.2.0.4
- ORACLE-12C-RAC INSTALL
- 11g RAC INSTALL 准备工作part1
- 11g RAC INSTALL 准备工作part2
- step by step install Oracle RAC on AIX
- 我的ORACLE RAC INSTALL for LINUX 10.2研究
- Oracle 11.2.0.3.0 RAC Silent Install-3Nodes
- error about Oracle 11g R2 RAC install at vmware
- 在安装oracle rac 的时候报错误 install/.oui:
- Oracle Study之--Oracle 12c RAC install (一)
- Oracle Study之--Oracle 12c RAC install (二)
- AIX 5.3 Install Oracle 10g RAC 错误集锦--9i RAC present
- RAC
- rac
- 黑马程序员--------方法和数组
- find命令详解
- [A-II] STM3210xxx JTAG接口电路
- android 水波进度条WaveViewProgressBar
- (二)洞悉linux下的Netfilter&iptables:内核中的ip_tables小觑
- rac install
- Android Gallery实现3D相册(附效果图+Demo源码)
- solr中加入2种常见的中文分词器
- IE11的内核不是FF(Gecko(Firefox内核))内核哦..
- WCE or Mobile sqlite 配置使用
- 看图故事轻松理解数字签名、数字证书、公钥、私钥
- java 流
- C++笔试题目
- (三)洞悉linux下的Netfilter&iptables:内核中的rule,match和target