资讯专栏INFORMATION COLUMN

记一次Rac节点故障处理及恢复(下篇)

IT那活儿 / 2023人阅读
记一次Rac节点故障处理及恢复(下篇)

相关阅读:

刘玉川,公众号:IT那活儿记一次Rac节点故障处理及恢复(上篇)
4、添加节点:

4.1  检查:

网络配置、操作系统配置、建用户(相同GID和UID)、SSH互信

——软件1级目录建立

[root@wbtdb2 u01]# rm -Rf /u01
[root@wbtdb2 u01]# mkdir /u01
[root@wbtdb2 u01]# chmod 777 /u01
[root@wbtdb2 u01]#

仅仅建好第一级目录即可,否则《上篇》中3.4会出现如下错误:

.WARNING:Error while copying directory /u01/11.2.0/grid with exclude file list /tmp/OraInstall2021-03-03_07-53-36PM/installExcludeFile.lst to nodes wbtdb2. [mkdir: cannot create directory `/u01/11.2.0/grid: Permission deniedmkdir: cannot create directory `/u01/11.2.0/grid: Permission denied]

cvu检查,节点1执行:

[grid@wbtdb1 bin]$ cluvfy stage -post hwos -n wbtdb2

Performing post-checks for hardware and operating system setup

Checking node reachability...
Node reachability check passed from node "wbtdb1"


Checking user equivalence...
User equivalence check passed for user "grid"

Checking node connectivity...

Checking hosts config file...

Verification of the hosts config file successful


Check: Node connectivity for interface "eth0"
Node connectivity passed for interface "eth0"
TCP connectivity check passed for subnet "192.168.1.0"


Check: Node connectivity for interface "eth1"
Node connectivity passed for interface "eth1"

ERROR:
PRVF-7617 : Node connectivity between "wbtdb1 : 192.168.1.51" and "wbtdb2 : 172.20.1.52" failed
TCP connectivity check failed for subnet "172.20.1.0"
(反复确认ssh互信没问题后忽略)

Node connectivity check failed

Checking multicast communication...

Checking subnet "192.168.1.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "192.168.1.0" for multicast communication with multicast group "230.0.1.0" passed.

Checking subnet "172.20.1.0" for multicast communication with multicast group "230.0.1.0"...
Check of subnet "172.20.1.0" for multicast communication with multicast group "230.0.1.0" passed.

Check of multicast communication passed.
Check for multiple users with UID value 0 passed
Time zone consistency check passed

Checking shared storage accessibility...

  Disk Sharing Nodes (1 in count)
  ------------------------------------ ------------------------
  /dev/sda wbtdb2

  Disk Sharing Nodes (1 in count)
  ------------------------------------ ------------------------
  /dev/sdb wbtdb2

  Disk Sharing Nodes (1 in count)
  ------------------------------------ ------------------------
  /dev/sdc wbtdb2

  Disk Sharing Nodes (1 in count)
  ------------------------------------ ------------------------
  /dev/sdd wbtdb2


Shared storage check was successful on nodes "wbtdb2"

Checking integrity of name service switch configuration file "/etc/nsswitch.conf" ...
Check for integrity of name service switch configuration file "/etc/nsswitch.conf" passed


Post-check for hardware and operating system setup was unsuccessful on all the nodes.
[grid@wbtdb1 bin]$


[grid@wbtdb1 bin]$ cluvfy comp peer -refnode wbtdb1 -n wbtdb2

Verifying peer compatibility

Checking peer compatibility...

Compatibility check: Physical memory [reference node: wbtdb1]
  Node Name     Status                    Ref. node status          Comment
  ------------ ------------------------ ------------------------ ----------
  wbtdb2 3.7409GB (3922588.0KB) 3.7409GB (3922588.0KB) matched
Physical memory check passed

-------部分输出省略-----------
Compatibility check: Package existence for "expat (x86_64)" [reference node: wbtdb1]
  Node Name     Status                    Ref. node status          Comment
  ------------ ------------------------ ------------------------ ----------
  wbtdb2 expat-2.0.1-11.el6_2 (x86_64) expat-2.0.1-11.el6_2 (x86_64) matched
