同時配置動態監聽與靜態監聽
再次同時配置動態監聽與靜態監聽:
oracle機ORA11GR2庫:192.168.2.4
enmo機PROD庫:192.168.2.6
----oracle機ORA11GR2庫:192.168.2.4
--資料庫的service name:
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string ORA11GR2
SQL>
--動態監聽:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =oracle)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
--靜態監聽:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=ORA11GR2)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=ORA11GR2))
)
--兩種監聽配置完畢,啟動ORA11GR2庫監聽或者檢視監聽的狀態:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 16-OCT-2016 15:02:46
Uptime 2 days 0 hr. 43 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ORA11GR2" has 2 instance(s).
Instance "ORA11GR2", status UNKNOWN, has 1 handler(s) for this service...
Instance "ORA11GR2", status READY, has 1 handler(s) for this service...
Service "ORA11GR2XDB" has 1 instance(s).
Instance "ORA11GR2", status READY, has 1 handler(s) for this service...
The command completed successfully
可以看到動態監聽與靜態監聽配置有效。
----配置oracle機的tnsnames檔案:
--指向enmo機PROD庫:192.168.2.6 的連線串:
ORA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PROD.oracle.com)
)
)
--指向oracle機本機ORA11GR2庫:192.168.2.4 的連線串:
ORACLE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.4)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORA11GR2)
)
)
----enmo機PROD庫:192.168.2.6:
--資料庫的service name:
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string PROD.oracle.com
--動態監聽:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = enmo)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
--靜態監聽:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=PROD)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=PROD))
)
--兩種監聽配置完畢,啟動PROD庫監聽或者檢視監聽的狀態:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=enmo)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 18-OCT-2016 16:06:31
Uptime 0 days 0 hr. 0 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/enmo/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ORCLXDB.oracle.com" has 1 instance(s).
Instance "PROD", status READY, has 1 handler(s) for this service...
Service "PROD.oracle.com" has 2 instance(s).
Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
Instance "PROD", status READY, has 1 handler(s) for this service...
The command completed successfully
--指向oracle機ORA11GR2庫:192.168.2.4 的連線串:
12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2)
)
)
----配置enmo機的tnsnames檔案:
--指向enmo機本機PROD庫:192.168.2.6 的連線串:
14 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD.oracle.com)
)
)
----連線資料庫:
--嘗試用連線串連線資料庫:
--指向enmo機PROD庫:192.168.2.6 的連線串:
[oracle@oracle admin]$ tnsping ora
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 18-OCT-2016 16:10:46
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PROD.oracle.com)))
OK (10 msec)
[oracle@oracle admin]$
[oracle@oracle admin]$ tnsping ora11
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 18-OCT-2016 16:10:59
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PROD.oracle.com)))
OK (0 msec)
--連線PROD資料庫,檢視伺服器名:
[oracle@oracle admin]$ sqlplus sys/oracle@ora as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 18 16:15:57 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string PROD.oracle.com
另外使用enmo機本機的連線串“12”連線oracle機ORA11GR2庫就不在這裡演示了,同樣的方法連線就可以了。
oracle機ORA11GR2庫:192.168.2.4
enmo機PROD庫:192.168.2.6
----oracle機ORA11GR2庫:192.168.2.4
--資料庫的service name:
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string ORA11GR2
SQL>
--動態監聽:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =oracle)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
--靜態監聽:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=ORA11GR2)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=ORA11GR2))
)
--兩種監聽配置完畢,啟動ORA11GR2庫監聽或者檢視監聽的狀態:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 16-OCT-2016 15:02:46
Uptime 2 days 0 hr. 43 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ORA11GR2" has 2 instance(s).
Instance "ORA11GR2", status UNKNOWN, has 1 handler(s) for this service...
Instance "ORA11GR2", status READY, has 1 handler(s) for this service...
Service "ORA11GR2XDB" has 1 instance(s).
Instance "ORA11GR2", status READY, has 1 handler(s) for this service...
The command completed successfully
可以看到動態監聽與靜態監聽配置有效。
----配置oracle機的tnsnames檔案:
--指向enmo機PROD庫:192.168.2.6 的連線串:
ORA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PROD.oracle.com)
)
)
--指向oracle機本機ORA11GR2庫:192.168.2.4 的連線串:
ORACLE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.4)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORA11GR2)
)
)
----enmo機PROD庫:192.168.2.6:
--資料庫的service name:
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string PROD.oracle.com
--動態監聽:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = enmo)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
--靜態監聽:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=PROD)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=PROD))
)
--兩種監聽配置完畢,啟動PROD庫監聽或者檢視監聽的狀態:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=enmo)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 18-OCT-2016 16:06:31
Uptime 0 days 0 hr. 0 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/enmo/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=enmo.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ORCLXDB.oracle.com" has 1 instance(s).
Instance "PROD", status READY, has 1 handler(s) for this service...
Service "PROD.oracle.com" has 2 instance(s).
Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
Instance "PROD", status READY, has 1 handler(s) for this service...
The command completed successfully
--指向oracle機ORA11GR2庫:192.168.2.4 的連線串:
12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2)
)
)
----配置enmo機的tnsnames檔案:
--指向enmo機本機PROD庫:192.168.2.6 的連線串:
14 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD.oracle.com)
)
)
----連線資料庫:
--嘗試用連線串連線資料庫:
--指向enmo機PROD庫:192.168.2.6 的連線串:
[oracle@oracle admin]$ tnsping ora
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 18-OCT-2016 16:10:46
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PROD.oracle.com)))
OK (10 msec)
[oracle@oracle admin]$
[oracle@oracle admin]$ tnsping ora11
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 18-OCT-2016 16:10:59
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PROD.oracle.com)))
OK (0 msec)
--連線PROD資料庫,檢視伺服器名:
[oracle@oracle admin]$ sqlplus sys/oracle@ora as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 18 16:15:57 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string PROD.oracle.com
另外使用enmo機本機的連線串“12”連線oracle機ORA11GR2庫就不在這裡演示了,同樣的方法連線就可以了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2126670/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 動態監聽與靜態監聽
- ORACLE動態監聽與靜態監聽Oracle
- 【oracle】動態監聽與靜態監聽Oracle
- 動態監聽和靜態監聽
- oracle靜態監聽和動態監聽Oracle
- 動態監聽與靜態監聽的一些特點。
- oracle 監聽 靜態 動態Oracle
- 【listener】oracle靜態監聽和動態監聽 【轉載】Oracle
- oracle listener 靜態監聽與動態監聽的一些小事Oracle
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- oracle靜態監聽Oracle
- oracle動態和靜態監聽listenerOracle
- 【監聽】兩庫互配靜態監聽
- Oracle 動態監聽配置Oracle
- oracle監聽動態註冊與靜態註冊Oracle
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- Oracle監聽的動態註冊與靜態註冊Oracle
- oracle監聽之動態和靜態註冊Oracle
- 【監聽】動態註冊和靜態註冊
- oracle監聽動態註冊與靜態註冊[轉帖]Oracle
- oracle 監聽器動態與靜態註冊服務_listenerOracle
- oracle監聽器的靜態和動態註冊Oracle
- oracle監聽靜態註冊和動態註冊Oracle
- 預設及非預設埠的動態監聽/靜態監聽實驗彙總
- 監聽動態註冊
- 動態註冊監聽
- 動態監聽註冊
- Oracle監聽的靜態註冊和動態註冊Oracle
- 動態和靜態監聽註冊-小魚的理解
- Oracle 靜態監聽註冊詳解Oracle
- 轉載:oracle監聽器的靜態和動態註冊Oracle
- ORACLE動態監聽總結Oracle
- rac監聽動態註冊
- 動態註冊監聽Listener
- Oracle 動態監聽註冊Oracle
- [20160513]Restrict Session與靜態監聽.txtRESTSession
- rac監聽不能動態註冊
- oracle監聽器動態註冊於靜態註冊的區別Oracle