
环境说明:
OS:Redhat 7.5DB:11.2.0.4.0 RACASM:NFS
磁盘初始化
检查磁盘大小
root@chenj-ch-05:/oradata3#df -h /oradata*Filesystem Size Used Avail Use% Mounted on10.1.10.3:/test_ora19c_nfsB1 100G 710M 100G 1% /oradata110.1.10.3:/test_ora19c_01_nfsB1 30G 40M 30G 1% /oradata210.1.10.3:/test_ora19c_02_nfsB1 30G 38M 30G 1% /oradata3
检查磁盘挂载情况
root@chenj-ch-05:/oradata3# mount10.1.10.3:/test_ora19c_nfsB1 on /oradata1 type nfs (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.1.10.3,mountvers=3,mountport=635,mountproto=tcp,local_lock=none,addr=10.1.10.3)10.1.10.3:/test_ora19c_01_nfsB1 on /oradata2 type nfs (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.1.10.3,mountvers=3,mountport=635,mountproto=tcp,local_lock=none,addr=10.1.10.3)10.1.10.3:/test_ora19c_02_nfsB1 on /oradata3 type nfs (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.1.10.3,mountvers=3,mountport=635,mountproto=tcp,local_lock=none,addr=10.1.10.3)
创建共享磁盘文件
dd if=/dev/zero of=/oradata1/test_asm/ocr1 bs=1024k count=2048dd if=/dev/zero of=/oradata1/test_asm/ocr2 bs=1024k count=2048dd if=/dev/zero of=/oradata1/test_asm/ocr3 bs=1024k count=2048dd if=/dev/zero of=/oradata1/test_asm/data1 bs=1024k count=10240dd if=/dev/zero of=/oradata1/test_asm/data2 bs=1024k count=10240dd if=/dev/zero of=/oradata1/test_asm/data3 bs=1024k count=10240dd if=/dev/zero of=/oradata1/test_asm/data4 bs=1024k count=10240dd if=/dev/zero of=/oradata1/test_asm/data5 bs=1024k count=10240
修改权限
chown grid.oinstall /oradata1/test_asm -Rchmod 660 /oradata1/test_asm/*
静默安装grid
grid@chenj-ch-05:/home/grid$nohup sh /oracle/tmp/grid/runInstaller -silent -noconfig -waitForCompletion -ignorePrereq -ignoreInternalDriverError -showProgress -responseFile /home/grid/grid_install.rsp > /home/grid/install_0304.log &
静默安装grid日志
Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 3949 MB PassedChecking swap space: must be greater than 150 MB. Actual 16338 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2022-03-04_02-34-22PM. Please wait ...[WARNING] [INS-30011] The SYS 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 character 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 character and 1 digit [0-9].ACTION: Provide a password that conforms to the Oracle recommended standards.[WARNING] [INS-32016] The selected Oracle home contains directories or files.CAUSE: The selected Oracle home contained directories or files.ACTION: To start with an empty Oracle home, either remove its contents or choose another location.You can find the log of this install session at:/oracle/oraINventory/logs/installActions2022-03-04_02-34-22PM.logPrepare in progress................................................... 9% Done.Prepare successful.Copy files in progress................................................... 15% Done................................................... 20% Done................................................... 25% Done................................................... 30% Done................................................... 35% Done................................................... 40% Done................................................... 45% Done.........................................Copy files successful.Link binaries in progress.Link binaries successful................................................... 62% Done.Setup files in progress.Setup files successful................................................... 76% Done.Perform remote operations in progress................................................... 89% Done.Perform remote operations successful.The installation of Oracle Grid Infrastructure 11g was successful.Please check '/oracle/oraINventory/logs/silentInstall2022-03-04_02-34-22PM.log' for more details................................................... 94% Done.Execute Root Scripts in progress.As a root user, execute the following script(s):1. /oracle/oraINventory/orainstRoot.sh2. /oracle/grid/product/11.2/root.shExecute /oracle/oraINventory/orainstRoot.sh on the following nodes:[chenj-ch-05, chenj-ch-06]Execute /oracle/grid/product/11.2/root.sh on the following nodes:[chenj-ch-05, chenj-ch-06].................................................. 100% Done.Execute Root Scripts successful.As install user, execute the following script to complete the configuration.1. /oracle/grid/product/11.2/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.
节点1 root.sh执行日志
The following environment variables are set as:ORACLE_OWNER= gridORACLE_HOME= /oracle/grid/product/11.2Copying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...Creating /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: /oracle/grid/product/11.2/crs/install/crsconfig_paramsCreating trace directoryUser ignored Prerequisites during installationInstalling Trace File AnalyzerOLR initialization - successfulroot walletroot wallet certroot cert exportpeer walletprofile reader walletpa walletpeer wallet keyspa wallet keyspeer cert requestpa cert requestpeer certpa certpeer root cert TPprofile reader root cert TPpa root cert TPpeer pa cert TPpa peer cert TPprofile reader pa cert TPprofile reader peer cert TPpeer user certpa user certAdding Clusterware entries to inittabCRS-2672: Attempting to start 'ora.mdnsd' on 'chenj-ch-05'CRS-2676: Start of 'ora.mdnsd' on 'chenj-ch-05' succeededCRS-2672: Attempting to start 'ora.gpnpd' on 'chenj-ch-05'CRS-2676: Start of 'ora.gpnpd' on 'chenj-ch-05' succeededCRS-2672: Attempting to start 'ora.cssdmonitor' on 'chenj-ch-05'CRS-2672: Attempting to start 'ora.gipcd' on 'chenj-ch-05'CRS-2676: Start of 'ora.cssdmonitor' on 'chenj-ch-05' succeededCRS-2676: Start of 'ora.gipcd' on 'chenj-ch-05' succeededCRS-2672: Attempting to start 'ora.cssd' on 'chenj-ch-05'CRS-2672: Attempting to start 'ora.diskmon' on 'chenj-ch-05'CRS-2676: Start of 'ora.diskmon' on 'chenj-ch-05' succeededCRS-2676: Start of 'ora.cssd' on 'chenj-ch-05' succeededASM created and started successfully.Disk Group GD_TEST_OCR 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 2c78cf2ab1ac4f99bfbeafadec4caa01.Successful addition of voting disk 003f25c63a7e4f15bfe6ce115377e75d.Successful addition of voting disk 083b82cd51cc4fb0bf44ba96af95c99c.Successfully replaced voting disk group with +GD_TEST_OCR.CRS-4256: Updating the profileCRS-4266: Voting file(s) successfully replaced## STATE File Universal Id File Name Disk group-- ----- ----------------- --------- ---------1. ONLINE 2c78cf2ab1ac4f99bfbeafadec4caa01 (/oradata1/test_asm/ocr1) [GD_TEST_OCR]2. ONLINE 003f25c63a7e4f15bfe6ce115377e75d (/oradata1/test_asm/ocr2) [GD_TEST_OCR]3. ONLINE 083b82cd51cc4fb0bf44ba96af95c99c (/oradata1/test_asm/ocr3) [GD_TEST_OCR]Located 3 voting disk(s).CRS-2672: Attempting to start 'ora.asm' on 'chenj-ch-05'CRS-2676: Start of 'ora.asm' on 'chenj-ch-05' succeededCRS-2672: Attempting to start 'ora.GD_TEST_OCR.dg' on 'chenj-ch-05'CRS-2676: Start of 'ora.GD_TEST_OCR.dg' on 'chenj-ch-05' succeededFirstNode configuration failed at /oracle/grid/product/11.2/crs/install/crsconfig_lib.pm line 9379./oracle/grid/product/11.2/perl/bin/perl -I/oracle/grid/product/11.2/perl/lib -I/oracle/grid/product/11.2/crs/install /oracle/grid/product/11.2/crs/install/rootcrs.pl execution failed
执行节点2 root.sh
完整日志:
Creating /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: /oracle/grid/product/11.2/crs/install/crsconfig_paramsCreating trace directoryUser ignored Prerequisites during installationInstalling Trace File AnalyzerOLR initialization - successfulAdding Clusterware entries to inittabohasd failed to startFailed to start the Clusterware. Last 20 lines of the alert log follow:2022-03-04 15:24:05.980:[client(55011)]CRS-2101:The OLR was formatted using version 3.CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node chenj-ch-05, number 1, and is terminatingAn active cluster was found during exclusive startup, restarting to join the clusterConfigure Oracle Grid Infrastructure for a Cluster ... succeeded
查看crs
grid@chenj-ch-06:/home/grid$crsctl stat res -t--------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.GD_TEST_OCR.dgONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06ora.asmONLINE ONLINE chenj-ch-05 StartedONLINE ONLINE chenj-ch-06 Startedora.gsdOFFLINE OFFLINE chenj-ch-05OFFLINE OFFLINE chenj-ch-06ora.net1.networkONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06ora.onsONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr1 ONLINE ONLINE chenj-ch-05ora.cvu1 OFFLINE OFFLINEora.chenj-ch-05.vip1 ONLINE ONLINE chenj-ch-05ora.chenj-ch-06.vip1 ONLINE ONLINE chenj-ch-06ora.oc4j1 ONLINE ONLINE chenj-ch-06ora.scan1.vip1 ONLINE ONLINE chenj-ch-05
节点1:执行configToolAllCommands
生成rsp文件
su - gridvi /home/grid/cfgrsp.propertiesoracle.assistants.asm|S_ASMPASSWORD=oracleoracle.assistants.asm|S_ASMMONITORPASSWORD=oracleoracle.crs|S_BMCPASSWORD=oracle
开始执行
/oracle/ggrid@chenj-ch-05:/home/grid$/oracle/grid/product/11.2/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.propertiesSetting the invPtrLoc to /oracle/grid/product/11.2/oraInst.locperform - mode is starting for action: configureMar 4, 2022 3:40:46 PM oracle.install.driver.oui.config.GenericInternalPlugIn invokeINFO: Executing ASMCAMar 4, 2022 3:40:46 PM oracle.install.driver.oui.config.GenericInternalPlugIn invokeINFO: Command /oracle/grid/product/11.2/bin/asmca -silent -postConfigureASM -oui_internalMar 4, 2022 3:40:46 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: ... GenericInternalPlugIn.handleProcess() entered.Mar 4, 2022 3:40:46 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: ... GenericInternalPlugIn: getting configAssistantParmas.Mar 4, 2022 3:40:46 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: ... GenericInternalPlugIn: checking secretArguments.Mar 4, 2022 3:40:46 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: ... GenericInternalPlugIn: starting read loop.Mar 4, 2022 3:40:49 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Read: SYS_PASSWORD_PROMPTMar 4, 2022 3:40:49 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Processing: SYS_PASSWORD_PROMPT for argument tag -sysAsmPasswordMar 4, 2022 3:40:49 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Read: ASMSNMP_PASSWORD_PROMPTMar 4, 2022 3:40:49 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Processing: ASMSNMP_PASSWORD_PROMPT for argument tag -asmMonitorPasswordMar 4, 2022 3:40:49 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: End of argument passing to stdinMar 4, 2022 3:40:50 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Read:Mar 4, 2022 3:40:50 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Read: PostConfiguration completed successfullyMar 4, 2022 3:40:50 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcessINFO: Read:perform - mode finished for action: configureYou can see the log file: /oracle/grid/product/11.2/cfgtoollogs/oui/configActions2022-03-04_03-39-48-PM.logrid/product/11.2/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties
查看执行日志
实际调用如下命令:
/oracle/grid/product/11.2/oui/bin/runInstaller -nowait -noconsole -waitforcompletion -ignoreSysPrereqs -updateNodeList -silent CRS=true "CLUSTER_NODES={chenj-ch-05,chenj-ch-06}" ORACLE_HOME=/oracle/grid/product/11.2
日志:
vi /oracle/grid/product/11.2/cfgtoollogs/oui/configActions2022-03-04_03-39-48-PM.logrid/product/11.2/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties###################################################The action configuration is performing------------------------------------------------------The plug-in Update Inventory is running/oracle/grid/product/11.2/oui/bin/runInstaller -nowait -noconsole -waitforcompletion -ignoreSysPrereqs -updateNodeList -silent CRS=true "CLUSTER_NODES={chenj-ch-05,chenj-ch-06}" ORACLE_HOME=/oracle/grid/product/11.2Starting Oracle Universal Installer...Checking swap space: must be greater than 500 MB. Actual 16338 MB PassedThe inventory pointer is located at /etc/oraInst.locThe inventory is located at /oracle/oraINventoryThe plug-in Update Inventory has successfully been performed------------------------------------------------------------------------------------------------------------The plug-in Oracle Net Configuration Assistant is runningParsing command line arguments:Parameter "orahome" = /oracle/grid/product/11.2Parameter "orahnam" = Ora11g_gridinfrahome1Parameter "instype" = typicalParameter "inscomp" = client,oraclenet,javavm,server,anoParameter "insprtcl" = tcpParameter "cfg" = localParameter "authadp" = NO_VALUEParameter "responsefile" = /oracle/grid/product/11.2/network/install/netca_typ.rspParameter "silent" = trueParameter "silent" = trueDone parsing command line arguments.Oracle Net Services Configuration:Profile configuration complete.Profile configuration complete.chenj-ch-05...chenj-ch-06...Oracle Net Listener Startup:Listener started successfully.Listener configuration complete......Post-check for cluster services setup was unsuccessful on all the nodes.The plug-in Oracle Cluster Verification Utility has failed its perform method------------------------------------------------------The action configuration has failed its perform method###################################################
Oracle软件安装
root@chenj-ch-05:/oracle#cp -r oraINventory oraINventory_bak
静默安装
nohup sh /oracle/tmp/database/runInstaller -silent -noconfig -waitForCompletion -ignorePrereq -ignoreInternalDriverError -showProgress -responseFile /home/oracle/rsp/db_install.rsp > /home/oracle/install_0304.log &
安装日志
Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 3949 MB PassedChecking swap space: must be greater than 150 MB. Actual 16338 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2022-03-04_03-47-30PM. Please wait ...You can find the log of this install session at:/oracle/oraINventory/logs/installActions2022-03-04_03-47-30PM.logPrepare in progress................................................... 9% Done.Prepare successful.Copy files in progress................................................... 15% Done................................................... 20% Done................................................... 25% Done................................................... 30% Done................................................... 36% Done................................................... 41% Done................................................... 46% Done................................................... 51% Done................................................... 56% Done.Copy files successful...........Link binaries in progress.Link binaries successful................................................... 77% Done.Setup files in progress................................................... 94% Done.Setup files successful.The installation of Oracle Database 11g was successful.Please check '/oracle/oraINventory/logs/silentInstall2022-03-04_03-47-30PM.log' for more details.Execute Root Scripts in progress.As a root user, execute the following script(s):1. /oracle/db/product/11.2/root.shExecute /oracle/db/product/11.2/root.sh on the following nodes:[chenj-ch-05, chenj-ch-06].................................................. 100% Done.Execute Root Scripts successful.Successfully Setup Software.
执行脚本
root@chenj-ch-05:/root#/oracle/db/product/11.2/root.shCheck /oracle/db/product/11.2/install/root_chenj-ch-05_2022-03-04_15-56-21.log for the output of root scriptroot@chenj-ch-05:/root#vi /oracle/db/product/11.2/install/root_chenj-ch-05_2022-03-04_15-56-21.logroot@chenj-ch-06:/oracle#/oracle/db/product/11.2/root.shCheck /oracle/db/product/11.2/install/root_chenj-ch-06_2022-03-04_15-57-10.log for the output of root scriptroot@chenj-ch-06:/oracle#vi /oracle/db/product/11.2/install/root_chenj-ch-06_2022-03-04_15-57-10.log
日志如下:
Performing root user operation for Oracle 11gThe following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /oracle/db/product/11.2Copying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...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.Finished product-specific root actions.Finished product-specific root actions.
检查安装
oracle@chenj-ch-05:/home/oracle$sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 4 15:55:38 2022Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to an idle instance.SQL>
创建磁盘组
SQL> select name,total_mb,free_mb from v$asm_diskgroup;NAME TOTAL_MB FREE_MB------------------------------ ---------- ----------GD_TEST_OCR 6144 5218SQL>CREATE DISKGROUP GD_TEST_DATAEXTERNAL REDUNDANCYDISK '/oradata1/test_asm/data1','/oradata1/test_asm/data2','/oradata1/test_asm/data3';SQL> select name,state,type from v$asm_diskgroup;NAME STATE TYPE------------------------------ ----------- ------GD_TEST_OCR MOUNTED NORMALGD_TEST_DATA MOUNTED EXTERN
节点2:
SQL> select name,state,type from v$asm_diskgroup;NAME STATE TYPE------------------------------ ----------- ------GD_TEST_OCR MOUNTED NORMALGD_TEST_DATA DISMOUNTEDSQL> alter diskgroup GD_TEST_DATA mount;Diskgroup altered.SQL> select name,state,type from v$asm_diskgroup;NAME STATE TYPE------------------------------ ----------- ------GD_TEST_OCR MOUNTED NORMALGD_TEST_DATA MOUNTED EXTERN
DBCA建库
oracle@chenj-ch-05:/home/oracle/rsp$dbca -silent -createdatabase -responseFile /home/oracle/rsp/dbca.rsp日志如下:Cleaning up failed steps4% completeCopying database files5% complete6% complete7% complete13% complete19% complete24% complete30% complete33% completeCreating and starting Oracle instance35% complete39% complete43% complete46% complete47% complete48% complete50% complete52% completeCreating cluster database views54% complete71% completeCompleting Database Creation74% complete77% complete85% complete94% complete100% completeLook at the log file "/oracle/db/cfgtoollogs/dbca/test/test5.log" for further details.
RAC检查
oracle@chenj-ch-05:/home/oracle/rsp$srvctl config databasetestoracle@chenj-ch-05:/home/oracle/rsp$srvctl status database -d testInstance test1 is running on node chenj-ch-05Instance test2 is running on node chenj-ch-06grid@chenj-ch-05:/home/grid$crsctl stat res -t--------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.GD_TEST_DATA.dgONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06ora.GD_TEST_OCR.dgONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06ora.LISTENER.lsnrONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06ora.asmONLINE ONLINE chenj-ch-05 StartedONLINE ONLINE chenj-ch-06 Startedora.gsdOFFLINE OFFLINE chenj-ch-05OFFLINE OFFLINE chenj-ch-06ora.net1.networkONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06ora.onsONLINE ONLINE chenj-ch-05ONLINE ONLINE chenj-ch-06--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr1 ONLINE ONLINE chenj-ch-05ora.cvu1 OFFLINE OFFLINEora.chenj-ch-05.vip1 ONLINE ONLINE chenj-ch-05ora.chenj-ch-06.vip1 ONLINE ONLINE chenj-ch-06ora.oc4j1 ONLINE ONLINE chenj-ch-06ora.scan1.vip1 ONLINE ONLINE chenj-ch-05ora.test.db1 ONLINE ONLINE chenj-ch-05 Open2 ONLINE ONLINE chenj-ch-06 Open
数据测试
节点1:
SQL> create user cjc identified by a;User created.SQL> grant dba to cjc;Grant succeeded.SQL> conn cjc/aConnected.SQL>SQL>SQL> create table t1 as select level as id from dual connect by level <=10;Table created.SQL> select * from t1;ID----------1234567891010 rows selected.
节点2:
oracle@chenj-ch-06:/home/oracle$sqlplus cjc/aSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 4 16:17:40 2022Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> select * from t1;ID----------1234567891010 rows selected.
重启:
oracle@chenj-ch-05:/home/oracle$srvctl stop database -d testoracle@chenj-ch-05:/home/oracle$srvctl start database -d test
重启crs
停crs
root@chenj-ch-06:/oracle/grid/product/11.2/bin#./crsctl stop crsCRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.crsd' on 'chenj-ch-06'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.GD_TEST_OCR.dg' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.test.db' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.oc4j' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'chenj-ch-06'CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.scan1.vip' on 'chenj-ch-06'CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.chenj-ch-06.vip' on 'chenj-ch-06'CRS-2677: Stop of 'ora.test.db' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.GD_TEST_DATA.dg' on 'chenj-ch-06'CRS-2677: Stop of 'ora.chenj-ch-06.vip' on 'chenj-ch-06' succeededCRS-2672: Attempting to start 'ora.chenj-ch-06.vip' on 'chenj-ch-05'CRS-2677: Stop of 'ora.GD_TEST_DATA.dg' on 'chenj-ch-06' succeededCRS-2677: Stop of 'ora.scan1.vip' on 'chenj-ch-06' succeededCRS-2672: Attempting to start 'ora.scan1.vip' on 'chenj-ch-05'CRS-2677: Stop of 'ora.oc4j' on 'chenj-ch-06' succeededCRS-2672: Attempting to start 'ora.oc4j' on 'chenj-ch-05'CRS-2676: Start of 'ora.chenj-ch-06.vip' on 'chenj-ch-05' succeededCRS-2676: Start of 'ora.scan1.vip' on 'chenj-ch-05' succeededCRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'chenj-ch-05'CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'chenj-ch-05' succeededCRS-2677: Stop of 'ora.GD_TEST_OCR.dg' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.asm' on 'chenj-ch-06'CRS-2677: Stop of 'ora.asm' on 'chenj-ch-06' succeededCRS-2674: Start of 'ora.oc4j' on 'chenj-ch-05' failedCRS-2679: Attempting to clean 'ora.oc4j' on 'chenj-ch-05'CRS-2681: Clean of 'ora.oc4j' on 'chenj-ch-05' succeededCRS-2673: Attempting to stop 'ora.ons' on 'chenj-ch-06'CRS-2677: Stop of 'ora.ons' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.net1.network' on 'chenj-ch-06'CRS-2677: Stop of 'ora.net1.network' on 'chenj-ch-06' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on 'chenj-ch-06' has completedCRS-2677: Stop of 'ora.crsd' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.mdnsd' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.crf' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.ctssd' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.evmd' on 'chenj-ch-06'CRS-2673: Attempting to stop 'ora.asm' on 'chenj-ch-06'CRS-2677: Stop of 'ora.mdnsd' on 'chenj-ch-06' succeededCRS-2677: Stop of 'ora.evmd' on 'chenj-ch-06' succeededCRS-2677: Stop of 'ora.crf' on 'chenj-ch-06' succeededCRS-2677: Stop of 'ora.asm' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'chenj-ch-06'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'chenj-ch-06' succeededCRS-2677: Stop of 'ora.ctssd' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.cssd' on 'chenj-ch-06'CRS-2677: Stop of 'ora.cssd' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.gipcd' on 'chenj-ch-06'CRS-2677: Stop of 'ora.gipcd' on 'chenj-ch-06' succeededCRS-2673: Attempting to stop 'ora.gpnpd' on 'chenj-ch-06'CRS-2677: Stop of 'ora.gpnpd' on 'chenj-ch-06' succeededCRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'chenj-ch-06' has completedCRS-4133: Oracle High Availability Services has been stopped.
启动crs过程
root@chenj-ch-06:/oracle/grid/product/11.2/bin#./crsctl start crs2022-03-04 16:50:50.088:[ohasd(69993)]CRS-2112:The OLR service started on node chenj-ch-06.2022-03-04 16:50:50.093:[ohasd(69993)]CRS-1301:Oracle High Availability Service started on node chenj-ch-06.2022-03-04 16:50:50.093:[ohasd(69993)]CRS-8017:location: /etc/oracle/lastgasp has 2 reboot advisory log files, 0 were announced and 0 errors occurred2022-03-04 16:50:53.370:[/oracle/grid/product/11.2/bin/orarootagent.bin(70033)]CRS-2302:Cannot get GPnP profile. Error CLSGPNP_NO_DAEMON (GPNPD daemon is not running).2022-03-04 16:50:57.737:[gpnpd(70128)]CRS-2328:GPNPD started on node chenj-ch-06.2022-03-04 16:51:00.056:[cssd(70196)]CRS-1713:CSSD daemon is started in clustered mode2022-03-04 16:51:01.902:[ohasd(69993)]CRS-2767:Resource state recovery not attempted for 'ora.diskmon' as its target state is OFFLINE2022-03-04 16:51:01.902:[ohasd(69993)]CRS-2769:Unable to failover resource 'ora.diskmon'.2022-03-04 16:51:20.542:[cssd(70196)]CRS-1707:Lease acquisition for node chenj-ch-06 number 2 completed2022-03-04 16:51:21.814:[cssd(70196)]CRS-1605:CSSD voting file is online: /oradata1/test_asm/ocr1; details in /oracle/grid/product/11.2/log/chenj-ch-06/cssd/ocssd.log.2022-03-04 16:51:21.858:[cssd(70196)]CRS-1605:CSSD voting file is online: /oradata1/test_asm/ocr2; details in /oracle/grid/product/11.2/log/chenj-ch-06/cssd/ocssd.log.2022-03-04 16:51:21.898:[cssd(70196)]CRS-1605:CSSD voting file is online: /oradata1/test_asm/ocr3; details in /oracle/grid/product/11.2/log/chenj-ch-06/cssd/ocssd.log.2022-03-04 16:51:25.529:[cssd(70196)]CRS-1601:CSSD Reconfiguration complete. Active nodes are chenj-ch-05 chenj-ch-06 .2022-03-04 16:51:27.063:[ctssd(70307)]CRS-2403:The Cluster Time Synchronization Service on host chenj-ch-06 is in observer mode.2022-03-04 16:51:27.309:[ctssd(70307)]CRS-2407:The new Cluster Time Synchronization Service reference node is host chenj-ch-05.2022-03-04 16:51:27.310:[ctssd(70307)]CRS-2401:The Cluster Time Synchronization Service started on host chenj-ch-06.2022-03-04 16:51:29.059:[ohasd(69993)]CRS-2767:Resource state recovery not attempted for 'ora.diskmon' as its target state is OFFLINE2022-03-04 16:51:29.059:[ohasd(69993)]CRS-2769:Unable to failover resource 'ora.diskmon'.2022-03-04 16:51:47.564:[crsd(70414)]CRS-1012:The OCR service started on node chenj-ch-06.2022-03-04 16:51:47.572:[evmd(70329)]CRS-1401:EVMD started on node chenj-ch-06.2022-03-04 16:51:49.614:[crsd(70414)]CRS-1201:CRSD started on node chenj-ch-06.2022-03-04 16:51:57.716:[client(70701)]CRS-4743:File /oracle/grid/product/11.2/oc4j/j2ee/home/OC4J_DBWLM_config/system-jazn-data.xml was updated from OCR(Size: 13365(New), 13378(Old) bytes)
查看会话
SQL> select inst_id,count(*) from gv$session group by inst_id;INST_ID COUNT(*)---------- ----------1 412 39
排错过程
问题一:crsconfig_lib.pm line 9379
报错:
FirstNode configuration failed at /oracle/grid/product/11.2/crs/install/crsconfig_lib.pm line 9379./oracle/grid/product/11.2/perl/bin/perl -I/oracle/grid/product/11.2/perl/lib -I/oracle/grid/product/11.2/crs/install /oracle/grid/product/11.2/crs/install/rootcrs.pl execution failed
手动执行:
/oracle/grid/product/11.2/perl/bin/perl -I/oracle/grid/product/11.2/perl/lib -I/oracle/grid/product/11.2/crs/install /oracle/grid/product/11.2/crs/install/rootcrs.pl...PRCR-1079 : Failed to start resource ora.LISTENER_SCAN1.lsnrCRS-5702: Resource 'ora.LISTENER_SCAN1.lsnr' is already running on 'chenj-ch-05'FirstNode configuration failed at /oracle/grid/product/11.2/crs/install/crsconfig_lib.pm line 9379.
检查crsd.log
grid@chenj-ch-05:/oracle/grid/product/11.2/log/chenj-ch-05/crsd$vi crsd.log2022-03-04 15:06:08.395: [UiServer][1295947520]{1:56663:491} Container [ Name: ORDERMESSAGE:TextMessage[CRS-2674: Start of 'ora.oc4j' on 'chenj-ch-05' failed]MSGTYPE:TextMessage[1]OBJID:TextMessage[ora.oc4j]WAIT:TextMessage[0]]...2022-03-04 15:11:15.902: [ CRSPE][1298048768]{1:56663:598} Op 0x7fddfc1266d0 has 3 WOs2022-03-04 15:11:15.903: [ CRSPE][1298048768]{1:56663:598} ICE has queued an operation. Details: Operation [START of [ora.oc4j 1 1] on [chenj-ch-05] : local=0, unplanned=00x7fddfc1266d0] cannot run cause it needs W lock for: WO for Placement Path RI:[ora.oc4j 1 1] server [chenj-ch-05] target states [ONLINE INTERMEDIATE ], locked by op [START of [ora.oc4j 1 1] on [chenj-ch-05] : local=0, unplanned=00x7fddfc123e60]. Owner: CRS-2682: It is locked by 'grid' for command 'Start Resource' issued from 'chenj-ch-05'
手动启动
grid@chenj-ch-05:/oracle/grid/product/11.2/log/chenj-ch-05/crsd$srvctl start oc4j -vOC4J could not be startedPRCR-1079 : Failed to start resource ora.oc4jCRS-2674: Start of 'ora.oc4j' on 'chenj-ch-05' failedCRS-2632: There are no more servers to try to place resource 'ora.oc4j' on that would satisfy its placement policy先跳过,不处理,ora.oc4不影响安装
问题二:gpnptool rc=256
节点1执行root.sh遇到的另一个错误:
错误:
Failed to sign a peer profile for Oracle Cluster GPnP. gpnptool rc=256Creation of Oracle GPnP peer profile failed for chenj-ch-05Failed to create GPnP peer profile for chenj-ch-05 at /oracle/grid/product/11.2/crs/install/crsconfig_lib.pm line 5013./oracle/grid/product/11.2/perl/bin/perl -I/oracle/grid/product/11.2/perl/lib -I/oracle/grid/product/11.2/crs/install /oracle/grid/product/11.2/crs/install/rootcrs.pl execution failed
问题原因:
在安装grid阶段,执行root.sh前,更新了31537677 Opatch,导致root.sh执行失败。
回退OPatch
opatch rollback -id 31537677
问题三:CRS-2101
执行节点2 root.sh
日志:
报错,hang住
ohasd failed to startFailed to start the Clusterware. Last 20 lines of the alert log follow:2022-03-04 15:24:05.980:[client(55011)]CRS-2101:The OLR was formatted using version 3.
解决方案:
root@chenj-ch-06:/root#cd /var/tmp/.oracle/root@chenj-ch-06:/var/tmp/.oracle#lsnpohasdroot@chenj-ch-06:/var/tmp/.oracle#ll -rthtotal 0prw-r--r-- 1 root root 0 Mar 3 21:41 npohasdroot@chenj-ch-06:/var/tmp/.oracle#rm npohasdrm: remove fifo ‘npohasd’? yroot@chenj-ch-06:/var/tmp/.oracle#touch npohasdroot@chenj-ch-06:/var/tmp/.oracle#chmod 755 npohasdroot@chenj-ch-06:/var/tmp/.oracle#ll -rthtotal 0-rwxr-xr-x 1 root root 0 Mar 3 21:48 npohasd
问题四:Oracle Grid Infrastructure is not installed
###执行configToolAllCommands
必须执行configToolAllCommands,如果不执行,后面安装oracle时,会提示下面错误:
CAUSE: Before you can install Oracle RAC, you must install Oracle Grid Infrastructure on all servers (Oracle Clusterware and Oracle ASM) to create a cluster.ACTION: Oracle Grid Infrastructure is not installed. Install it either from the separate installation media included in your media pack, or install it by downloading it from Electronic Product Delivery (EPD) or the Oracle Technology Network (OTN). Oracle Grid Infrastructure normally is installed by a different operating system user than the one used for Oracle Database. It may need to be installed by your system administrator. See the installation guide for more details.
问题五:ORA-12545
安装oracle软件时遇到如下错误:
执行root.sh时,提示rootadd_rdbms.sh、rootadd_filemap.sh文件找不到,sqlplus登录时提示ORA-12545
Performing root user operation for Oracle 11gThe following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /oracle/db/product/11.2Copying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...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.Finished product-specific root actions./oracle/db/product/11.2/root.sh: line 14: /oracle/db/product/11.2/rdbms/install/rootadd_rdbms.sh: No such file or directory/oracle/db/product/11.2/root.sh: line 16: /oracle/db/product/11.2/rdbms/install/rootadd_filemap.sh: No such file or directory
sqlplus登录报错ORA-12545
oracle@chenj-ch-05:/home/oracle$source .bash_profileoracle@chenj-ch-05:/home/oracle$sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 4 10:04:57 2022Copyright (c) 1982, 2013, Oracle. All rights reserved.ERROR:ORA-12545: Connect failed because target host or object does not exist
通过history发现,在安装oracle时,解决软件包只解压了1个,第2个包忘解压了,静默安装时居然没有报错,安装后发现少了很多文件。
卸载Oracle软件,重新安装,具体需要删除$ORACLE_BASE,$ORACLE_HOME,/etc/ora*,/var/tmp/.oracle/*等文件。
#####chenjuchao 20220304 20:50#####





