crsctl的使用 11gR2 RAC (start,stop,status:部分)

停止RAC的步骤:

先停止数据库

Srvctl stop database -d racdb (10g)

Crsctl stop res ora.racdb.db (11gR2)

root用户下

Cd $CRS_HOME/bin

./crsctl stop cluster -all

在各个借点上 ps -ef | grep crs

如果还有的话 需要多执行几次

[root@node1 ~]# su - grid

[grid@node1 ~]$ crsctl -h

Usage: crsctl add - add a resource, type or other entity

crsctl check - check a service, resource or other entity

crsctl config - output autostart configuration

crsctl debug - obtain or modify debug state

crsctl delete - delete a resource, type or other entity

crsctl disable - disable autostart

crsctl discover - discover DHCP server

crsctl enable - enable autostart

crsctl get - get an entity value

crsctl getperm - get entity permissions

crsctl lsmodules - list debug modules

crsctl modify - modify a resource, type or other entity

crsctl query - query service state

crsctl pin - pin the nodes in the node list

crsctl relocate - relocate a resource, server or other entity

crsctl replace - replaces the location of voting files

crsctl release - release a DHCP lease

crsctl request - request a DHCP lease

crsctl setperm - set entity permissions

crsctl set - set an entity value

crsctl start - start a resource, server or other entity

crsctl status - get status of a resource or other entity

crsctl stop - stop a resource, server or other entity

crsctl unpin - unpin the nodes in the node list

crsctl unset - unset an entity value, restoring its default

[grid@node1 grid]$ crsctl stat res -init -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.asm

1 ONLINE ONLINE node1 Started

ora.cluster_interconnect.haip

1 ONLINE ONLINE node1

ora.crf

1 ONLINE ONLINE node1

ora.crsd

1 ONLINE ONLINE node1

ora.cssd

1 ONLINE ONLINE node1

ora.cssdmonitor

1 ONLINE ONLINE node1

ora.ctssd

1 ONLINE ONLINE node1 OBSERVER

ora.diskmon

1 OFFLINE OFFLINE

ora.drivers.acfs

1 ONLINE ONLINE node1

ora.evmd

1 ONLINE ONLINE node1

ora.gipcd

1 ONLINE ONLINE node1

ora.gpnpd

1 ONLINE ONLINE node1

ora.mdnsd

1 ONLINE ONLINE node1

[root@db1 ~]# crsctl start -h

Usage:

  crsctl start resource {<resName> [...]|-w <filter>]|-all} [-n <server>] [-k <cid>] [-d <did>] [-env "env1=val1,env2=val2,..."] [-f] [-i]

     Start designated resources

where

     resName [...]    One or more blank-separated resource names

     -w               Resource filter

     -all             All resources

     -n               Server name

     -k               Resource cardinality ID

     -d               Resource degree ID

     -env             Attribute overrides for this command

     -f               Force option

     -i               Fail if request cannot be processed immediately

   

   

  crsctl start crs [-excl [-nocrs]|-nowait]

     Start OHAS on this server

where

     -excl        Start Oracle Clusterware in exclusive mode

     -nocrs       Start Oracle Clusterware in exclusive mode without starting CRS

     -nowait      Do not wait for OHAS to start

   

  crsctl start cluster [[-all]|[-n <server>[...]]]

    Start CRS stack

where

    Default         Start local server

    -all            Start all servers

    -n              Start named servers

    server [...]    One or more blank-separated server names

   

   

   

  crsctl start ip -A {<IP_name>|<IP_address>}/<net_mask>/<interface_name>

    Start an IP on the given interface with specified net mask

Where

    IP_name              Name which resolves to an IP. If it is not a fully qualified domain name then standard name search will be used.

    IP_address           IP address

    net_mask             Subnet mask for the IP to start

    interface_name       Interface on which to start the IP

   

  crsctl start testdns [-address <IP_address>] [-port <port>][-domain <GNS_domain>] [-once][-v]

    Start a test DNS listener that listens on the given address at the given port and for specified domain

