oracle_11g_rac 无法实现负载均衡
时间:2010-11-19 来源:liangjunhai1015
每次连接实例都只能连接到同一个服务上:
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
vgopsdp1
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
vgopsdp1
SQL> SELECT INSTANCE_NUMBER, INSTANCE_NAME FROM GV$INSTANCE;
INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
1 vgopsdp1
2 vgopsdp2
SQL>
查看服务端上的tnsnames.ora配置
% cat tnsnames.ora
# tnsnames.ora Network Configuration File: /home/oracle/db/product/11.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_VGOPSDP2 =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_2)(PORT = 1521))
LISTENER_VGOPSDP1 =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_1)(PORT = 1521))
LISTENERS_VGOPSDP =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_2)(PORT = 1521))
)
VGOPSDP2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vgopsdp)
(INSTANCE_NAME = vgopsdp2)
)
)
VGOPSDP1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vgopsdp)
(INSTANCE_NAME = vgopsdp1)
)
)
VGOPSDP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_2)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vgopsdp)
)
)
%
查看listener.ora配置
% cat listener.ora
# listener.ora.sdp_cmcdb01 Network Configuration File: /home/oracle/db/product/11.1.0/db_1/network/admin/listener.ora.sdp_cmcdb01
# Generated by Oracle configuration tools.
LISTENER_SDP_CMCDB01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = flotip_1)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 133.96.107.8)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
%
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=133.96.107.6)(PORT=1521))
remote_listener string LISTENERS_VGOPSDP
SQL>
主备机配置相同
这样能实现负载均衡吗?