Package existence for "expat (x86_64)" check passed

Verification of peer compatibility was unsuccessful.
Checks did not pass for the following node(s):
        wbtdb2


4.2  检查节点2集群安装条件


cluvfy stage -pre nodeadd -n node2 [-fixup [-fixupdir fixup_dir]] [-verbose]


4.3  添加节点2 的crs到集群

[grid@rac11g1 bin]$ cd $ORACLE_HOME/oui/bin/
If you are not using GNS:
[grid@rac11g1 bin]$ export IGNORE_PREADDNODE_CHECKS=Y
[grid@rac11g1 bin]$ ./addNode.sh "CLUSTER_NEW_NODES={wbtdb2}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={wbtdb2-vip}"    ---wbtdb2-vip是/etc/hosts中vip
输出如下:
[grid@wbtdb1 bin]$ ./addNode.sh  "CLUSTER_NEW_NODES={wbtdb2}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={wbtdb2-vip}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 4095 MB Passed
Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.


Performing tests to see whether nodes wbtdb2 are available
............................................................... 100% Done.

..
-----------------------------------------------------------------------------
Cluster Node Addition Summary
Global Settings
   Source: /u01/11.2.0/grid
   New Nodes
Space Requirements
   New Nodes
      wbtdb2
         /: Required 4.90GB : Available 23.93GB
Installed Products
   Product Names
      Oracle Grid Infrastructure 11g 11.2.0.4.0
      Java Development Kit 1.5.0.51.10
------中间部分输出省略----------
      Oracle Database 11g 11.2.0.4.0
-----------------------------------------------------------------------------


Instantiating scripts for add node (Wednesday, March 3, 2021 7:56:01 PM CST)
. 1% Done.
Instantiation of add node scripts complete

Copying to remote nodes (Wednesday, March 3, 2021 7:56:04 PM CST)
............................................................................................... 96% Done.
Home copied to new nodes

Saving inventory on nodes (Wednesday, March 3, 2021 8:02:22 PM CST)
. 100% Done.
Save inventory complete
WARNING:
The following configuration scripts need to be executed as the "root" user in each new cluster node. Each script in the list below is followed by a list of nodes.
/u01/11.2.0/grid/root.sh #On nodes wbtdb2
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts in each cluster node

The Cluster Node Addition of /u01/11.2.0/grid was successful.
Please check /tmp/silentInstall.log for more details.

——节点2执行root脚本:

/u01/11.2.0/grid/root.sh

[root@wbtdb2 ~]# /u01/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME= /u01/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
Adding Clusterware entries to upstart
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node wbtdb1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user root, privgrp root..
Operation successful.
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@wbtdb2 ~]#

做完这一步,发现节点2中集群信息已经加入到节点1中了,而且grid软件也装好了

[grid@wbtdb1 bin]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCHDG.dg
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
ora.DATADG.dg
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
ora.LISTENER.lsnr
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
ora.OCRVOTING.dg
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
ora.asm
               ONLINE ONLINE wbtdb1 Started
               ONLINE ONLINE wbtdb2 Started
ora.gsd
               OFFLINE OFFLINE wbtdb1
               OFFLINE OFFLINE wbtdb2
ora.net1.network
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
ora.ons
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
ora.registry.acfs
               ONLINE ONLINE wbtdb1
               ONLINE ONLINE wbtdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1 ONLINE ONLINE wbtdb1
ora.cvu
      1 ONLINE ONLINE wbtdb1
ora.oc4j
      1 ONLINE ONLINE wbtdb1
ora.scan1.vip
      1 ONLINE ONLINE wbtdb1

——验证集群软件是否添加成功

[grid@racdb1 bin]$ cluvfy stage -post nodeadd -n wbtdb2 -verbose


4.4  添加节点2数据库信息

切换到节点2
[root@wbtdb2 app]# cd /u01/app
[root@wbtdb2 app]# ll
total 8
drwxr-xr-x 6 grid oinstall 4096 Mar 3 20:11 oracle
drwxrwx--- 5 grid oinstall 4096 Mar 3 20:03 oraInventory
[root@rac11g2 app]# chmod 777 oracle

