Oracle 12cR1 RAC 在VMware Workstation上安装(下)—静默安装
1.1 静默安装
1.1.1 静默安装grid
安装之前使用脚本进行校验,确保所有的failed选项都可以忽略。
./runcluvfy.sh stage -pre crsinst -n raclhr-12cR1-N1,raclhr-12cR1-N2 -fixup -verbose |
1.1.1.1 新建/etc/oraInst.loc文件
在2个节点上新建/etc/oraInst.loc,文件中的内容如下:
inventory_loc=/u01/app/oraInventory inst_group=oinstall |
输入下面的命令在oraInst.loc文件上设置合适的拥有者,组和权限:
chown oracle:oinstall /etc/oraInst.loc chmod 664 /etc/oraInst.loc |
1.1.1.2 检查项
1、/u01/app/oraInventory必须为空
ls -l /u01/app/oraInventory/* rm -rf /u01/app/oraInventory/* |
否则报错:
[FATAL] [INS-32035] Unable to create a new central inventory directory : /u01/app/oraInventory. CAUSE: The central inventory location provided is not empty. ACTION: Please provide another location for the inventory, or clean up the current location. |
2、INS-32040
[FATAL] [INS-32040] The central inventory location provided is not empty on remote nodes [raclhr-12cr1-n1]. ACTION: Please provide another location for the inventory, or clean up the current location.
|
解决办法:
新建/etc/oraInst.loc,文件中的内容如下:
inventory_loc=/u01/app/oraInventory inst_group=oinstall |
输入下面的命令在oraInst.loc文件上设置合适的拥有者,组和权限:
chown oracle:oinstall /etc/oraInst.loc chmod 664 /etc/oraInst.loc |
1.1.1.3 开始安装
静默脚本:
./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ ORACLE_BASE=/u01/app/grid \ ORACLE_HOME=/u01/app/12.1.0/grid \ oracle.install.asm.OSDBA=asmdba \ oracle.install.asm.OSOPER=asmoper \ oracle.install.asm.OSASM=asmadmin \ oracle.install.crs.config.storageOption=ASM_STORAGE \ oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=EXTERNAL \ oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=EXTERNAL \ oracle.install.crs.config.useIPMI=false \ oracle.install.asm.diskGroup.name=OCR \ oracle.install.asm.diskGroup.redundancy=EXTERNAL \ oracle.installer.autoupdates.option=SKIP_UPDATES \ oracle.install.crs.config.gpnp.scanPort=1521 \ oracle.install.crs.config.gpnp.configureGNS=false \ oracle.install.crs.config.autoConfigureClusterNodeVIP=false \ oracle.install.option=CRS_CONFIG \ oracle.install.crs.config.ClusterType=STANDARD \ oracle.install.asm.SYSASMPassword=lhr \ oracle.install.asm.monitorPassword=lhr \ oracle.install.config.managementOption=NONE \ oracle.install.crs.config.ignoreDownNodes=false \ oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm-disk* \ oracle.install.asm.diskGroup.disks=/dev/asm-diskc \ oracle.install.crs.config.gpnp.scanName=raclhr-12cR1-scan \ oracle.install.crs.config.clusterName=raclhr-cluster \ oracle.install.crs.config.clusterNodes=raclhr-12cr1-n1:raclhr-12cr1-n1-vip,raclhr-12cr1-n2:raclhr-12cr1-n2-vip \ oracle.install.crs.config.networkInterfaceList=eth0:192.168.59.0:1,eth1:192.168.2.0:2 \ ORACLE_HOSTNAME=raclhr-12cR1-N1
|
命令行模式执行静默安装,注意复制脚本的时候最后不能多加回车符号,当前窗口不要执行其他内容。“\”后不能有空格。开始执行有点慢,需要修改的地方我已经用黄色背景标注了。若有其他错误可以采用-debug模式获取更多信息。
二、 configToolAllCommands脚本
关于该部分可参考:http://blog.itpub.net/26736162/viewspace-2129161/。该脚本执行完毕会创建一个sid为-MGMTDB,gdbName为_mgmtdb的单实例容器数据库(从日志可以找到相关命令:/u01/app/12.1.0/grid/bin/dbca -silent -createDatabase -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType ASM -diskGroupName OCR -datafileJarLocation /u01/app/12.1.0/grid/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck -oui_internal)该数据库属于grid用户。
/u01/app/12.1.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties |
根据官方文档内容,安装GRID可以配置如下的信息:
oracle.assistants.asm|S_ASMPASSWORD=password oracle.assistants.asm|S_ASMMONITORPASSWORD=password oracle.crs|S_BMCPASSWORD=password |
以grid用户在节点1上执行(准确来说应该在执行静默安装的节点上执行,且节点2上不需要执行):
[grid@raclhr-12cR1-N1 ~]$ more /home/grid/cfgrsp.properties oracle.assistants.asm|S_ASMPASSWORD=lhr oracle.assistants.asm|S_ASMMONITORPASSWORD=lhr oracle.crs|S_BMCPASSWORD=lhr [grid@raclhr-12cR1-N1 ~]$ /u01/app/12.1.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties [grid@raclhr-12cR1-N1 admin]$ /u01/app/12.1.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties Setting the invPtrLoc to /u01/app/12.1.0/grid/oraInst.loc
perform - mode is starting for action: configure
perform - mode finished for action: configure
You can see the log file: /u01/app/12.1.0/grid/cfgtoollogs/oui/configActions2017-01-17_05-29-38-PM.log [grid@raclhr-12cR1-N1 admin]$ [grid@raclhr-12cR1-N1 admin]$
|
1.1.2 静默安装database
首先通过如下的命令进行检查环境配置:
/soft/grid/runcluvfy.sh stage -pre dbinst -n raclhr-12cR1-N1,raclhr-12cR1-N2 -verbose -fixup |
1.1.2.1 静默安装DB软件
./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ oracle.install.option=INSTALL_DB_SWONLY \ DECLINE_SECURITY_UPDATES=true \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ oracle.install.db.InstallEdition=EE \ oracle.install.db.isCustomInstall=false \ oracle.install.db.EEOptionsSelection=false \ oracle.install.db.DBA_GROUP=dba \ oracle.install.db.OPER_GROUP=asmoper \ oracle.install.db.isRACOneInstall=false \ oracle.install.db.BACKUPDBA_GROUP=dba \ oracle.install.db.DGDBA_GROUP=dba \ oracle.install.db.KMDBA_GROUP=dba \ oracle.install.db.rac.serverpoolCardinality=0 \ oracle.install.db.ConfigureAsContainerDB=false \ oracle.install.db.config.starterdb.memoryOption=false \ oracle.install.db.config.starterdb.installExampleSchemas=true \ oracle.install.db.config.starterdb.managementOption=DEFAULT \ oracle.install.db.config.starterdb.enableRecovery=false \ oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \ SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \ oracle.installer.autoupdates.option=SKIP_UPDATES \ ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 \ ORACLE_BASE=/u01/app/oracle \ oracle.install.db.CLUSTER_NODES=raclhr-12cr1-n1,raclhr-12cr1-n2 \ ORACLE_HOSTNAME=raclhr-12cR1-N1 |
命令行模式执行静默安装,注意复制脚本的时候最后不能多加回车符号,当前窗口不要执行其他内容。“\”后不能有空格。开始执行有点慢,需要修改的地方我已经用黄色背景标注了。若有其他错误可以采用-debug模式获取更多信息。
[oracle@raclhr-12cR1-N1 ~]$ cd /soft/database/ [oracle@raclhr-12cR1-N1 database]$ ll total 72 drwxr-xr-x 4 root root 4096 Jan 16 17:04 install -rwxr-xr-x 1 root root 34132 Jul 11 2014 readme.html drwxrwxr-x 2 root root 4096 Jul 7 2014 response drwxr-xr-x 2 root root 4096 Jul 7 2014 rpm -rwxr-xr-x 1 root root 8533 Jul 7 2014 runInstaller drwxrwxr-x 2 root root 4096 Jul 7 2014 sshsetup drwxr-xr-x 14 root root 4096 Jul 7 2014 stage -rwxr-xr-x 1 root root 500 Feb 7 2013 welcome.html [oracle@raclhr-12cR1-N1 database]$ ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ > oracle.install.option=INSTALL_DB_SWONLY \ > DECLINE_SECURITY_UPDATES=true \ > UNIX_GROUP_NAME=oinstall \ > INVENTORY_LOCATION=/u01/app/oraInventory \ > SELECTED_LANGUAGES=en \ > oracle.install.db.InstallEdition=EE \ > oracle.install.db.isCustomInstall=false \ > oracle.install.db.EEOptionsSelection=false \ > oracle.install.db.DBA_GROUP=dba \ > oracle.install.db.OPER_GROUP=asmoper \ > oracle.install.db.isRACOneInstall=false \ > oracle.install.db.BACKUPDBA_GROUP=dba \ > oracle.install.db.DGDBA_GROUP=dba \ > oracle.install.db.KMDBA_GROUP=dba \ > oracle.install.db.rac.serverpoolCardinality=0 \ > oracle.install.db.ConfigureAsContainerDB=false \ > oracle.install.db.config.starterdb.memoryOption=false \ > oracle.install.db.config.starterdb.installExampleSchemas=true \ > oracle.install.db.config.starterdb.managementOption=DEFAULT \ > oracle.install.db.config.starterdb.enableRecovery=false \ > oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \ > SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \ > oracle.installer.autoupdates.option=SKIP_UPDATES \ > ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 \ > ORACLE_BASE=/u01/app/oracle \ > oracle.install.db.CLUSTER_NODES=raclhr-12cr1-n1,raclhr-12cr1-n2 \ > ORACLE_HOSTNAME=raclhr-12cR1-N1 Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 2287 MB Passed Checking swap space: must be greater than 150 MB. Actual 1785 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-01-17_09-38-20PM. Please wait ...[oracle@raclhr-12cR1-N1 database]$ [oracle@raclhr-12cR1-N1 database]$ [oracle@raclhr-12cR1-N1 database]$ [oracle@raclhr-12cR1-N1 database]$ [oracle@raclhr-12cR1-N1 database]$ You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2017-01-17_09-38-20PM.log
Prepare in progress. .................................................. 8% Done.
Prepare successful.
Copy files in progress. .................................................. 13% Done. .................................................. 18% Done. .................................................. 23% Done. .................................................. 28% Done. .................................................. 33% Done. .................................................. 38% Done. .................................................. 43% Done. .......... Copy files successful.
Link binaries in progress. .......... Link binaries successful. .................................................. 53% Done.
Setup files in progress.
Setup files successful. .................................................. 59% Done.
Setup Inventory in progress.
Setup Inventory successful. .................................................. 65% Done.
Finish Setup successful.
Perform remote operations in progress.
Perform remote operations successful. .................................................. 72% Done.
Saving Cluster Inventory in progress. .......... Saving Cluster Inventory successful. The installation of Oracle Database 12c was successful. Please check '/u01/app/oraInventory/logs/silentInstall2017-01-17_09-38-20PM.log' for more details.
Setup Oracle Base in progress.
Setup Oracle Base successful. .................................................. 86% Done.
Update Inventory in progress.
Update Inventory successful. .................................................. 95% Done.
As a root user, execute the following script(s): 1. /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Execute /u01/app/oracle/product/12.1.0/dbhome_1/root.sh on the following nodes: [raclhr-12cr1-n1, raclhr-12cr1-n2]
.................................................. 100% Done. Successfully Setup Software. As install user, execute the following script to complete the configuration. 1. /u01/app/oracle/product/12.1.0/dbhome_1/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).
|
节点1和节点2依次执行root.sh:
[root@raclhr-12cR1-N1 ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh Check /u01/app/oracle/product/12.1.0/dbhome_1/install/root_raclhr-12cR1-N1_2017-01-17_22-18-12.log for the output of root script [root@raclhr-12cR1-N1 ~]#
|
1.2 建立磁盘组
创建DATA和FRA磁盘组:
CREATE DISKGROUP DATA external redundancy DISK '/dev/asm-diskd' ATTRIBUTE 'compatible.rdbms' = '12.1', 'compatible.asm' = '12.1'; CREATE DISKGROUP FRA external redundancy DISK '/dev/asm-diske' ATTRIBUTE 'compatible.rdbms' = '12.1', 'compatible.asm' = '12.1'; |
[grid@raclhr-12cR1-N1 ~]$ sqlplus / as sysasm
SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 17 22:41:42 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Real Application Clusters and Automatic Storage Management options
SQL> CREATE DISKGROUP DATA external redundancy DISK '/dev/asm-diskd' ATTRIBUTE 'compatible.rdbms' = '12.1', 'compatible.asm' = '12.1';
Diskgroup created.
SQL> CREATE DISKGROUP FRA external redundancy DISK '/dev/asm-diske' ATTRIBUTE 'compatible.rdbms' = '12.1', 'compatible.asm' = '12.1';
Diskgroup created.
SQL>
|
1.3 dbca静默方式建库
dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \ -gdbname lhrrac -sid lhrrac \ -createAsContainerDatabase false \ -sysPassword lhr -systemPassword lhr -serviceUserPassword lhr \ -datafileDestination 'DATA/' -recoveryAreaDestination 'FRA/' \ -storageType ASM -asmsnmpPassword oracle -diskGroupName 'DATA' \ -characterset ZHS16GBK -nationalCharacterSet AL16UTF16 \ -sampleSchema true \ -memoryPercentage 30 \ -databaseType OLTP \ -emConfiguration NONE \ -nodeinfo raclhr-12cR1-N1,raclhr-12cR1-N2
|
1.4 其它配置
1.4.1 sqlplus提示符设置
编辑$ORACLE_HOME/sqlplus/admin/glogin.sql
set linesize 9999 pagesize 9999 set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> " |
最后,安装好的虚拟机可用于测试12c的功能,小麦苗会将安装好的12c的环境上传到云盘。
本文转自lhrbest 51CTO博客,原文链接:http://blog.51cto.com/lhrbest/1893589,如需转载请自行联系原作者