在给客户作rac备份的时候出错,结果发现是vip配置问题,于是修改了一把vip。简单记录一下过程。
allocated channel: c1
channel c1: sid=127 instance=oradb1 devtype=DISK
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-12001: could not open channel c2
RMAN-10008: could not create channel context
RMAN-10003: unable to connect to target database
ORA-12560: TNS:protocol adapter error
RMAN> exit
Recovery Manager complete.
检查报错日志
oracle@rac01 ~]$ cat sqlnet.log
***********************************************************************
Fatal NI connect error 12560, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac02-vip)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=oradb)(INSTANCE_NAME=oradb2)(CID=(PROGRAM=rman)(HOST=rac01)(USER=oracle))))
VERSION INFORMATION:
TNS for Linux: Version 10.2.0.1.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
Time: 10-MAR-2013 15:05:31
Tracing not turned on.
Tns error struct:
ns main err code: 12560
TNS-12560: TNS:protocol adapter error
ns secondary err code: 0
nt main err code: 530
TNS-00530: Protocol adapter error
nt secondary err code: 113
nt OS err code: 0
[oracle@rac01 ~]$ cd
[oracle@rac01 ~]$
[oracle@rac01 ~]$
[oracle@rac01 ~]$
[oracle@rac01 ~]$ tnsping oradb2
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 10-MAR-2013 15:05:53
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac02-vip)(PORT = 1521)) (CONNECT_DATA =
(SERVER = DEDICATED) (SERVICE_NAME = oradb) (INSTANCE_NAME = oradb2)))
TNS-12560: TNS:protocol adapter error
[oracle@rac01 ~]$
[root@rac01 bin]# ping 192.168.1.14
PING 192.168.1.14 (192.168.1.14) 56(84) bytes of data.
From 192.168.1.12 icmp_seq=1 Destination Host Unreachable
From 192.168.1.12 icmp_seq=2 Destination Host Unreachable
From 192.168.1.12 icmp_seq=3 Destination Host Unreachable
From 192.168.1.12 icmp_seq=4 Destination Host Unreachable
From 192.168.1.12 icmp_seq=5 Destination Host Unreachable
From 192.168.1.12 icmp_seq=6 Destination Host Unreachable
From 192.168.1.12 icmp_seq=8 Destination Host Unreachable
From 192.168.1.12 icmp_seq=9 Destination Host Unreachable
From 192.168.1.12 icmp_seq=10 Destination Host Unreachable
[root@rac01 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application ONLINE ONLINE rac01
ora....b1.inst application ONLINE ONLINE rac01
ora....b2.inst application ONLINE ONLINE rac02
ora....SM1.asm application ONLINE ONLINE rac01
ora....01.lsnr application ONLINE OFFLINE
ora.rac01.gsd application ONLINE ONLINE rac01
ora.rac01.ons application ONLINE ONLINE rac01
ora.rac01.vip application ONLINE ONLINE rac01
ora....SM2.asm application ONLINE ONLINE rac02
ora....02.lsnr application ONLINE OFFLINE
ora.rac02.gsd application ONLINE ONLINE rac02
ora.rac02.ons application ONLINE ONLINE rac02
ora.rac02.vip application ONLINE ONLINE rac02
root@rac01 bin]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:E0:95:A2
inet addr:192.168.139.11 Bcast:192.168.139.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9781 errors:0 dropped:0 overruns:0 frame:0
TX packets:8606 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:891414 (870.5 KiB) TX bytes:1105611 (1.0 MiB)
Interrupt:185 Base address:0x1480
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:E0:95:A2
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x1480
这个问题,汗,vip都没配置好
127.0.0.1 localhost.localdomain localhost
# Public
192.168.139.11 rac01
192.168.139.13 rac02
#Private
10.1.1.11 rac01-priv
10.1.1.13 rac02-priv
#Virtual
192.168.1.12 rac01-vip
192.168.1.14 rac02-vip
srvctl stop database -d oradb
[root@rac01 bin]# ./srvctl stop database -d oradb
[root@rac01 bin]#
[root@rac01 bin]#
[root@rac01 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE rac01
ora....01.lsnr application ONLINE OFFLINE
ora.rac01.gsd application ONLINE ONLINE rac01
ora.rac01.ons application ONLINE ONLINE rac01
ora.rac01.vip application ONLINE ONLINE rac01
ora....SM2.asm application ONLINE ONLINE rac02
ora....02.lsnr application ONLINE OFFLINE
ora.rac02.gsd application ONLINE ONLINE rac02
ora.rac02.ons application ONLINE ONLINE rac02
ora.rac02.vip application ONLINE ONLINE rac02
[root@rac01 bin]# ./srvctl stop asm -n rac01
[root@rac01 bin]# ./srvctl stop asm -n rac02
[root@rac01 bin]# ./srvctl stop nodeapps -n rac01
[root@rac01 bin]# ./srvctl stop nodeapps -n rac02
确认crs各资源关闭
[root@rac01 bin]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:E0:95:A2
inet addr:192.168.139.11 Bcast:192.168.139.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10422 errors:0 dropped:0 overruns:0 frame:0
TX packets:9101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:951346 (929.0 KiB) TX bytes:1168800 (1.1 MiB)
Interrupt:185 Base address:0x1480
eth1 Link encap:Ethernet HWaddr 00:0C:29:E0:95:AC
inet addr:10.1.1.11 Bcast:10.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:74864 errors:0 dropped:0 overruns:0 frame:0
TX packets:123800 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32228003 (30.7 MiB) TX bytes:110429517 (105.3 MiB)
Interrupt:193 Base address:0x1800
or
[root@rac01 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....01.lsnr application OFFLINE OFFLINE
ora.rac01.gsd application OFFLINE OFFLINE
ora.rac01.ons application OFFLINE OFFLINE
ora.rac01.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....02.lsnr application OFFLINE OFFLINE
ora.rac02.gsd application OFFLINE OFFLINE
ora.rac02.ons application OFFLINE OFFLINE
ora.rac02.vip application OFFLINE OFFLINE
修改hosts文件
127.0.0.1 localhost.localdomain localhost
# Public
192.168.139.11 rac01
192.168.139.13 rac02
#Private
10.1.1.11 rac01-priv
10.1.1.13 rac02-priv
#Virtual
192.168.1.12 rac01-vip
192.168.1.14 rac02-vip
修改vip
./srvctl modify nodeapps -n rac01 -A 192.168.139.12/255.255.255.0/eth0
./srvctl modify nodeapps -n rac02 -A 192.168.139.14/255.255.255.0/eth0
启动各资源:
./srvctl start asm -n rac01
./srvctl start asm -n rac02
./srvctl start nodeapps -n rac01
./srvctl start nodeapps -n rac02
./srvctl start instance -d oradb -i oradb1
./srvctl start instance -d oradb -i oradb2
检查crs状态
[root@rac02 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application ONLINE ONLINE rac02
ora....b1.inst application ONLINE ONLINE rac01
ora....b2.inst application ONLINE ONLINE rac02
ora....SM1.asm application ONLINE ONLINE rac01
ora....01.lsnr application ONLINE ONLINE rac01
ora.rac01.gsd application ONLINE ONLINE rac01
ora.rac01.ons application ONLINE ONLINE rac01
ora.rac01.vip application ONLINE ONLINE rac01
ora....SM2.asm application ONLINE ONLINE rac02
ora....02.lsnr application ONLINE ONLINE rac02
ora.rac02.gsd application ONLINE ONLINE rac02
ora.rac02.ons application ONLINE ONLINE rac02
ora.rac02.vip application ONLINE ONLINE rac02
node1:
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.139.12)(PORT=1521))';
node2:
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.139.14)(PORT=1521))';
检查网卡状态:
第一个节点
[root@rac01 bin]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E0:95:A2
inet addr:192.168.139.11 Bcast:192.168.139.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11180 errors:0 dropped:0 overruns:0 frame:0
TX packets:9831 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1016533 (992.7 KiB) TX bytes:1268645 (1.2 MiB)
Interrupt:185 Base address:0x1480
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:E0:95:A2
inet addr:192.168.139.12 Bcast:192.168.139.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x1480
eth1 Link encap:Ethernet HWaddr 00:0C:29:E0:95:AC
inet addr:10.1.1.11 Bcast:10.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:93729 errors:0 dropped:0 overruns:0 frame:0
TX packets:160551 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39079638 (37.2 MiB) TX bytes:144369432 (137.6 MiB)
Interrupt:193 Base address:0x1800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:31344 errors:0 dropped:0 overruns:0 frame:0
TX packets:31344 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15888366 (15.1 MiB) TX bytes:15888366 (15.1 MiB)
第二个节点:
[root@rac02 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:20:5F:E1
inet addr:192.168.139.13 Bcast:192.168.139.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:959 errors:0 dropped:0 overruns:0 frame:0
TX packets:891 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:82712 (80.7 KiB) TX bytes:121614 (118.7 KiB)
Interrupt:185 Base address:0x1480
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:20:5F:E1
inet addr:192.168.139.14 Bcast:192.168.139.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0x1480
eth1 Link encap:Ethernet HWaddr 00:0C:29:20:5F:EB
inet addr:10.1.1.13 Bcast:10.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2824 errors:0 dropped:0 overruns:0 frame:0
TX packets:2285 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3116242 (2.9 MiB) TX bytes:1797326 (1.7 MiB)
Interrupt:193 Base address:0x1800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2014 errors:0 dropped:0 overruns:0 frame:0
TX packets:2014 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3336197 (3.1 MiB) TX bytes:3336197 (3.1 MiB)
网卡状态正常,vip已经成功修改。
OK,Complete
-- The End --