Chinaunix首页 | 论坛 | 博客
  • 博客访问: 35921
  • 博文数量: 28
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 0
  • 用 户 组: 普通用户
  • 注册时间: 2013-11-23 14:14
文章分类

全部博文(28)

文章存档

2014年(1)

2013年(27)

我的朋友

分类: Oracle

2013-11-26 16:53:33

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

 

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