切换到节点1,oracle用户下:

[oracle@wbtdb1 ~]$ export IGNORE_PREADDNODE_CHECKS=Y
[oracle@wbtdb1 ~]$ cd $ORACLE_HOME/oui/bin/
[oracle@wbtdb1 bin]$ ./addNode.sh -silent "CLUSTER_NEW_NODES={wbtdb2}"


[oracle@wbtdb1 bin]$ ./addNode.sh -silent "CLUSTER_NEW_NODES={wbtdb2}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 4093 MB Passed
Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.


Performing tests to see whether nodes wbtdb2 are available
............................................................... 100% Done.

..
-----------------------------------------------------------------------------
Cluster Node Addition Summary
Global Settings
   Source: /u01/app/oracle/product/11.2.0/db_1
   New Nodes
Space Requirements
   New Nodes
      wbtdb2
         /: Required 4.39GB : Available 19.34GB
Installed Products
   Product Names
      Oracle Database 11g 11.2.0.4.0
      Java Development Kit 1.5.0.51.10
      Installer SDK Component 11.2.0.4.0
      Oracle One-Off Patch Installer 11.2.0.3.4
      Oracle Universal Installer 11.2.0.4.0
      Oracle USM Deconfiguration 11.2.0.4.0
      Oracle Configuration Manager Deconfiguration 10.3.1.0.0
      Oracle DBCA Deconfiguration 11.2.0.4.0
      Oracle RAC Deconfiguration 11.2.0.4.0
      Oracle Database Deconfiguration 11.2.0.4.0
      Oracle Configuration Manager Client 10.3.2.1.0
      Oracle Configuration Manager 10.3.8.1.0
      Oracle ODBC Driverfor Instant Client 11.2.0.4.0
      LDAP Required Support Files 11.2.0.4.0
      SSL Required Support Files for InstantClient 11.2.0.4.0
      Bali Share 1.1.18.0.0
      Oracle Extended Windowing Toolkit 3.4.47.0.0
      Oracle JFC Extended Windowing Toolkit 4.2.36.0.0
      Oracle Real Application Testing 11.2.0.4.0
      Oracle Database Vault J2EE Application 11.2.0.4.0
      Oracle Label Security 11.2.0.4.0
      Oracle Data Mining RDBMS Files 11.2.0.4.0
      Oracle OLAP RDBMS Files 11.2.0.4.0
      Oracle OLAP API 11.2.0.4.0
      Platform Required Support Files 11.2.0.4.0
      Oracle Database Vault option 11.2.0.4.0
      Oracle RAC Required Support Files-HAS 11.2.0.4.0
      SQL*Plus Required Support Files 11.2.0.4.0
      Oracle Display Fonts 9.0.2.0.0
      Oracle Ice Browser 5.2.3.6.0
      Oracle JDBC Server Support Package 11.2.0.4.0
      Oracle SQL Developer 11.2.0.4.0
      Oracle Application Express 11.2.0.4.0
      XDK Required Support Files 11.2.0.4.0
      RDBMS Required Support Files for Instant Client 11.2.0.4.0
      SQLJ Runtime 11.2.0.4.0
      Database Workspace Manager 11.2.0.4.0
      RDBMS Required Support Files Runtime 11.2.0.4.0
      Oracle Globalization Support 11.2.0.4.0
      Exadata Storage Server 11.2.0.1.0
      Provisioning Advisor Framework 10.2.0.4.3
      Enterprise Manager Database Plugin -- Repository Support 11.2.0.4.0
      Enterprise Manager Repository Core Files 10.2.0.4.5
      Enterprise Manager Database Plugin -- Agent Support 11.2.0.4.0
      Enterprise Manager Grid Control Core Files 10.2.0.4.5
      Enterprise Manager Common Core Files 10.2.0.4.5
      Enterprise Manager Agent Core Files 10.2.0.4.5
      RDBMS Required Support Files 11.2.0.4.0
      regexp 2.1.9.0.0
      Agent Required Support Files 10.2.0.4.5
      Oracle 11g Warehouse Builder Required Files 11.2.0.4.0
      Oracle Notification Service (eONS) 11.2.0.4.0
      Oracle Text Required Support Files 11.2.0.4.0
      Parser Generator Required Support Files 11.2.0.4.0
      Oracle Database 11g Multimedia Files 11.2.0.4.0
      Oracle Multimedia Java Advanced Imaging 11.2.0.4.0
      Oracle Multimedia Annotator 11.2.0.4.0
      Oracle JDBC/OCI Instant Client 11.2.0.4.0
      Oracle Multimedia Locator RDBMS Files 11.2.0.4.0
      Precompiler Required Support Files 11.2.0.4.0
      Oracle Core Required Support Files 11.2.0.4.0
      Sample Schema Data 11.2.0.4.0
      Oracle Starter Database 11.2.0.4.0
      Oracle Message Gateway Common Files 11.2.0.4.0
      Oracle XML Query 11.2.0.4.0
      XML Parser for Oracle JVM 11.2.0.4.0
      Oracle Help For Java 4.2.9.0.0
      Installation Plugin Files 11.2.0.4.0
      Enterprise Manager Common Files 10.2.0.4.5
      Expat libraries 2.0.1.0.1
      Deinstallation Tool 11.2.0.4.0
      Oracle Quality of Service Management (Client) 11.2.0.4.0
      Perl Modules 5.10.0.0.1
      JAccelerator (COMPANION) 11.2.0.4.0
      Oracle Containers for Java 11.2.0.4.0
      Perl Interpreter 5.10.0.0.2
      Oracle Net Required Support Files 11.2.0.4.0
      Secure Socket Layer 11.2.0.4.0
      Oracle Universal Connection Pool 11.2.0.4.0
      Oracle JDBC/THIN Interfaces 11.2.0.4.0
      Oracle Multimedia Client Option 11.2.0.4.0
      Oracle Java Client 11.2.0.4.0
      Character Set Migration Utility 11.2.0.4.0
      Oracle Code Editor 1.2.1.0.0I
      PL/SQL Embedded Gateway 11.2.0.4.0
      OLAP SQL Scripts 11.2.0.4.0
      Database SQL Scripts 11.2.0.4.0
      Oracle Locale Builder 11.2.0.4.0
      Oracle Globalization Support 11.2.0.4.0
      SQL*Plus Files for Instant Client 11.2.0.4.0
      Required Support Files 11.2.0.4.0
      Oracle Database User Interface 2.2.13.0.0
      Oracle ODBC Driver 11.2.0.4.0
      Oracle Notification Service 11.2.0.3.0
      XML Parser for Java 11.2.0.4.0
      Oracle Security Developer Tools 11.2.0.4.0
      Oracle Wallet Manager 11.2.0.4.0
      Cluster Verification Utility Common Files 11.2.0.4.0
      Oracle Clusterware RDBMS Files 11.2.0.4.0
      Oracle UIX 2.2.24.6.0
      Enterprise Manager plugin Common Files 11.2.0.4.0
      HAS Common Files 11.2.0.4.0
      Precompiler Common Files 11.2.0.4.0
      Installation Common Files 11.2.0.4.0
      Oracle Help for the Web 2.0.14.0.0
      Oracle LDAP administration 11.2.0.4.0
      Buildtools Common Files 11.2.0.4.0
      Assistant Common Files 11.2.0.4.0
      Oracle Recovery Manager 11.2.0.4.0
      PL/SQL 11.2.0.4.0
      Generic Connectivity Common Files 11.2.0.4.0
      Oracle Database Gateway for ODBC 11.2.0.4.0
      Oracle Programmer 11.2.0.4.0
      Oracle Database Utilities 11.2.0.4.0
      Enterprise Manager Agent 10.2.0.4.5
      SQL*Plus 11.2.0.4.0
      Oracle Netca Client 11.2.0.4.0
      Oracle Multimedia Locator 11.2.0.4.0
      Oracle Call Interface (OCI) 11.2.0.4.0
      Oracle Multimedia 11.2.0.4.0
      Oracle Net 11.2.0.4.0
      Oracle XML Development Kit 11.2.0.4.0
      Oracle Internet Directory Client 11.2.0.4.0
      Database Configuration and Upgrade Assistants 11.2.0.4.0
      Oracle JVM 11.2.0.4.0
      Oracle Advanced Security 11.2.0.4.0
      Oracle Net Listener 11.2.0.4.0
      Oracle Enterprise Manager Console DB 11.2.0.4.0
      HAS Files for DB 11.2.0.4.0
      Oracle Text 11.2.0.4.0
      Oracle Net Services 11.2.0.4.0
      Oracle Database 11g 11.2.0.4.0
      Oracle OLAP 11.2.0.4.0
      Oracle Spatial 11.2.0.4.0
      Oracle Partitioning 11.2.0.4.0
      Enterprise Edition Options 11.2.0.4.0