Where

    IP_address          IP address to be used by the listener (defaults to hostname)

    port                The port on which the listener will listen. Default value is 53.

    domain              The domain query for which to listen. By default, all domain queries are processed.

   

    -once               Flag indicating that DNS listener should exit after one DNS query packet is received

    -v                  Verbose output

   

   

   

[root@db1 ~]# crsctl status -h

Usage:

  crsctl status {resource|type|serverpool|server} [<name>|-w <filter>] [-g]

where

    name   CRS entity name

    -w     CRS entity filter

    -g     Check if CRS entities are registered

   

  crsctl status ip -A {<IP_name>|<IP_address>}

     Check if the IP is alive

Where

     IP_name        Name which resolves to an IP. If name is not fully qualified domain name then standard name search will be used.

     IP_address     IP address

   

  crsctl status testdns [-address <IP_address>] [-port <port>] [-v]

     Check status of DNS server for specified domain

Where

     IP_address          DNS server address (defaults to hostname)

     port                The port on which the DNS server is listening. Default value for the port is 53.

     -v                  Verbose output

   

   

几个进程的起停初体验:

ora.LISTENER_SCAN1.lsnr 停止后无法tnsping racdb , SCAN-IP 消失

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE node2

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

   

[root@node2 bin]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.110 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:1195/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3547420 errors:0 dropped:0 overruns:0 frame:0

