3、在节点 1 上以 oracle 用户执行 addNode.sh 添加 DB 软件

以 oracle 用户在节点 1 上执行,添加节点的命令如下所示:
cd $ORACLE_HOME/oui/bin/
export IGNORE_PREADDNODE_CHECKS=Y
./addNode.sh "CLUSTER_NEW_NODES={rac3}"
过程如下:
[oracle@rac1 bin]$ pwd
/u01/app/oracle/product/11.2.0.4/db_1/oui/bin
[oracle@rac1 bin]$ export IGNORE_PREADDNODE_CHECKS=Y
[oracle@rac1 bin]$ ./addNode.sh "CLUSTER_NEW_NODES={rac3}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 4520 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 rac2,rac3 are available
............................................................... 100% Done.

..
-----------------------------------------------------------------------------
Cluster Node Addition Summary
Global Settings
   Source: /u01/app/oracle/product/11.2.0.4/db_1
   New Nodes
Space Requirements
   New Nodes
      rac3
         /: Required 4.26GB : Available 31.52GB
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 (Friday, December 11, 2020 3:44:55 PM CST)
.                                                                 1% Done.
Instantiation of add node scripts complete

Copying to remote nodes (Friday, December 11, 2020 3:45:00 PM CST)
...............................................................................................                                 96% Done.
Home copied to new nodes

Saving inventory on nodes (Friday, December 11, 2020 3:52:03 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/app/oracle/product/11.2.0.4/db_1/root.sh #On nodes rac3
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.4/db_1 was successful.
Please check '/tmp/silentInstall.log' for more details.

在 addNode.sh 脚本执行完成后根据脚本提示以 root 用户在新增的节点上执行以下脚本:
/u01/app/oracle/product/11.2.0.4/db_1/root.sh 

4.在节点1使用dbca命令吧oracle实例添加到数据库

在节点 1 上用 dbca 命令把 oracle 实例添加到数据库。
dbca -> instance manager -> add an instance -> 选择实例,输入 sys 用户和密码 -> 选择
节点和实例名 -> Finish.
或者通过 dbca 的图形化管理,也可以使用 dbca 的静默安装。

dbca -silent -addInstance -nodeList rac3 -gdbName racdb -instanceName racdb3 -sysDBAUserName sys -sysDBAPassword 123456
不用执行,已经自动更新了。用 oracle 用户将实例添加到 CRS 资源里。注意,用 oracle 用户执行,还要注意 oracle 用户的属组信息

步骤如下:

oracle@rac1 ~]$ dbca -silent -addInstance -nodeList rac3 -gdbName racdb -instanceName racdb3 -sysDBAUserName sys -sysDBAPassword 123456
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/racdb/racdb.log" for further details.

不用执行,已经自动更新了。用 oracle 用户将实例添加到 CRS 资源里。注意,用 oracle 用户执行,还
要注意 oracle 用户的属组信息
srvctl config database -d racdb
srvctl add instance -d racdb -i racdb3 -n rac3

5.结果校验

olsnodes -s
[grid@rac2 ~]$ olsnodes -s
rac1    Active
rac2    Active
rac3    Active

olsnodes -n
[grid@rac2 ~]$ olsnodes -n
rac1    1
rac2    2
rac3    3

crsctl stat res -t

[grid@rac2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.DATA.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.OCR.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.asm
               ONLINE  ONLINE       rac1                     Started             
               ONLINE  ONLINE       rac2                     Started             
               ONLINE  ONLINE       rac3                     Started             
ora.gsd
               OFFLINE OFFLINE      rac1                                         
               OFFLINE OFFLINE      rac2                                         
               OFFLINE OFFLINE      rac3                                         
ora.net1.network
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.ons
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.registry.acfs
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.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.rac3.vip
      1        ONLINE  ONLINE       rac3                                         
ora.racdb.db
      1        ONLINE  ONLINE       rac1                     Open                
      2        ONLINE  ONLINE       rac2                     Open                
      3        ONLINE  ONLINE       rac3                     Open                
ora.scan1.vip
      1        ONLINE  ONLINE       rac1         

col host_name for a20
select inst_id,host_name,instance_name,status from gv$instance;

[oracle@rac1 app]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 11 16:36:47 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> col host_name for a20
SQL> select inst_id,host_name,instance_name,status from gv$instance;

   INST_ID HOST_NAME            INSTANCE_NAME    STATUS
---------- -------------------- ---------------- ------------
         1 rac1                 racdb1           OPEN
         3 rac3                 racdb3           OPEN
         2 rac2                 racdb2           OPEN

Related Posts