-----------------------------------------------------------------------------


Instantiating scripts for add node (Thursday, March 4, 2021 10:56:47 AM CST)
. 1% Done.
Instantiation of add node scripts complete

Copying to remote nodes (Thursday, March 4, 2021 10:56:54 AM CST)
............................................................................................... 96% Done.
Home copied to new nodes

Saving inventory on nodes (Thursday, March 4, 2021 11:08:33 AM CST)
. 100% Done.
Save inventory complete
WARNING:
The following configuration scripts need to be executed as the "root" user in each new cluster node. Each script in the list below is followed by a list of nodes.
/u01/app/oracle/product/11.2.0/db_1/root.sh #On nodes wbtdb2
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts in each cluster node

The Cluster Node Addition of /u01/app/oracle/product/11.2.0/db_1 was successful.
Please check /tmp/silentInstall.log for more details.


——节点2执行root脚本

/u01/app/oracle/product/11.2.0/db_1/root.sh

[root@wbtdb2 app]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Performing 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/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.


注:

如果运行完脚本出现如下输出,说明添加数据库信息是失败的,需要更新一下节点1的数据库软件信息。

[oracle@wbtdb1 bin]$ ./addNode.sh -silent "CLUSTER_NEW_NODES={wbtdb2}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 4093 MB Passed
Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.


