Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1150877
  • 博文数量: 178
  • 博客积分: 2776
  • 博客等级: 少校
  • 技术积分: 2809
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-22 15:36
文章分类

全部博文(178)

文章存档

2014年(3)

2013年(66)

2012年(109)

分类: Oracle

2013-06-14 13:54:22

节点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自动选择把用户的连接分配到那个节点上,以达到负载均衡的目的。

 

阅读(4860) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~