TX packets:3711508 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:3128064842 (2.9 GiB) TX bytes:2238844007 (2.0 GiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.111 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.113 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:100.100.100.101 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:119f/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1489323 errors:0 dropped:0 overruns:0 frame:0

TX packets:1634560 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:819883966 (781.9 MiB) TX bytes:1037838446 (989.7 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:169.254.76.155 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:371539 errors:0 dropped:0 overruns:0 frame:0

TX packets:371539 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:377373388 (359.8 MiB) TX bytes:377373388 (359.8 MiB)

   

[oracle@node1 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:14:40

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

OK (10 msec)

   

[oracle@node2 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:15:04

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

OK (30 msec)

   

------停止该resource

[grid@node2 ~]$ crsctl stop res ora.LISTENER_SCAN1.lsnr

CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'node2'

CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'node2' succeeded

   

   

-----查看现象

[root@node2 bin]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.110 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:1195/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3555100 errors:0 dropped:0 overruns:0 frame:0

TX packets:3719931 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:3134544221 (2.9 GiB) TX bytes:2244174003 (2.0 GiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.111 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.113 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:100.100.100.101 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:119f/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1492332 errors:0 dropped:0 overruns:0 frame:0

TX packets:1638463 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:821392982 (783.3 MiB) TX bytes:1040679147 (992.4 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:169.254.76.155 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:372224 errors:0 dropped:0 overruns:0 frame:0

TX packets:372224 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:378079968 (360.5 MiB) TX bytes:378079968 (360.5 MiB)

IP地址还存在

   

[oracle@node2 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:16:20

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

TNS-12541: TNS:no listener

   

[oracle@node1 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:16:23

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

TNS-12541: TNS:no listener

   

[oracle@node1 ~]$ ping scan-cluster1

PING scan-cluster1.racdb.com (192.168.80.113) 56(84) bytes of data.

64 bytes from scan-cluster1.racdb.com (192.168.80.113): icmp_seq=1 ttl=64 time=1.69 ms

64 bytes from scan-cluster1.racdb.com (192.168.80.113): icmp_seq=2 ttl=64 time=0.933 ms

   

--- scan-cluster1.racdb.com ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 1001ms

rtt min/avg/max/mdev = 0.933/1.315/1.698/0.384 ms

   

还可以ping通IP地址,但是监听不存在了,无法对外提供SCAN的服务。

   

------再次启用

ora.LISTENER_SCAN1.lsnr

[grid@node2 ~]$ crsctl start res ora.LISTENER_SCAN1.lsnr

CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'node2'

CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'node2' succeeded

   

   

验证结果

[oracle@node1 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:21:06

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

OK (10 msec)

   

   

[oracle@node2 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:21:02

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

OK (10 msec)

   

   

停止ora.scan1.vip的效果初体验:

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE node2

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

停止ora.scan1.vip

[grid@node2 ~]$ crsctl stop res ora.scan1.vip

CRS-2529: Unable to act on 'ora.scan1.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN1.lsnr', but the force option was not specified

CRS-4000: Command Stop failed, or completed with errors.

   

说明要停止ora.scan1.vip 首先要停止ora.LISTENER_SCAN1.lsnr,OK,那我们来看看 这两个都停止之后会有什么变化:

[grid@node2 ~]$ crsctl stop res ora.LISTENER_SCAN1.lsnr

CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'node2'

CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'node2' succeeded

[grid@node2 ~]$ crsctl stop res ora.scan1.vip

CRS-2673: Attempting to stop 'ora.scan1.vip' on 'node2'

CRS-2677: Stop of 'ora.scan1.vip' on 'node2' succeeded

   

   

首先肯定是SCAN的功能不能使用了,上面我们已经看到了,tnsping racdb不成功。

来看一下 OS上ifconfig是否会有变化:

节点2:

[root@node2 bin]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.110 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:1195/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3555100 errors:0 dropped:0 overruns:0 frame:0

TX packets:3719931 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:3134544221 (2.9 GiB) TX bytes:2244174003 (2.0 GiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.111 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.113 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:100.100.100.101 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:119f/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1492332 errors:0 dropped:0 overruns:0 frame:0

TX packets:1638463 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:821392982 (783.3 MiB) TX bytes:1040679147 (992.4 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:169.254.76.155 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:372224 errors:0 dropped:0 overruns:0 frame:0

TX packets:372224 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:378079968 (360.5 MiB) TX bytes:378079968 (360.5 MiB)

   

[root@node2 bin]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.110 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:1195/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3590546 errors:0 dropped:0 overruns:0 frame:0

TX packets:3758299 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:3164932317 (2.9 GiB) TX bytes:2268033020 (2.1 GiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.111 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:100.100.100.101 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:119f/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1504005 errors:0 dropped:0 overruns:0 frame:0

TX packets:1653899 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:827352986 (789.0 MiB) TX bytes:1051409131 (1002.7 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:169.254.76.155 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:374813 errors:0 dropped:0 overruns:0 frame:0

TX packets:374813 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:380960187 (363.3 MiB) TX bytes:380960187 (363.3 MiB)

   

节点1:

[root@node1 ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:78

inet addr:192.168.80.100 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fefc:cd78/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:594655 errors:0 dropped:0 overruns:0 frame:0

TX packets:551124 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:555018056 (529.3 MiB) TX bytes:220822733 (210.5 MiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:78

inet addr:192.168.80.101 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:82

inet addr:100.100.100.100 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fefc:cd82/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:357441 errors:0 dropped:0 overruns:0 frame:0

TX packets:329024 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:196576541 (187.4 MiB) TX bytes:169371483 (161.5 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:82

inet addr:169.254.218.91 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:84296 errors:0 dropped:0 overruns:0 frame:0

TX packets:84296 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:66181015 (63.1 MiB) TX bytes:66181015 (63.1 MiB)

   

[root@node1 ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:78

inet addr:192.168.80.100 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fefc:cd78/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:632072 errors:0 dropped:0 overruns:0 frame:0

TX packets:592209 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:585152040 (558.0 MiB) TX bytes:246699118 (235.2 MiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:78

inet addr:192.168.80.101 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:82

inet addr:100.100.100.100 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fefc:cd82/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:372788 errors:0 dropped:0 overruns:0 frame:0

TX packets:340300 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:207221361 (197.6 MiB) TX bytes:175170150 (167.0 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:82

inet addr:169.254.218.91 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:86472 errors:0 dropped:0 overruns:0 frame:0

TX packets:86472 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:67634217 (64.5 MiB) TX bytes:67634217 (64.5 MiB)

   

   

至此,我们可以明白,ora.scan1.vip的作用是在OS上针对publicIP的物理网卡上生成SCAN使用的虚拟网卡,及产生SCAN使用的IP。

   

下面来看一下,单独启动ora.scan1.vip是否会成功?

[grid@node2 ~]$ crsctl start res ora.scan1.vip

CRS-2672: Attempting to start 'ora.scan1.vip' on 'node2'

CRS-2676: Start of 'ora.scan1.vip' on 'node2' succeeded

启动成功,查看resourece的状态

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 OFFLINE OFFLINE

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

查看SCAN IP和SCAN的功能

节点2:

[root@node2 bin]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.110 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:1195/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3609888 errors:0 dropped:0 overruns:0 frame:0

TX packets:3779627 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:3181604496 (2.9 GiB) TX bytes:2281327256 (2.1 GiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.111 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:9E:11:95

inet addr:192.168.80.113 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:100.100.100.101 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe9e:119f/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1510007 errors:0 dropped:0 overruns:0 frame:0

TX packets:1661459 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:830356519 (791.8 MiB) TX bytes:1056394609 (1007.4 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:9E:11:9F

inet addr:169.254.76.155 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:375911 errors:0 dropped:0 overruns:0 frame:0

TX packets:375911 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:382133639 (364.4 MiB) TX bytes:382133639 (364.4 MiB)

[oracle@node2 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:31:13

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

TNS-12541: TNS:no listener

   

节点1:

[root@node1 ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:78

inet addr:192.168.80.100 Bcast:192.168.80.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fefc:cd78/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:659416 errors:0 dropped:0 overruns:0 frame:0

TX packets:621835 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:608533507 (580.3 MiB) TX bytes:264955498 (252.6 MiB)

Base address:0x2000 Memory:c9020000-c9040000

   

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:78

inet addr:192.168.80.101 Bcast:192.168.80.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2000 Memory:c9020000-c9040000

   

eth1 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:82

inet addr:100.100.100.100 Bcast:100.100.100.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fefc:cd82/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:382129 errors:0 dropped:0 overruns:0 frame:0

TX packets:347571 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:213143409 (203.2 MiB) TX bytes:178762247 (170.4 MiB)

Base address:0x2080 Memory:c9060000-c9080000

   

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:FC:CD:82

inet addr:169.254.218.91 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Base address:0x2080 Memory:c9060000-c9080000

   

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:16436 Metric:1

RX packets:88286 errors:0 dropped:0 overruns:0 frame:0

TX packets:88286 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:68698087 (65.5 MiB) TX bytes:68698087 (65.5 MiB)

   

[oracle@node1 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:31:45

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

TNS-12541: TNS:no listener

   

说明ora.scan1.vip是可以单独先启动,但是 虽然启动了,但是如果不启动ora.LISTENER_SCAN1.lsnr SCAN的功能也是无法实现的。

   

   

验证ora.LISTENER.lsnr的功能

首先 检测crs资源的状态

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE node2

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

关闭ora.LISTENER.lsnr

[grid@node2 ~]$ crsctl stop res ora.LISTENER.lsnr

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node1'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node2'

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'node2' succeeded

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'node1' succeeded

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE node2

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

监听状态

[grid@node1 admin]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:50:24

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 2: No such file or directory

[grid@node2 ~]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:50:58

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 2: No such file or directory

   

说明,oracle用户上的监听也停止了!【根据后面的验证而来】

[oracle@node2 ~]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:56:02

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 111: Connection refuse

   

   

   

使用SCAN 远程登录数据库

节点1:

[oracle@node1 dbhome_1]$ sqlplus sys/oracle@racdb as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:38:58 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12520: TNS:listener could not find available handler for requested type of

server

   

   

Enter user-name:

   

节点2:

[oracle@node2 ~]$ sqlplus sys/oracle@racdb as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:38:03 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12520: TNS:listener could not find available handler for requested type of

server

   

   

Enter user-name:

   

使用VIP访问数据库【oracle用户】

修改Oracle用户下的tnsname.ora

[oracle@node1 admin]$ vim tnsnames.ora

   

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

   

RACDB =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = racdb)

)

)

DEMO =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.200)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = demo)

)

)

   

RACDB1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = racdb)

(INSTANCE_NAME = racdb1)

)

)

   

RACDB2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = racdb)

(INSTANCE_NAME = racdb2)

)

)

   

   

   

[oracle@node1 dbhome_1]$ sqlplus sys/oracle@racdb1 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:42:16 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12541: TNS:no listener

   

   

Enter user-name:

[oracle@node1 dbhome_1]$ tnsping racdb1

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:48:09

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb) (INSTANCE_NAME = racddb1)))

TNS-12541: TNS:no listener

[oracle@node1 dbhome_1]$ tnsping racdb1

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:48:36

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb) (INSTANCE_NAME = racdb1)))

TNS-12541: TNS:no listener

   

因为默认是停止的,所以启动oracle上的监听????

[oracle@node1 dbhome_1]$ lsnrctl start

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:48:43

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

   

TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Log messages written to /u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.racdb.com)(PORT=1521)))

   

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 05-JUN-2014 15:50:46

Uptime 0 days 0 hr. 2 min. 18 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Log File /u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.racdb.com)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM1", status READY, has 1 handler(s) for this service...

Service "racdb" has 1 instance(s).

Instance "racdb1", status READY, has 1 handler(s) for this service...

Service "racdbXDB" has 1 instance(s).

Instance "racdb1", status READY, has 1 handler(s) for this service...

The command completed successfully

[oracle@node1 dbhome_1]$ tnsping racdb1

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:51:33

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb) (INSTANCE_NAME = racdb1)))