Performing tests to see whether nodes wbtdb2,wbtdb2 are available
............................................................... 100% Done.

SEVERE:The new nodes wbtdb2 are already part of the cluster.


附:

---更新节点1的数据库软件信息

[oracle@wbtdb1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 "CLUSTER_NODES={wbtdb1}"


4.5  建实例

dbca  ----instance management

节点1,oracle用户下运行dbca

sys/oracle


——静默方式创建节点2 oracle实例

[oracle@wbtdb1 bin]$ dbca -silent -addInstance -nodeList wbtdb2 -gdbName wbtdb -instanceName wbtdb2 -sysDBAUserName sys -sysDBAPassword oracle

-gdbName wbtdb 指的是global_name
Adding instance
1% complete
2% complete
6% complete
13% complete
20% complete
26% complete
33% complete
40% complete
46% complete
53% complete
66% complete
Completing instance management.
76% complete

100%
 complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/wbtdb/wbtdb.log" for further details.


4.6  权限检查


[oracle@wbtdb2 ~]$ cluvfy comp admprv -o db_config -d $ORACLE_HOME -n wbtdb2

Verifying administrative privileges

Checking user equivalence...
User equivalence check passed for user "oracle"

Checking administrative privileges...
Check for multiple users with UID value 502 passed
User existence check passed for "oracle"
Group existence check passed for "oinstall"
Membership check for user "oracle" in group "oinstall" [as Primary] passed
Group existence check passed for "dba"
Membership check for user "oracle" in group "dba" passed

Administrative privileges check passed

Verification of administrative privileges was successful.


END


更多精彩干货分享

点击下方名片关注

IT那活儿


文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/129931.html

相关文章

发表评论

0条评论

IT那活儿

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<