設計為 oracle service 自動注冊到1522號端口上,靜態(tài)注冊到1521號端口上 1>在主機端修改tnsname.ora 添加一行 cat tnsnames.ora LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = yysf)(PORT = 1522)) ) 2>netca 建立新的監(jiān)聽,名字為 csyh,端口為1522 [oracle@~]$netca Oracle Net Services Configuration: Configuring Listener:csyh Listener configuration complete. Oracle Net Listener Startup: Running Listener Control: /oracle/product/10.2.0/db_1/bin/lsnrctl start CSYH Listener Control complete. Listener started successfully. Oracle Net Services configuration successful. The exit code is 0 3>進入想注冊的數(shù)據(jù)庫上,加入相應的信息
SQL> alter system set local_listener=listener;
系統(tǒng)已更改。 4>修改老的Listener,改為靜態(tài)注冊模式: [oracle@/oracle/product/10.2.0/db_1/network/admin]$cat listener.ora # listener.ora Network Configuration File: /oracle/product/10.2.0/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. CSYH = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = yysf)(PORT = 1522)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/product/10.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (ORACLE_HOME = /oracle/product/10.2.0/db_1) (SID_NAME = orcl) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = yysf)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) ) 6、此時兩個監(jiān)聽都是好的,同時從客戶端用兩個監(jiān)聽都可以連接 C:/Documents and Settings/Administrator>tnsping listener2 TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 06-8月 2010 21:42:42 Copyright (c) 1997, 2005, Oracle. All rights reserved. 已使用的參數(shù)文件: D:/oracle/product/10.2.0/client_1/network/admin/sqlnet.ora 已使用 TNSNAMES 適配器來解析別名 Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP (HOST = 192.168.229.2)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = orcl))) OK (0 毫秒)
C:/Documents and Settings/Administrator>sqlplus cx/cx@listener2 SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 8月 6 21:55:44 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options
SQL> quit ||||||||||
C:/Documents and Settings/Administrator>sqlplus cx/cx@192.168.229.2
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 8月 6 21:56:14 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. 連接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options
SQL> select count(*) from tabs; COUNT(*) ---------- 1 SQL> exit C:/Documents and Settings/Administrator>tnsping 192.168.229.2 TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 06-8月 - 2010 22:02:48 Copyright (c) 1997, 2005, Oracle. All rights reserved. 已使用的參數(shù)文件: D:/oracle/product/10.2.0/client_1/network/admin/sqlnet.ora 已使用 TNSNAMES 適配器來解析別名 Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.229.2)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl))) OK (0 毫秒)
|