OK (480 msec)

[oracle@node1 dbhome_1]$ sqlplus sys/oracle@racdb1 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:51:49 2014

   

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

   

SQL> exit

Disconnected from 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

[oracle@node1 dbhome_1]$ sqlplus sys/oracle@racdb2 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:52:45 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12541: TNS:no listener

   

   

Enter user-name:

这里访问不了racdb2 是因为节点2上oracle用户的监听没有启动

[oracle@node1 dbhome_1]$ lsnrctl stop

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:52:55

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

The command completed successfully

[oracle@node1 dbhome_1]$ sqlplus sys/oracle@racdb2 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:52:58 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12541: TNS:no listener

   

   

Enter user-name: ^[[A

关闭本地监听之后

[oracle@node1 dbhome_1]$ sqlplus sys/oracle@racdb1 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 15:53:04 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12541: TNS:no listener

   

   

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

   

   

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

   

   

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

   

----------启动oracle.LISTENER.lsnr

[grid@node2 ~]$ crsctl start res ora.LISTENER.lsnr

CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'node1'

CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'node2'

CRS-2676: Start of 'ora.LISTENER.lsnr' on 'node2' succeeded

CRS-2676: Start of 'ora.LISTENER.lsnr' on 'node1' succeeded

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE node2

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

   

检查监听 grid用户:

节点1:

[grid@node1 admin]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 15:59:56

   

Copyright (c) 1991, 2011, 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.3.0 - Production

Start Date 05-JUN-2014 15:59:14

Uptime 0 days 0 hr. 0 min. 43 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/node1/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.100)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.101)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM1", status READY, has 1 handler(s) for this service...

