这篇文章将以Oracle 11gR2 RAC for Linux修改公共网络的网段来讨论如何在不停止数据库实例和集群服务的情况下完成。
>>这里还有三点需要说明一下:
1.公共IP地址和私有IP地址不存储在OCR中,修改主机地址和hosts文件,确保在oifcfg的相同网段即可。
2.修改公共网络相关的IP地址,包括公共IP,VIP,SCAN VIP只会影响外部对数据库的访问,但不会影响RAC本身的运行。
3.私有网络和OCR、Votedisk才会影响Clusterware服务的运行,这两个条件具备RAC核心即可成功启动和运行。
>> 修改步骤:
1.停止Service、nodeapps、LISTENER、vip、scan_listener、scan等和公共网络相关的服务。
2.使用Clusterware oifcfg工具调整Clusterware PUBLIC网络,该设置不需要重启Clusterware即生效,但并不影响当前RAC的运行。
3.修改主机公共网卡IP使其生效,修改hosts,DNS等服务。
4.修改network、nodeapps、scan、scan_listener、实例注册等信息,最后启动Service等服务。
一.停止公共网络相关的服务。
[root@rhel1 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DBFILE1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.FRA1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER.lsnr
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER2.lsnr
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.OCR.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.asm
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.gsd
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net1.network
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net2.network
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.ons
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.registry.acfs
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rhel1
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rhel2
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rhel1
ora.cvu
1 ONLINE ONLINE rhel2
ora.oc4j
1 ONLINE ONLINE rhel2
ora.ractest.db
1 ONLINE ONLINE rhel1 Open
2 ONLINE ONLINE rhel2 Open
ora.ractest.rtser1.svc
1 ONLINE ONLINE rhel1
ora.rhel1.vip
1 ONLINE ONLINE rhel1
ora.rhel2.vip
1 ONLINE ONLINE rhel2
ora.rhelpub21-vip.vip
1 ONLINE OFFLINE
ora.rhelpub22-vip.vip
1 ONLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE rhel1
ora.scan2.vip
1 ONLINE ONLINE rhel2
ora.scan3.vip
1 ONLINE ONLINE rhel1
[root@rhel1 bin]# ./srvctl stop service -d ractest -s rtser1
[root@rhel1 bin]# ./srvctl stop scan_listener
[root@rhel1 bin]# ./srvctl stop scan
[root@rhel1 bin]# ./srvctl stop nodeapps -n rhel1
PRCR-1065 : Failed to stop resource ora.rhel1.vip
CRS-2529: Unable to act on 'ora.rhel1.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
PRCR-1014 : Failed to stop resource ora.net1.network
PRCR-1065 : Failed to stop resource ora.net1.network
CRS-2529: Unable to act on 'ora.net1.network' because that would require stopping or relocating 'ora.rhel1.vip', but the force option was not specified
[root@rhel1 bin]# ./srvctl stop nodeapps -n rhel2
PRCR-1065 : Failed to stop resource ora.rhel2.vip
CRS-2529: Unable to act on 'ora.rhel2.vip' because that would require stopping or relocating 'ora.LISTENER.lsnr', but the force option was not specified
PRCR-1014 : Failed to stop resource ora.net1.network
PRCR-1065 : Failed to stop resource ora.net1.network
CRS-2529: Unable to act on 'ora.net1.network' because that would require stopping or relocating 'ora.cvu', but the force option was not specified
[root@rhel1 bin]# ./srvctl stop listener -n rhel1
[root@rhel1 bin]# ./srvctl stop listener -n rhel2
[root@rhel1 bin]# ./srvctl stop vip -n rhel1
[root@rhel1 bin]# ./srvctl stop vip -n rhel2
[root@rhel1 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DBFILE1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.FRA1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER.lsnr
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.LISTENER2.lsnr
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.OCR.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.asm
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.gsd
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.net1.network
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net2.network
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.ons
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.registry.acfs
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 OFFLINE OFFLINE
ora.LISTENER_SCAN2.lsnr
1 OFFLINE OFFLINE
ora.LISTENER_SCAN3.lsnr
1 OFFLINE OFFLINE
ora.cvu
1 ONLINE ONLINE rhel2
ora.oc4j
1 ONLINE ONLINE rhel2
ora.ractest.db
1 ONLINE ONLINE rhel1 Open
2 ONLINE ONLINE rhel2 Open
ora.ractest.rtser1.svc
1 OFFLINE OFFLINE
ora.rhel1.vip
1 OFFLINE OFFLINE
ora.rhel2.vip
1 OFFLINE OFFLINE
ora.rhelpub21-vip.vip
1 OFFLINE OFFLINE
ora.rhelpub22-vip.vip
1 OFFLINE OFFLINE
ora.scan1.vip
1 OFFLINE OFFLINE
ora.scan2.vip
1 OFFLINE OFFLINE
ora.scan3.vip
1 OFFLINE OFFLINE
二.调整Clusterware PUBLIC网络。
[root@rhel1 bin]# ./oifcfg getif
eth2 10.168.1.0 global cluster_interconnect
eth1 10.168.1.0 global cluster_interconnect
eth0 192.168.4.0 global public
[root@rhel1 bin]# ./oifcfg
Name:
oifcfg - Oracle Interface Configuration Tool.
Usage: oifcfg iflist [-p [-n]]
oifcfg setif {-node | -global} {/:}...
oifcfg getif [-node | -global] [ -if [/] [-type ] ]
oifcfg delif {{-node | -global} [[/]] [-force] | -force}
oifcfg [-help]
- name of the host, as known to a communications network
- name by which the interface is configured in the system
- subnet address of the interface
- type of the interface { cluster_interconnect | public }
[root@rhel1 bin]# ./oifcfg setif -global eth0/10.168.4.0:public
[root@rhel1 bin]# ./oifcfg getif
eth2 10.168.1.0 global cluster_interconnect
eth1 10.168.1.0 global cluster_interconnect
eth0 192.168.4.0 global public
eth0 10.168.4.0 global public
[root@rhel1 bin]# ./oifcfg delif -global eth0/192.168.4.0
[root@rhel1 bin]# ./oifcfg getif
eth2 10.168.1.0 global cluster_interconnect
eth1 10.168.1.0 global cluster_interconnect
eth0 10.168.4.0 global public
三.调整两个服务器的网络设置,修改两台服务器的公共IP地址,修改两台服务器hosts文件中的公共网络、VIP网络地址,修改SCAN解析的IP地址。
1).修改hosts文件:
[root@rhel1 bin]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
# Public Network - (eth0)
10.168.4.199 rhel1 rhel1.localdomain
10.168.4.200 rhel2 rhel2.localdomain
192.168.4.231 rhel3 rhel3.localdomain
192.168.4.233 rhel4 rhel4.localdomain
10.168.6.199 rheldg1 rheldg1.localdomain
# Private Interconnect - (eth1)
10.168.1.134 rhel1-priv
10.168.1.187 rhel2-priv
10.168.4.117 rhel1-vip
10.168.4.114 rhel2-vip
# Private Storage Network for Openfiler - (eth2)
192.168.2.11 openfiler1
192.168.4.2 LIUBINGLIN-PC
172.168.4.2 rhelpub21
172.168.4.4 rhelpub21-vip
172.168.4.3 rhelpub22
172.168.4.5 rhelpub22-vip
2).整个调整过程都不应该影响到私有网络的运行,Linux执行如下的命令重启单个网卡:
[root@rhel1 network-scripts]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:36:71:78:38
inet addr:192.168.4.199 Bcast:192.168.4.255 Mask:255.255.255.0
inet6 addr: fe80::216:36ff:fe71:7838/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:50 errors:0 dropped:0 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3274 (3.1 KiB) TX bytes:8519 (8.3 KiB)
[root@rhel1 network-scripts]# ifdown eth0
[root@rhel1 network-scripts]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:36:71:78:38
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:54 errors:0 dropped:0 overruns:0 frame:0
TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3442 (3.3 KiB) TX bytes:8589 (8.3 KiB)
[root@rhel1 network-scripts]# ifup eth0
[root@rhel1 network-scripts]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:36:71:78:38
inet addr:10.168.4.199 Bcast:10.168.4.255 Mask:255.255.255.0
inet6 addr: fe80::216:36ff:fe71:7838/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:378 (378.0 b) TX bytes:6869 (6.7 KiB)
四.修改network、nodeapps、scan、scan_listener、实例注册等信息,最后启动Service等服务。
1).用新的IP地址重新登录到服务器:
[root@rhel1 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DBFILE1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.FRA1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER.lsnr
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.LISTENER2.lsnr
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.OCR.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.asm
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.gsd
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.net1.network
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.net2.network
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.ons
OFFLINE OFFLINE rhel1
OFFLINE OFFLINE rhel2
ora.registry.acfs
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 OFFLINE OFFLINE
ora.LISTENER_SCAN2.lsnr
1 OFFLINE OFFLINE
ora.LISTENER_SCAN3.lsnr
1 OFFLINE OFFLINE
ora.cvu
1 ONLINE OFFLINE
ora.oc4j
1 ONLINE ONLINE rhel2
ora.ractest.db
1 ONLINE ONLINE rhel1 Open
2 ONLINE ONLINE rhel2 Open
ora.ractest.rtser1.svc
1 OFFLINE OFFLINE
ora.rhel1.vip
1 OFFLINE OFFLINE
ora.rhel2.vip
1 OFFLINE OFFLINE
ora.rhelpub21-vip.vip
1 OFFLINE OFFLINE
ora.rhelpub22-vip.vip
1 OFFLINE OFFLINE
ora.scan1.vip
1 OFFLINE OFFLINE
ora.scan2.vip
1 OFFLINE OFFLINE
ora.scan3.vip
1 OFFLINE OFFLINE
2).调整network资源IP网络:
[root@rhel1 bin]# ./srvctl modify network -h
Modifies a network configuration in the Oracle Clusterware.
Usage: srvctl modify network [-k ] [-S /[/if1[|if2...]]] [-w ] [-v]
-k network number (default number is 1)
-S //[if1[|if2...]] NET address spec for network
-w The network type (static, dhcp, mixed)
-h Print usage
-v Verbose output
[root@rhel1 bin]# ./srvctl modify network -k 1 -S 10.168.4.0/255.255.255.0/eth0
3).调整VIP资源IP地址:
[root@rhel1 bin]# ./srvctl modify nodeapps -h
Modifies the configuration for a node application.
Usage: srvctl modify nodeapps {[-n -A /[/if1[|if2|...]]] | [-S /[/if1[|if2|...]]]} [-u {static|dhcp|mixed}] [-e ] [ -l ] [-r ] [-t [:][,[:]...]] [-v]
-A Node level Virtual IP address
-S //[if1[|if2...]] NET address spec for network
-u The network server type (static, dhcp, mixed)
-e Local listen port for Enterprise Manager (Default port number is 2016)
-l ONS listening port for local client connections
-r ONS listening port for connections from remote hosts
-t [:][,[:]...] List of remote host/port pairs for ONS daemons outside this cluster
-h Print usage
-v Verbose output
[root@rhel1 bin]# ./srvctl modify nodeapps -n rhel1 -A rhel1-vip/255.255.255.0/eth0
[root@rhel1 bin]# ./srvctl modify nodeapps -n rhel2 -A rhel2-vip/255.255.255.0/eth0
4).重建SCAN LISTENER和SCAN:
[root@rhel1 bin]# ./srvctl remove scan_listener
Remove scan listener? (y/[n]) y
j[root@rhel1 bin]#
[root@rhel1 bin]#
[root@rhel1 bin]# ./srvctl remove scan
Remove the scan? (y/[n]) y
[root@rhel1 bin]# ./srvctl add scan -h
Adds a SCAN VIP to the Oracle Clusterware.
Usage: srvctl add scan -n [-k [-S /[/if1[|if2|...]]]]
-n Domain name qualified SCAN name
-k network number (default number is 1)
-S //[if1[|if2...]] NET address spec for network
-h Print usage
[root@rhel1 bin]# ./srvctl add scan -n rhel-cluster-scan -k 1
[root@rhel1 bin]# ./srvctl add scan_listener
5).启动两台服务器Nodeapps资源:
[root@rhel1 bin]# ./srvctl start nodeapps -n rhel1
PRKO-2421 : Network resource is already started on node(s): rhel1
[root@rhel1 bin]# ./srvctl start nodeapps -n rhel2
PRKO-2421 : Network resource is already started on node(s): rhel2
6).启动SCAN和SCAN_LISTENER资源:
[root@rhel1 bin]# ./srvctl start scan
[root@rhel1 bin]# ./srvctl start scan_listener
7).启动本地监听器:
[root@rhel1 bin]# ./srvctl start listener -n rhel1
PRCR-1013 : Failed to start resource ora.LISTENER2.lsnr
PRCR-1064 : Failed to start resource ora.LISTENER2.lsnr on node rhel1
CRS-2674: Start of 'ora.net2.network' on 'rhel1' failed
[root@rhel1 bin]# ./srvctl start listener -n rhel2
PRCR-1013 : Failed to start resource ora.LISTENER2.lsnr
PRCR-1064 : Failed to start resource ora.LISTENER2.lsnr on node rhel2
CRS-2674: Start of 'ora.net2.network' on 'rhel2' failed
8).检查资源状态:
[root@rhel1 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DBFILE1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.FRA1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER.lsnr
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER2.lsnr
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.OCR.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.asm
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.gsd
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net1.network
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net2.network
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.ons
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.registry.acfs
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rhel1
ora.cvu
1 ONLINE OFFLINE
ora.oc4j
1 ONLINE ONLINE rhel2
ora.ractest.db
1 ONLINE ONLINE rhel1 Open
2 ONLINE ONLINE rhel2 Open
ora.ractest.rtser1.svc
1 OFFLINE OFFLINE
ora.rhel1.vip
1 ONLINE ONLINE rhel1
ora.rhel2.vip
1 ONLINE ONLINE rhel2
ora.rhelpub21-vip.vip
1 ONLINE OFFLINE
ora.rhelpub22-vip.vip
1 ONLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE rhel1
所有跟公共网络相关的服务已经启动正常。
9).修改数据库注册信息:
[root@rhel1 bin]# su - grid
[grid@rhel1 ~]$ lsnrctl stat listener_scan1
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 20-MAR-2014 20:24:07
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 20-MAR-2014 20:22:15
Uptime 0 days 0 hr. 1 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/rhel1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.245)(PORT=1521)))
The listener supports no services
The command completed successfully
[grid@rhel1 ~]$ lsnrctl stat listener
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 20-MAR-2014 20:24:11
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 20-MAR-2014 20:23:32
Uptime 0 days 0 hr. 0 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/rhel1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.199)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.117)(PORT=1521)))
The listener supports no services
The command completed successfully
[grid@rhel1 ~]$ exit
logout
[root@rhel1 bin]# su - oracle
[oracle@rhel1 ~]$ sql
SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 20 20:24:55 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter remote_liste
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_listener string rhel-cluster-scan.grid.example
.com.:1521
SQL> alter system set remote_listener='10.168.4.245:1521';
System altered.
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.4.117)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.168.4.117)(PORT=1521))))' sid='ractest1';
System altered.
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.168.4.114)(PORT=1521))))' sid='ractest2';
System altered.
SQL> alter system register;
System altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@rhel1 ~]$ exit
logout
[root@rhel1 bin]# su - grid
[grid@rhel1 ~]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 20-MAR-2014 20:27:01
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 20-MAR-2014 20:22:15
Uptime 0 days 0 hr. 4 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/rhel1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.245)(PORT=1521)))
Services Summary...
Service "ractest" has 2 instance(s).
Instance "ractest1", status READY, has 1 handler(s) for this service...
Instance "ractest2", status READY, has 1 handler(s) for this service...
Service "ractestXDB" has 2 instance(s).
Instance "ractest1", status READY, has 1 handler(s) for this service...
Instance "ractest2", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@rhel1 ~]$ lsnrctl status listener
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 20-MAR-2014 20:27:07
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 20-MAR-2014 20:23:32
Uptime 0 days 0 hr. 3 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/rhel1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.199)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.117)(PORT=1521)))
Services Summary...
Service "ractest" has 1 instance(s).
Instance "ractest1", status READY, has 1 handler(s) for this service...
Service "ractestXDB" has 1 instance(s).
Instance "ractest1", status READY, has 1 handler(s) for this service...
The command completed successfully
第二个节点本地监听状态:
[grid@rhel2 ~]$ lsnrctl status listener
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 20-MAR-2014 20:28:40
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 20-MAR-2014 20:23:43
Uptime 0 days 0 hr. 4 min. 57 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/rhel2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.200)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.168.4.114)(PORT=1521)))
Services Summary...
Service "ractest" has 1 instance(s).
Instance "ractest2", status READY, has 1 handler(s) for this service...
Service "ractestXDB" has 1 instance(s).
Instance "ractest2", status READY, has 1 handler(s) for this service...
The command completed successfully
10).启动Service服务:
[root@rhel1 bin]# ./srvctl start service -d ractest -s rtser1
11).检查资源状态:
[root@rhel1 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DBFILE1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.FRA1.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER.lsnr
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.LISTENER2.lsnr
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.OCR.dg
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.asm
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.gsd
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net1.network
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.net2.network
ONLINE OFFLINE rhel1
ONLINE OFFLINE rhel2
ora.ons
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
ora.registry.acfs
ONLINE ONLINE rhel1
ONLINE ONLINE rhel2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rhel1
ora.cvu
1 ONLINE OFFLINE
ora.oc4j
1 ONLINE ONLINE rhel2
ora.ractest.db
1 ONLINE ONLINE rhel1 Open
2 ONLINE ONLINE rhel2 Open
ora.ractest.rtser1.svc
1 ONLINE ONLINE rhel1
ora.rhel1.vip
1 ONLINE ONLINE rhel1
ora.rhel2.vip
1 ONLINE ONLINE rhel2
ora.rhelpub21-vip.vip
1 ONLINE OFFLINE
ora.rhelpub22-vip.vip
1 ONLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE rhel1
--end--