ORACLE 11G RAC监听配置(实例共享)
ORACLE 11G RAC监听配置(实例共享)
最近两天QQ上某网友RAC装完之后,监听怎么配置,下面我就共享一个实例
环境信息
cat /etc/hosts 192.168.1.11 racdb1 192.168.2.2 racdb1-priv 192.168.1.12 racdb1-vip 192.168.1.13 racdb2 192.168.2.3 racdb2-priv 192.168.1.14 racdb2-vip 192.168.1.15 scan-db
在tnsnames.ora 添加
LISTENER_RACDB1,LISTENER_RACDB2,SCAN vi tnsnames.ora LISTENER_RACDB1 = (ADDRESS = (PROTOCOL = TCP)(HOST = racdb1-vip)(PORT = 1521)) LISTENER_RACDB2 = (ADDRESS = (PROTOCOL = TCP)(HOST = racdb2-vip)(PORT = 1521)) SCAN = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-db)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db) ) ) su - oracle SQL>alter system set local_listener='LISTENER_RACDB1:1521',sid='db1'; SQL>alter system set local_listener='LISTENER_RACDB2:1521',sid='db2'; SQL> alter system set remote_listener='racscan:1521'; SQL> alter system register;
客户端两种方式连接
TNS vip连接方式 RAC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.12)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.14)(PORT = 1521)) (LOAD_BALANCE = ON) (FAILOVER = ON) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db) ) ) tns racscan连接方式 tns vip 方式 SCAN = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = racscan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db) ) )