Service "racdb" has 1 instance(s).

Instance "racdb1", status READY, has 1 handler(s) for this service...

Service "racdbXDB" has 1 instance(s).

Instance "racdb1", status READY, has 1 handler(s) for this service...

The command completed successfully

   

节点2

[grid@node2 ~]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:00:12

   

Copyright (c) 1991, 2011, 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.3.0 - Production

Start Date 05-JUN-2014 15:59:14

Uptime 0 days 0 hr. 0 min. 59 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/node2/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.110)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.111)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM2", status READY, has 1 handler(s) for this service...

Service "racdb" has 1 instance(s).

Instance "racdb2", status READY, has 1 handler(s) for this service...

Service "racdbXDB" has 1 instance(s).

Instance "racdb2", status READY, has 1 handler(s) for this service...

The command completed successfully

   

检查监听 oracle用户:

   

节点2:

[oracle@node2 ~]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:00:05

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 05-JUN-2014 15:59:14

Uptime 0 days 0 hr. 0 min. 53 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/node2/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.110)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.111)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM2", status READY, has 1 handler(s) for this service...

Service "racdb" has 1 instance(s).

Instance "racdb2", status READY, has 1 handler(s) for this service...

Service "racdbXDB" has 1 instance(s).

Instance "racdb2", status READY, has 1 handler(s) for this service...

