11G RAC 一节点宕机后修改监听相关配置使通过宕机节点VIP连接数据库的客户端可以连接
来源:互联网 发布:怪物猎人捏脸数据库女 编辑:程序博客网 时间:2024/06/05 08:34
11.2.0.4 RAC,一个节点宕机,此时VIP FAILOVER到了另一节点。
此时存在大量客户端连接,客户端使用VIP连接到数据库服务器;
且一半客户端为连接节点1 VIP,另一半客户端为连接节点2 VIP。
此时为了快速恢复客户端到数据库连接,使用在服务器端修改监听相关配置,使存活的数据库实例注册到VIP1/VIP2。
1.查看FAILOVER后存活节点上的IP状态信息:
[grid@bys1 admin]$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.215 Bcast:192.168.57.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe29:4bb4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3383 errors:0 dropped:0 overruns:0 frame:0
TX packets:3107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:307995 (300.7 KiB) TX bytes:388155 (379.0 KiB)
eth0:1 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.219 Bcast:192.168.57.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:2 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.218 Bcast:192.168.57.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:3 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.216 Bcast:192.168.57.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:64:B0:1C
inet addr:192.168.58.1 Bcast:192.168.58.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe64:b01c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:364 errors:0 dropped:0 overruns:0 frame:0
TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37826 (36.9 KiB) TX bytes:12624 (12.3 KiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:64:B0:1C
inet addr:169.254.167.252 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:21148 errors:0 dropped:0 overruns:0 frame:0
TX packets:21148 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12245612 (11.6 MiB) TX bytes:12245612 (11.6 MiB)
[grid@bys1 admin]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.57.215 bys1.bys.com bys1
192.168.57.216 bys1-vip.bys.com bys1-vip
192.168.57.217 bys2.bys.com bys2
192.168.57.218 bys2-vip.bys.com bys2-vip
192.168.58.1 bys1-priv.bys.com bys1-priv
192.168.58.2 bys2-priv.bys.com bys2-priv
192.168.57.219 bysrac-scan.bys.com bysrac-scan
2.修改GRID下监听配置文件:
[grid@bys1 admin]$ cat listener.ora
#LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
###ADD BY DBA
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.57.215)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.57.216)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.57.218)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
###
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
3.修改数据库local_listener参数
11.2.0.4 local_listener 默认是注册到本节点的VIP上。
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=
192.168.57.216)(PORT=1521))
SQL> alter system set local_listener='';
System altered.
修改为空值,则向本主机上所有IP地址注册。
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
log_archive_local_first boolean TRUE
parallel_force_local boolean FALSE
4.登陆测试:使用本机公网IP、VIP、宕机节点的VIP均可以连接--192.168.57.215/216/218
[oracle@bys1 ~]$ sqlplus system/oracle@192.168.57.215:1521/bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 14:46:19 2016
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, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
SQL> exit
[oracle@bys1 ~]$ sqlplus system/oracle@192.168.57.216:1521/bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 14:46:23 2016
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, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
SQL> exit
[oracle@bys1 ~]$ sqlplus system/oracle@192.168.57.218:1521/bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 14:46:28 2016
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, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
SQL> exit
此时存在大量客户端连接,客户端使用VIP连接到数据库服务器;
且一半客户端为连接节点1 VIP,另一半客户端为连接节点2 VIP。
此时为了快速恢复客户端到数据库连接,使用在服务器端修改监听相关配置,使存活的数据库实例注册到VIP1/VIP2。
客户端可以不进行修改的连接到数据库。
----------------需求比较扯,最好还是用11G的SCAN IP。
1.查看FAILOVER后存活节点上的IP状态信息:
[grid@bys1 admin]$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.215 Bcast:192.168.57.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe29:4bb4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3383 errors:0 dropped:0 overruns:0 frame:0
TX packets:3107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:307995 (300.7 KiB) TX bytes:388155 (379.0 KiB)
eth0:1 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.219 Bcast:192.168.57.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:2 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.218 Bcast:192.168.57.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:3 Link encap:Ethernet HWaddr 08:00:27:29:4B:B4
inet addr:192.168.57.216 Bcast:192.168.57.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:64:B0:1C
inet addr:192.168.58.1 Bcast:192.168.58.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe64:b01c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:364 errors:0 dropped:0 overruns:0 frame:0
TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37826 (36.9 KiB) TX bytes:12624 (12.3 KiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:64:B0:1C
inet addr:169.254.167.252 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:21148 errors:0 dropped:0 overruns:0 frame:0
TX packets:21148 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12245612 (11.6 MiB) TX bytes:12245612 (11.6 MiB)
[grid@bys1 admin]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.57.215 bys1.bys.com bys1
192.168.57.216 bys1-vip.bys.com bys1-vip
192.168.57.217 bys2.bys.com bys2
192.168.57.218 bys2-vip.bys.com bys2-vip
192.168.58.1 bys1-priv.bys.com bys1-priv
192.168.58.2 bys2-priv.bys.com bys2-priv
192.168.57.219 bysrac-scan.bys.com bysrac-scan
2.修改GRID下监听配置文件:
[grid@bys1 admin]$ cat listener.ora
#LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
###ADD BY DBA
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.57.215)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.57.216)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.57.218)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
###
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
3.修改数据库local_listener参数
11.2.0.4 local_listener 默认是注册到本节点的VIP上。
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=
192.168.57.216)(PORT=1521))
SQL> alter system set local_listener='';
System altered.
修改为空值,则向本主机上所有IP地址注册。
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
log_archive_local_first boolean TRUE
parallel_force_local boolean FALSE
4.登陆测试:使用本机公网IP、VIP、宕机节点的VIP均可以连接--192.168.57.215/216/218
[oracle@bys1 ~]$ sqlplus system/oracle@192.168.57.215:1521/bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 14:46:19 2016
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, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
SQL> exit
[oracle@bys1 ~]$ sqlplus system/oracle@192.168.57.216:1521/bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 14:46:23 2016
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, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
SQL> exit
[oracle@bys1 ~]$ sqlplus system/oracle@192.168.57.218:1521/bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 17 14:46:28 2016
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, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options
SQL> exit
0 0
- 11G RAC 一节点宕机后修改监听相关配置使通过宕机节点VIP连接数据库的客户端可以连接
- 10G RAC节点2宕机通过修改listener.ora实现客户端通过节点2VIP连接到数据库
- 解决oracle客户端可以连接11g rac vip,但是不能连接scan ip问题
- oracle 客户端可以连接11g rac vip 但是不能连接scan ip问题
- 10G RAC VIP漂移后客户端的连接
- 关于10g RAC监听设置,tnsnames.ora设置,VIP及客户端配置问题
- RAC(10g) 连接配置
- 客户端使用SCNAIP连接11G RAC数据库报错ORA-12545解决
- 客户端使用SCNAIP连接11G RAC数据库报错ORA-12545解决
- oracle客户端连接两节点RAC集群的配置文件
- 11g RAC 加节点 之 手动添加vip 资源
- Oracle 10g RAC 客户端连接不稳定
- 通过监听连接数据库的整个过程
- oracle 11g RAC 修改public ip ,vip , scan ip
- oracle 11g RAC 修改public ip ,vip , scan ip
- Oracle 11G RAC 本地时间和通过listener连接时间不相同的问题
- Oracle RAC 11g 通过SCAN连接遇到ORA-12170错误的解决办法
- 11G rac修改监听端口
- SqlServer——全文索引
- 页面静态化实现——根据模板动态创建静态页
- 图片上传和显示——上传图片——上传文件)==ZJ
- 清空KindEditor富文本编辑器里面的内容方法
- MVC中使用Ajax提交数据 Jquery Ajax方法传值到action
- 11G RAC 一节点宕机后修改监听相关配置使通过宕机节点VIP连接数据库的客户端可以连接
- 牛逼的OSQL----大数据导入
- 从无到有系列之flume-安装部署01
- mysql忘记密码怎么办?
- 权限设计与总结——用户,角色,权限
- Java中的类加载器概述
- 实现解耦-Spring.Net
- unity鼠标跟随实现(ITween)
- T4模板——一个神奇的代码生成器