Linux ... ...
分类: Oracle
2008-12-24 17:21:50
在多数业务中,Oracle 真正应用集群 (RAC) 配置的主要业务要求是整个系统中数据库层的可伸缩性 — 这样,当用户数增加时,可将额外实例添加到该集群来分发该负载。
在 Oracle RAC 10g 中,这个特定的功能已经变得更加容易。当节点/实例变成可用状态后,Oracle 即可通过必需的几个设置步骤来包含这个即插即用功能。
在本文中,我将讨论将节点添加到现有 Oracle RAC 10g 第 2 版集群所需的步骤。
出于演示目的,我们这里的环境是一个四节点的 Rd Hat Linux 集群。该任务是添加一个附加节点,从而使它成为一个五节点集群。
数据库名 |
节点编号 |
数据库版本 |
实例编号 |
操作系统内核版本 |
文件系统 |
集群管理器 |
SSKYDB |
四个节点 — oradb1、oradb2、oradb3 和 oradb4 |
10.2.0.1 |
四个实例 — SSKY1、SSKY2、SSKY3 和 SSKY4 |
Red Hat Enterprise Linux AS 3 |
OCFS 1.0 和 ASM |
Oracle 集群件 |
该过程将通过以下 7 个步骤实现:
任何软件安装或升级的第一个主要步骤都是确保系统的完整备份可用,包括操作系统和数据文件。下一步是验证系统要求、操作系统版本和所有应用程序补丁级别。
新节点应该具有与现有节点相同的操作系统版本,包括 Oracle 所需的所有补丁。在这个示例中,由于驻留在节点 1 到 4 上的操作系统是 Red Hat Enterprise Linux 3,因此新节点也应该具有该版本。此外,为了维持当前命名惯例,应该将新节点称为 oradb5。
除了基本的操作系统外,还应该安装 Oracle 需要的以下程序包:
[root@oradb5 root]# rpm -qa | grep -i gcc
compat-gcc-c++-7.3-2.96.128
compat-gcc-7.3-2.96.128
libgcc-3.2.3-42
gcc-3.2.3-42
[root@oradb5 root]# rpm -qa | grep -i openmotif
openmotif-2.2.3-3.RHEL3
openmotif21-2.1.30-8
[root@oradb5 root]# rpm -qa | grep -i glibc
glibc-2.3.3-74
glibc-utils-2.3.3-74
glibc-kernheaders-2.4-8.34.1
glibc-common-2.3.3-74
glibc-headers-2.3.3-74
glibc-devel-2.3.3-74
[root@oradb5 root]# rpm -qa | grep -i compat
compat-libstdc++-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-gcc-7.3-2.96.128
compat-db-4.0.14-5
compat-libstdc++-devel-7.3-2.96.128
[root@oradb5 root]#
使用以下值更新内核参数。
kernel.core_uses_pid = 1
kernel.hostname = oradb5.sumsky.net
kernel.domainname = sumsky.net
kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmseg = 4096
kernel.sem = 250 32000 100 150
kernel.msgmnl = 2878
kernel.msgmnb = 65535
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_max = 262144
将下列参数添加到 /etc/security/limits.conf。
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
将设备添加到 /etc/fstab — 将设备定义从现有节点之一复制到 oradb5。
[root@oradb5 root]$ more /etc/fstab
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/sda2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/sdb5 /u01 ocfs _netdev 0 0
/dev/sdb6 /u02 ocfs _netdev 0 0
/dev/sdb7 /u03 ocfs _netdev 0 0
/dev/sdb8 /u04 ocfs _netdev 0 0
/dev/sdb9 /u05 ocfs _netdev 0 0
/dev/sdb10 /u06 ocfs _netdev 0 0
/dev/sdb14 /u14 ocfs _netdev 0 0
接下来,创建管理用户。Oracle 的每个安装都要求每个节点上有一个管理用户帐户。在所有现有节点中,管理所有者是 oracle,因此下一步是在节点 oradb5 上创建管理用户帐户。当创建该用户帐户时,重要的是用户 oracle 的 UID 和 GID 需要与其他 RAC 节点的相同。该信息可以使用以下命令获取:
[oracle@oradb1 oracle]$ id oracle
uid=500(oracle) gid=500(oinstall) groups=501(dba), 502(oper)
作为根连接到 oradb5(基于 Linux 或 Unix 的环境)并创建以下操作系统组。
groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 oper
当创建这些组之后,使用以下命令创建 oracle 用户帐户作为 dba 组的成员,然后使用 passwd(密码)命令重新设置用户密码。
useradd -u 500 -g oinstall -G dba, oper oracle
passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
当创建组和用户之后,应该验证它们以确保以下命令的输出与该集群的所有节点等同。
[root@oradb5 root]$ id oracle
uid=500(oracle) gid=500(oinstall) groups=501(dba), 502(oper)
在节点 oradb5 上将所有网络地址添加到 /etc/hosts 文件。此外,要在集群的其他四个节点上交叉注册节点 oradb5 信息。
root@oradb5 root]# more /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.2.10 oradb1.sumsky.net oradb1
192.168.2.20 oradb2.sumsky.net oradb2
192.168.2.30 oradb3.sumsky.net oradb3
192.168.2.40 oradb4.sumsky.net oradb4
192.168.2.50 oradb5.sumsky.net oradb5
#Private Network/interconnect
10.168.2.110 oradb1-priv.sumsky.net oradb1-priv
10.168.2.120 oradb2-priv.sumsky.net oradb2-priv
10.168.2.130 oradb3-priv.sumsky.net oradb3-priv
10.168.2.140 oradb4-priv.sumsky.net oradb4-priv
10.168.2.150 oradb5-priv.sumsky.net oradb5-priv
# VIP
192.168.2.15 oradb1-vip.sumsky.net oradb1-vip
192.168.2.25 oradb2-vip.sumsky.net oradb2-vip
192.168.2.35 oradb3-vip.sumsky.net oradb3-vip
192.168.2.45 oradb4-vip.sumsky.net oradb4-vip
192.168.2.55 oradb5-vip.sumsky.net oradb5-vip
用 SSH 建立用户等效项。当向集群添加节点时,Orale 将在其中执行初始安装的节点的文件复制到该集群的新节点。这样的复制过程可以通过使用 ssh 协议(如果可用)来进行,也可以使用远程复制 (rcp) 来进行。为了使复制操作成功,RAC 节点上的 oracle 用户必须能够在无需提供密码或口令短语的情况下登录到新的 RAC 节点。
当前,现有的四个节点配置为使用 ssh。要在新节点上配置 oracle 帐户来使用无需任何密码的 ssh,执行以下任务:
[oracle@oradb5 oracle]$ ssh-keygen -t dsa -b 1024
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Created directory '/home/oracle/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
b6:07:42:ae:47:56:0a:a3:a5:bf:75:3e:21:85:8d:30 oracle@oradb5.sumsky.net
[oracle@oradb5 oracle]$
[oracle@oradb5 oracle]$ cd .ssh
[oracle@oradb5 .ssh]$ cat id_dsa.pub > authorized_keys
当创建完密钥并将其复制到所有节点之后,oracle 用户帐户无需使用密码就可以从一个节点连接到另一个节点上的另一个 oracle 帐户。这允许 Oracle Universal Installer 将安装节点的文件复制到集群的其他节点。
以下输出是从节点 oradb1 到节点 oradb5 显示 ssh 的验证。
[oracle@oradb1 oracle]$ ssh oradb1 hostname
oradb1.sumsky.net
[oracle@oradb1 oracle]$ ssh oradb5 hostname
Oradb5.sumsky.net
[oracle@oradb1 oracle]$ ssh oradb1-priv hostname
oradb1.sumsky.net
[oracle@oradb1 oracle]$ ssh oradb5-priv hostname
Oradb5.sumsky.net
注意:首次执行这些测试时,操作系统将显示一个密钥并请求用户接受或拒绝。输入“Yes”将接受并注册此密钥。应该在其他所有节点上跨集群中的所有接口执行这些测试,但 VIP 除外。
Oracle 集群件已经安装在集群上;这里的任务是将新节点添加到集群配置中。要执行该任务,需要执行 Oracle 提供的名为 addnode 的实用程序,该工具位于 Clusterware 的主 oui/bin 目录中。Oracle 集群件有两个文件(Oracle 集群信息库 (OCR) 和 Oracle 集群同步服务 (CSS) 表决磁盘),它们包含有关该集群以及由 Oracle 集群件管理的应用程序的信息。这些文件需要使用关于新节点的信息进行更新。集群件安装过程的第一步是验证新节点是否准备好进行安装。
集群验证。在 Oracle 数据库 10g 第 2 版中,Oracle 引入了一个称为 Oracle 集群验证实用程序 (CVU) 的新实用程序作为该集群件软件的一部分。使用适当的参数执行该实用程序可以确定集群状态。在该阶段,在安装 Oracle 集群件之前,应该执行两个验证:
cluvfy stage -post hwos -n oradb1,oradb5
Performing post-checks for hardware and operating system setup
Checking node reachability...
Node reachability check passed from node "oradb1".
Checking user equivalence...
User equivalence check passed for user "oracle".
Checking node connectivity...
Node connectivity check passed for subnet "192.168.2.0" with node(s) oradb5,oradb1.
Node connectivity check passed for subnet "10.168.2.0" with node(s) oradb5,oradb1.
Suitable interfaces for the private interconnect on subnet "192.168.2.0":
oradb5 eth0:192.168.2.50 eth0:192.168.2.55
oradb1 eth0:192.168.2.10 eth0:192.168.2.15
Suitable interfaces for the private interconnect on subnet "10.168.2.0":
oradb5 eth1:10.168.2.150
oradb1 eth1:10.168.2.110
Checking shared storage accessibility...
Shared storage check failed on nodes "oradb5".
Post-check for hardware and operating system setup was unsuccessful on all the nodes.
正如突出显示的部分一样,上面的验证失败于存储检查验证;节点 oradb5 无法查看存储设备。在这个特定示例中,磁盘没有足够的权限。
如果忽略该错误继续安装,Oracle 集群件安装将失败。但如果在重新执行前解决了该错误,该验证步骤将成功,如下所示。
Checking shared storage accessibility...
Shared storage check passed on nodes "oradb5,oradb1".
Post-check for hardware and operating system setup was successful on all the nodes.
[oracle@oradb1 cluvfy]$ cluvfy stage -pre crsinst -n oradb1,oradb5
Performing pre-checks for cluster services setup
Checking node reachability...
Node reachability check passed from node "oradb1".
Checking user equivalence...
User equivalence check passed for user "oracle".
Checking administrative privileges...
User existence check passed for "oracle".
Group existence check passed for "oinstall".
Membership check for user "oracle" in group "oinstall" [as Primary] failed.
Check failed on nodes:
oradb5,oradb1
Administrative privileges check passed.
Checking node connectivity...
Node connectivity check passed for subnet "192.168.2.0" with node(s) oradb5,oradb1.
Node connectivity check passed for subnet "10.168.2.0" with node(s) oradb5,oradb1.
Suitable interfaces for the private interconnect on subnet "192.168.2.0":
oradb5 eth0:192.168.2.50 eth0:192.168.2.55
oradb1 eth0:192.168.2.10 eth0:192.168.2.15
Suitable interfaces for the private interconnect on subnet "10.168.2.0":
oradb5 eth1:10.168.2.150
oradb1 eth1:10.168.2.110
Checking system requirements for 'crs'...
Total memory check passed.
Check failed on nodes:
oradb5,oradb1
Free disk space check passed.
Swap space check passed.
System architecture check passed.
Kernel version check passed.
Package existence check passed for "make-3.79".
Package existence check passed for "binutils-2.14".
Package existence check passed for "gcc-3.2".
Package existence check passed for "glibc-2.3.2-95.27".
Package existence check passed for "compat-db-4.0.14-5".
Package existence check passed for "compat-gcc-7.3-2.96.128".
Package existence check passed for "compat-gcc-c++-7.3-2.96.128".
Package existence check passed for "compat-libstdc++-7.3-2.96.128".
Package existence check passed for "compat-libstdc++-devel-7.3-2.96.128".
Package existence check passed for "openmotif-2.2.3".
Package existence check passed for "setarch-1.3-1".
Group existence check passed for "dba".
Group existence check passed for "oinstall".
User existence check passed for "nobody".
System requirement failed for 'crs'
Pre-check for cluster services setup was successful on all the nodes.
运行 OUI 需要执行该安装程序的终端与 X-windows 兼容。否则,应安装相应的 X-windows 模拟器并使用以下语法通过 DISPLAY 命令调用此模拟器。
export DISPLAY=:0.0
例如:
[oracle@oradb1 oracle]$export DISPLAY=192.168.2.101:0.0
下一步是在新节点 oradb5 上配置集群件。为此,如前所述,Oracle 已经提供了一个新的称为 addNode.sh 的可执行文件,它位于
公共节点名称 | 私有节点名称 | 虚拟主机名称 |
oradb5 | oradb5-priv | oradb5-vip |
/usr/app/oracle/oraInventory/orainstRoot.sh on node oradb5
[root@oradb5 oraInventory]# ./orainstRoot.sh
Changing permissions of /usr/app/oracle/oraInventory to 770.
Changing groupname of /usr/app/oracle/oraInventory to dba.
The execution of the script is complete
[root@oradb5 oraInventory]#
/usr/app/oracle/product/10.2.0/crs/install/rootaddnode.sh on node oradb1.(addnoderoot.sh 文件将使用 srvctl 实用程序将新节点信息添加到 OCR。请注意下面脚本输出末尾的具有 nodeapps 参数的 srvctl 命令。)
[root@oradb1 install]# ./rootaddnode.sh
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Attempting to add 1 new nodes to the configuration
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node:
node 5: oradb5 oradb5-priv oradb5
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
/usr/app/oracle/product/10.2.0/crs/bin/srvctl
add nodeapps -n oradb5 -A oradb5-v ip/255.255.255.0/bond0
-o /usr/app/oracle/product/10.2.0/crs
[root@oradb1 install]#
/usr/app/oracle/product/10.2.0/crs/root.sh on node oradb5.
[root@oradb5 crs]# ./root.sh
WARNING: directory '/usr/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/app/oracle/product' is not owned by root
WARNING: directory '/usr/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.
OCR backup directory '/usr/app/oracle/product/10.2.0/crs/cdata/SskyClst'
does not exist. Creating now
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/usr/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/usr/app/oracle/product' is not owned by root
WARNING: directory '/usr/app/oracle' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname oradb1 for node 1.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node:
node 1: oradb1 oradb1-priv oradb1
node 2: oradb2 oradb2-priv oradb2
node 3: oradb3 oradb3-priv oradb3
node 4: oradb4 oradb4-priv oradb4
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
oradb1
oradb2
oradb3
oradb4
oradb5
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
IP address "oradb-vip" has already been used.
Enter an unused IP address.
产生错误“oradb-vip’ has already been used”,因为 VIP 已经在所有节点(而非 oradb5)上进行了配置。重要的是在继续之前手动执行 VIPCA(虚拟 IP 配置助手)。
使用 VIPCA 手动配置 VIP。与执行 OUI 相似,执行 VIPCA 要求运行该安装程序的终端与 X-windows 兼容。否则,应安装相应的 X-windows 模拟器并使用以下语法通过 DISPLAY 命令调用此模拟器:
export DISPLAY=:0.0
例如:
[oracle@oradb1 oracle]$export DISPLAY=192.168.2.101:0.0
在节点 oradb1(或者执行添加节点过程的节点)上的命令提示符处执行 root.sh 之后,还要立即作为根调用 VIPCA。(VIPCA 还将在新节点上配置 GSD 和 ONS 资源。)
完成 Oracle 集群件安装后,将在其各自目录中创建下列文件。
集群件文件:
[root@oradb5 root]# ls -ltr /etc/init.d/init.*
-r-xr-xr-x 1 root root 3197 Aug 13 23:32 /etc/init.d/init.evmd
-r-xr-xr-x 1 root root 35401 Aug 13 23:32 /etc/init.d/init.cssd
-r-xr-xr-x 1 root root 4721 Aug 13 23:32 /etc/init.d/init.crsd
-r-xr-xr-x 1 root root 1951 Aug 13 23:32 /etc/init.d/init.crs
[root@oradb5 root]#
使用以下条目更新了操作系统提供的 inittab 文件。
[root@oradb5 root]# tail -5 /etc/inittab
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1
[oracle@oradb1 oracle]$ olsnodes
oradb1
oradb2
oradb3
oradb4
oradb5
[oracle@oradb1 oracle]$
[oracle@oradb1 oracle]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb1.gsd application ONLINE ONLINE oradb1
ora.oradb1.ons application ONLINE ONLINE oradb1
ora.oradb1.vip application ONLINE ONLINE oradb1
ora.oradb2.gsd application ONLINE ONLINE oradb2
...
ora.oradb3.vip application ONLINE ONLINE oradb3
ora.oradb4.gsd application ONLINE ONLINE oradb4
ora.oradb4.ons application ONLINE ONLINE oradb4
ora.oradb4.vip application ONLINE ONLINE oradb4
ora.oradb5.gsd application ONLINE ONLINE oradb5
ora.oradb5.ons application ONLINE ONLINE oradb5
ora.oradb5.vip application ONLINE ONLINE oradb5
[oracle@oradb5 oracle]$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:90:27:B8:58:10
inet addr:192.168.2.50 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:583308844 (556.2 Mb) TX bytes:4676477 (4.4 Mb)
eth0:1 Link encap:Ethernet HWaddr 00:90:27:B8:58:10
inet addr:192.168.2.55 Bcast:192.168.3.255 Mask:255.255.252.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:14631 errors:0 dropped:0 overruns:0 frame:0
TX packets:21377 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8025681 (7.6 Mb) TX bytes:600 (600.0 b)
Interrupt:11 Base address:0x2400 Memory:41300000-41300038
注意:eth0:1 指示它是基本主机 eth0 的 VIP 地址。当节点出现故障时,eth0:1 将移动到集群中的一个可用节点。故障切换服务器上的 VIP 的新标识符变为 eth0:2 或更高数值,具体情况取决于集群中哪些节点故障以及 VIP 移植到的其他节点。
下一步是在新节点上安装 Oracle 软件。如前所述,Oracle 已经提供了一个新的称为 addNode.sh 的可执行文件,它位于 $ORACLE_HOME/oui/bin 目录。
[root@oradb5 db_1]# ./root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /usr/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
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.sh script.
Now product-specific root actions will be performed.
当安装 RDBMS 软件之后,比较好的做法是在进行下一步之前运行 netca。Netca 将配置需要的所有网络文件和参数,例如,监听程序、sql*net 和 tnsnames.ora 文件。
DBCA 具有将附加实例添加到集群所需的所有选项。
要求:
- 在开始执行升级过程前,请创建数据库的完整冷备份。
- Oracle 集群件应该运行在所有节点上。
Username:sys
Password:< > 并单击 Next。
SQL> select * from v$active_instances;
INST_NUMBER INST_NAME
----------- -----------------------------------
1 oradb1.sumsky.net:SSKY1
2 oradb2.sumsky.net:SSKY2
3 oradb3.sumsky.net:SSKY3
4 oradb4.sumsky.net:SSKY4
5 oradb5.sumsky.net:SSKY5
SQL> SELECT NAME,STATE,TYPE FROM V$ASM_DISKGROUP;
NAME STATE TYPE
------------------------------ ----------- ------
ASMGRP1 CONNECTED NORMAL
ASMGRP2 CONNECTED NORMAL
SQL> SELECT NAME FROM V$DATAFILE;
NAME
-----------------------------------------------------------------
+ASMGRP1/sskydb/datafile/system.256.581006553
+ASMGRP1/sskydb/datafile/undotbs1.258.581006555
+ASMGRP1/sskydb/datafile/sysaux.257.581006553
+ASMGRP1/sskydb/datafile/users.259.581006555
+ASMGRP1/sskydb/datafile/example.269.581007007
+ASMGRP1/sskydb/datafile/undots2.271.581029215
集群中的新实例:
[oracle@oradb1 oracle]$ srvctl status database -d SSKYDB数据库服务:
Instance SSKY1 is running on node oradb1
Instance SSKY2 is running on node oradb2
Instance SSKY3 is running on node oradb3
Instance SSKY4 is running on node oradb4
Instance SSKY5 is running on node oradb5
[oracle@oradb1 oracle]$ srvctl status service -d SSKYDB
Service CRM is running on instance(s) SSKY1
Service CRM is running on instance(s) SSKY2
Service CRM is running on instance(s) SSKY3
Service CRM is running on instance(s) SSKY4
Service CRM is running on instance(s) SSKY5
Service PAYROLL is running on instance(s) SSKY1
Service PAYROLL is running on instance(s) SSKY5
为便于管理和导航,应在登录配置文件中定义几个不同的环境变量。例如:
[oracle@oradb5 oracle]$ more .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/usr/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:$ORA_CRS_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:/sbin
export ORACLE_ADMIN=$ORACLE_BASE/admin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_ASSUME_KERNEL=2.4.19
export LD_LIBRARY=$ORACLE_HOME/lib
export LD_LIBRARY=${LD_LIBRARY}:/lib:/usr/lib:/usr/local/bin
export LD_LIBRARY=${LD_LIBRARY}:$ORA_CRS_HOME/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export ORACLE_SID=SSKY5
将网络地址添加到 DNS 以进行查看。为了便于连接到使用 VIP 的数据库的应用程序和客户端将别名转换为适当的 IP 地址,重要的是将 VIP 地址添加到 DNS。
还要将新网络地址添加到 clinet tnsnames.ora 文件,添加到适当的 connect 描述符。
CRAC =如果这些服务器配置为使用 FAN 功能,将新的服务器地址添加到所有数据库服务器上的 onsctl 文件中。ons.config 文件位于
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb2-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb3-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb4-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb5-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CRM)
)
)
[oracle@oradb4 oracle]$ more $ORACLE_HOME/opmn/conf/ons.config
localport=6101
remoteport=6201
loglevel=3
useocr=on
nodes=oradb4.sumsky.net:6101,oradb2.sumsky.net:6201,
oradb1.sumsky.net:6201,oradb3.sumsky.net:6201,oradb5.sumsky.net:6201
onsclient1.sumsky.net:6200,onsclient2.sumsky.net:6200
恭喜,您已成功地将一个新节点添加到了四节点的现有配置。下表显示了新配置。
数据库名 | 节点编号 | 数据库版本 | 实例编号 | 操作系统内核版本 | 文件系统 | 集群管理器 |
SSKYDB |
五个节点 — oradb1、oradb2、oradb3、oradb4 和 oradb5 |
10.2.0.1 |
五个实例 — SSKY1、SSKY2、SSKY3、SSKY4 和 SSKY5 |
Red Hat Advanced Server 3.0 |
OCFS 1.0 和 ASM |
Oracle 集群件 |