The command completed successfully

   

   

节点1:

[oracle@node1 admin]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:00:31

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 05-JUN-2014 15:59:14

Uptime 0 days 0 hr. 1 min. 18 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/node1/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.100)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.101)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

Instance "+ASM1", status READY, has 1 handler(s) for this service...

Service "racdb" has 1 instance(s).

Instance "racdb1", status READY, has 1 handler(s) for this service...

Service "racdbXDB" has 1 instance(s).

Instance "racdb1", status READY, has 1 handler(s) for this service...

The command completed successfully

   

使用SCAN 远程登录数据库

节点1:

[oracle@node1 admin]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:05:16

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

OK (660 msec)

[oracle@node1 admin]$ sqlplus sys/oracle@racdb as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 16:05:38 2014

   

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

   

SQL>

   

节点2:

[oracle@node2 ~]$ tnsping racdb

   

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:05:27

   

Copyright (c) 1997, 2011, Oracle. All rights reserved.

   

Used parameter files:

   

   

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-cluster1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))

OK (10 msec)

[oracle@node2 ~]$ sqlplus sys/oracle@racdb as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 16:05:51 2014

   

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

   

SQL>

   

使用VIP登录

[oracle@node1 admin]$ sqlplus sys/oracle@racdb2 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 16:10:03 2014

   

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

   

SQL> exit

Disconnected from 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

   

OK

   

[oracle@node1 admin]$ sqlplus sys/oracle@racdb1 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 16:10:56 2014

   

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

   

SQL> exit

Disconnected from 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

   

OK

   

   

到这里,有一个小结论(暂时不是对错):ora.LISTENER.lsnr 开启+ora.LISTENER_SCAN1.lsnr开启+ora.scan1.vip开启 才能提供对外监听服务,后两者是在第一者的基础上提供SCAN的功能,第一者才是提供监听的功能。如果,第一者关闭,则监听失效:

[grid@node2 ~]$ crsctl stop res ora.LISTENER.lsnr

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node1'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node2'

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'node2' succeeded

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'node1' succeeded

[grid@node2 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME TARGET STATE SERVER STATE_DETAILS

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.ARCH1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.CRS1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.DATA1.dg

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.LISTENER.lsnr

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.asm

ONLINE ONLINE node1 Started

ONLINE ONLINE node2 Started

ora.gsd

OFFLINE OFFLINE node1

OFFLINE OFFLINE node2

ora.net1.network

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.ons

ONLINE ONLINE node1

ONLINE ONLINE node2

ora.registry.acfs

ONLINE ONLINE node1

ONLINE ONLINE node2

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE node2

ora.cvu

1 ONLINE ONLINE node1

ora.node1.vip

1 ONLINE ONLINE node1

ora.node2.vip

1 ONLINE ONLINE node2

ora.oc4j

1 ONLINE ONLINE node1

ora.racdb.db

1 ONLINE ONLINE node1 Open

2 ONLINE ONLINE node2 Open

ora.scan1.vip

1 ONLINE ONLINE node2

   

   

grid@node1 admin]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:14:05

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 2: No such file or directory

   

[grid@node2 ~]$ lsnrctl status

   

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-JUN-2014 16:14:09

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 2: No such file or directory

[oracle@node1 admin]$ sqlplus sys/oracle@racdb1 as sysdba

   

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 5 16:14:15 2014

   

Copyright (c) 1982, 2011, Oracle. All rights reserved.

   

ERROR:

ORA-12541: TNS:no listener

   

   

Enter user-name:

   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值