重建scan监听命令
(1)查看集群各资源状态
crsctl stat res -t
(2)停止现有scan监听
srvctl stop scan_listener
(3)移除集群中scan监听
srvctl remove scan_listener
(4)添加新的scan监听
srvctl add scan_listener -l LISTENER
(5)查看集群监听是否添加成功
crsctl stat res –t
(6)开启scan监听
srvctl start scan_listener
1、查看集群中监听的状态
[root@vast1 ~]# su - grid
[grid@vast1 ~]$ crsctl stat res -t
------------------------------------------- -------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
Cluster Resources
-------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE vast2
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE vast1
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE vast1
ora.cvu
1 ONLINE ONLINE vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
2、停掉现有scan监听
[grid@vast1 ~]$ srvctl stop scan_listener
[grid@vast1 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
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 vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
3、分别查看三个scan_listener状态,均为关闭
[grid@vast1 ~]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-OCT-2016 08:18:06
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
[grid@vast1 ~]$ lsnrctl status listener_scan2
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-OCT-2016 08:18:08
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
[grid@vast1 ~]$ lsnrctl status listener_scan3
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-OCT-2016 08:18:09
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
4、移除集群中scan监听 查看集群状态中scan监听已经消失。
[grid@vast1 ~]$ srvctl remove scan_listener
Remove scan listener? (y/[n]) y
[grid@vast1 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
Cluster Resources
-------------------------------------------------------------------------------
ora.cvu
1 ONLINE ONLINE vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
5.添加scan监听,集群会根据/etc/hosts文件中的scanIP来创建scan监听
[grid@vast1 ~]$ srvctl add scan_listener -l LISTENER
[grid@vast1 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
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 vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
6、开启scan监听
[grid@vast1 ~]$ srvctl start scan_listener
[grid@vast1 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
Cluster Resources
-------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE vast2
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE vast1
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE vast1
ora.cvu
1 ONLINE ONLINE vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
7分别查看scan监听状态
[grid@vast1 ~]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-OCT-2016 08:19:11
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
这里发现listener_scan1没有开启,不必担心,是因为listener_scan1在节点二上,这个可以从集群信息中看到。
[grid@vast1 ~]$ lsnrctl status listener_scan2
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-OCT-2016 08:19:17
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN2
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 24-OCT-2016 08:18:58
Uptime 0 days 0 hr. 0 min. 19 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/vast1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.112)(PORT=1521)))
The listener supports no services
The command completed successfully
[grid@vast1 ~]$ lsnrctl status listener_scan3
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-OCT-2016 08:19:19
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN3
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 24-OCT-2016 08:18:59
Uptime 0 days 0 hr. 0 min. 20 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/vast1/listener_scan3/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.113)(PORT=1521)))
The listener supports no services
The command completed successfully
这是发现scan_listener中还是没有数据库的信息,不必担心,等一会儿到周期,数据库就会将信息动态推送给scan_listener(大概1分钟左右)。
如果时间太久,还是没有信息则尝试手动推送一下。命令如下
[root@vast1 ~]# su - oracle
[oracle@vast1 ~]$ sqlplus / as sysdba;
SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 24 08:39:49 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@rac1> alter system register;
System altered.
-------End---------
2016.10.24
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30820196/viewspace-2126982/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30820196/viewspace-2126982/