节点1切换到oracle用户,
SQL> select
INST_ID,username,sid,serial# from gv$session where username='XIA';
no rows selected
本文转自cuug官网
SQL>
用win7安装的客户端连接,该客户端tnsnames.ora配置:
# tnsnames.ora Network
Configuration File: d:\app\Administrator\product\11.2.0\client_1\network\admin\tnsnames.or
a
# Generated by Oracle
configuration tools.
RACSCAN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.75.30)(PORT =
1521))
)
(CONNECT_DATA =
(SERVICE_NAME = racdb)
)
)
C:\>sqlplus xia/aa123456@racscan
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 5月 14 08:54:33 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options
在切换到节点1
SQL> select
INST_ID,username,sid,serial# from gv$session where username='XIA';
INST_ID USERNAME
SID SERIAL#
---------- ------------------------------ ---------- ----------
2 XIA
57 4992
SQL> //可以看到第一次登陆连接到第二个节点上了;
在切换到win7客户端在开一个窗口连接rac,在节点1查询,发现这次连接到节点1上面了;
SQL> select INST_ID,username,sid,serial#
from gv$session where username='XIA';
INST_ID USERNAME
SID SERIAL#
---------- ------------------------------ ---------- ----------
1 XIA
51 788
2 XIA
57 4992
在在win7上开一个窗口连接。发现又连接到节点1上了,
SQL> select
INST_ID,username,sid,serial# from gv$session where username='XIA';
INST_ID USERNAME
SID SERIAL#
---------- ------------------------------ ---------- ----------
1 XIA
51 788
1 XIA
53 1322
2 XIA
57 4992
说明当用户连接到该rac时由scan自动选择把用户的连接分配到那个节点上,以达到负载均衡的目的。
阅读(4915) | 评论(0) | 转发(1) |