[20130422]修改oracle監聽埠.txt
[20130422]修改oracle監聽埠.txt
昨天朋友想嘗試修改oracle的預設監聽埠,測試沒有透過,而我在我的測試機器透過,透過對比監聽檔案,我發現其中的差異,問題出
在動態註冊以及靜態註冊的問題,把一些測試記錄下來,便於理解動態以及靜態註冊監聽的問題。
1.測試環境:
SQL> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
$ cd /u01/app/oracle11g/product/11.2.0/db_2/network/admin
$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testtest)(PORT = 1521)(RATE_LIMIT=YES))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle11g
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:09:11
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1521)(RATE_LIMIT=YES)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 09:59:56
Uptime 0 days 0 hr. 9 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "test.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
Service "testXDB.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
The command completed successfully
--動態註冊,狀態是 READY。
2.停止監聽,修改埠為1529.在啟動監聽看看。
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:10:38
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle11g/product/11.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)(RATE_LIMIT=YES)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:10:38
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
The listener supports no services
The command completed successfully
SQL> alter system register;
System altered.
--執行lsnrctl status,發現顯示還是
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
The listener supports no services
The command completed successfully
--如果這個時候遠端登入,會出現:
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
而執行sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com,是可以連線資料庫的。為什麼呢?
原來資料庫動態註冊僅僅連線的是1521埠,而不是監聽需要的1529埠。
3.修改為靜態監聽看看。
$ lsnrctl stop
...
$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test.com)
(ORACLE_HOME = /u01/app/oracle11g/product/11.2.0/db_2)
(SID_NAME = test)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testtest)(PORT = 1529))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1529))
)
)
ADR_BASE_LISTENER = /u01/app/oracle11g
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:21:07
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle11g/product/11.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:21:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Services Summary...
Service "test.com" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
--可以發現的監聽狀態是 UNKNOWN,是靜態註冊。
--這樣使用埠1521,以及1529都可以連上。
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com
sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com
--也就是講如果使用非標準埠,要配置靜態註冊,這樣遠端機器才能使用該埠。但是這樣並不能遮蔽1521埠來連線資料庫。
4.如何遮蔽1521埠,也就是不讓使用者使用1521埠呢?
--這樣必須告訴資料庫註冊監聽時使用非1521埠。
SQL> show parameter local_listener
NAME TYPE VALUE
---------------- -------- ---------------
local_listener string
SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529))' scope=memory ;
System altered.
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com =>透過
sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com =>ORA-12514: TNS:listener does not currently know of service requested in connect
5.再關閉靜態註冊看看,先關閉監聽。
$ lsnrctl stop
...
$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
# SID_LIST_LISTENER =
# (SID_LIST =
# (SID_DESC =
# (GLOBAL_DBNAME = test.com)
# (ORACLE_HOME = /u01/app/oracle11g/product/11.2.0/db_2)
# (SID_NAME = test)
# )
# )
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testtest)(PORT = 1529))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1529))
)
)
ADR_BASE_LISTENER = /u01/app/oracle11g
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:44:34
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle11g/product/11.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:44:34
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
The listener supports no services
The command completed successfully
SQL> alter system register;
System altered.
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:44:48
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:44:34
Uptime 0 days 0 hr. 0 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Services Summary...
Service "test.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
Service "testXDB.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
The command completed successfully
--動態註冊,狀態是 READY。
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com =>透過。
sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com =>ORA-12514: TNS:listener does not currently know of service requested in connect
5.總結:
1.要使用非標準埠,可以使用靜態註冊。這樣不要修改引數local_listener.但是動態註冊依舊是1521,也就是透過1521埠也能連線
資料庫。
2.也可以修改local_listener引數,讓動態註冊使用非標準的埠來實現。這樣就無法使用1521埠。
昨天朋友想嘗試修改oracle的預設監聽埠,測試沒有透過,而我在我的測試機器透過,透過對比監聽檔案,我發現其中的差異,問題出
在動態註冊以及靜態註冊的問題,把一些測試記錄下來,便於理解動態以及靜態註冊監聽的問題。
1.測試環境:
SQL> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
$ cd /u01/app/oracle11g/product/11.2.0/db_2/network/admin
$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testtest)(PORT = 1521)(RATE_LIMIT=YES))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle11g
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:09:11
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1521)(RATE_LIMIT=YES)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 09:59:56
Uptime 0 days 0 hr. 9 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "test.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
Service "testXDB.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
The command completed successfully
--動態註冊,狀態是 READY。
2.停止監聽,修改埠為1529.在啟動監聽看看。
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:10:38
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle11g/product/11.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)(RATE_LIMIT=YES)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:10:38
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
The listener supports no services
The command completed successfully
SQL> alter system register;
System altered.
--執行lsnrctl status,發現顯示還是
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
The listener supports no services
The command completed successfully
--如果這個時候遠端登入,會出現:
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
而執行sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com,是可以連線資料庫的。為什麼呢?
原來資料庫動態註冊僅僅連線的是1521埠,而不是監聽需要的1529埠。
3.修改為靜態監聽看看。
$ lsnrctl stop
...
$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test.com)
(ORACLE_HOME = /u01/app/oracle11g/product/11.2.0/db_2)
(SID_NAME = test)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testtest)(PORT = 1529))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1529))
)
)
ADR_BASE_LISTENER = /u01/app/oracle11g
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:21:07
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle11g/product/11.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:21:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Services Summary...
Service "test.com" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
--可以發現的監聽狀態是 UNKNOWN,是靜態註冊。
--這樣使用埠1521,以及1529都可以連上。
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com
sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com
--也就是講如果使用非標準埠,要配置靜態註冊,這樣遠端機器才能使用該埠。但是這樣並不能遮蔽1521埠來連線資料庫。
4.如何遮蔽1521埠,也就是不讓使用者使用1521埠呢?
--這樣必須告訴資料庫註冊監聽時使用非1521埠。
SQL> show parameter local_listener
NAME TYPE VALUE
---------------- -------- ---------------
local_listener string
SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529))' scope=memory ;
System altered.
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com =>透過
sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com =>ORA-12514: TNS:listener does not currently know of service requested in connect
5.再關閉靜態註冊看看,先關閉監聽。
$ lsnrctl stop
...
$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
# Generated by Oracle configuration tools.
# SID_LIST_LISTENER =
# (SID_LIST =
# (SID_DESC =
# (GLOBAL_DBNAME = test.com)
# (ORACLE_HOME = /u01/app/oracle11g/product/11.2.0/db_2)
# (SID_NAME = test)
# )
# )
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testtest)(PORT = 1529))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1529))
)
)
ADR_BASE_LISTENER = /u01/app/oracle11g
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:44:34
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle11g/product/11.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:44:34
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
The listener supports no services
The command completed successfully
SQL> alter system register;
System altered.
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 21-APR-2013 10:44:48
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testtest)(PORT=1529)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 21-APR-2013 10:44:34
Uptime 0 days 0 hr. 0 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/oracle11g/product/11.2.0/db_2/network/admin/listener.ora
Listener Log File /u01/app/oracle11g/diag/tnslsnr/testtest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testtest)(PORT=1529)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1529)))
Services Summary...
Service "test.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
Service "testXDB.com" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
The command completed successfully
--動態註冊,狀態是 READY。
sqlplus scott/xxxxxx@192.168.100.XXX:1529/test.com =>透過。
sqlplus scott/xxxxxx@192.168.100.XXX:1521/test.com =>ORA-12514: TNS:listener does not currently know of service requested in connect
5.總結:
1.要使用非標準埠,可以使用靜態註冊。這樣不要修改引數local_listener.但是動態註冊依舊是1521,也就是透過1521埠也能連線
資料庫。
2.也可以修改local_listener引數,讓動態註冊使用非標準的埠來實現。這樣就無法使用1521埠。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-758983/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Oracle】修改oracle監聽埠Oracle
- [20160418]修改oracle監聽埠.txtOracle
- 【Oracle】修改scan監聽器埠號Oracle
- Oracle 11g 修改監聽埠Oracle
- Oracle 修改預設監聽埠故障分析Oracle
- oracle之 單例項監聽修改埠Oracle單例
- Oracle資料庫修改LISTENER的監聽埠Oracle資料庫
- 修改oracle監聽佔用的8080埠(轉)Oracle
- oracle 11g 修改預設監聽埠1521Oracle
- 12C RAC 修改監聽埠
- oracle 監聽配置多個埠Oracle
- oracle rac scan監聽更改埠號Oracle
- Oracle 建立非1521埠監聽Oracle
- 如何更改oracle監聽器的埠Oracle
- ORACLE 修改11.2.0.4 RAC 預設監聽埠號1521為1621Oracle
- Oracle之 11gR2 RAC 修改監聽器埠號的步驟Oracle
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- Windows server 防火牆開放oracle監聽埠WindowsServer防火牆Oracle
- [20161227]開啟多個監聽埠.txt
- 修改服務端監聽器埠號為1526服務端
- oracle監聽【非1521埠】動態註冊Oracle
- 初始化監聽埠
- samba程序與監聽埠Samba
- 【LISTENER】修改 LISTENER的監聽埠為1526(動態註冊)
- 【LISTENER】修改 LISTENER的監聽埠為1526(靜態註冊)
- Sqlserver重啟alwayson監聽埠SQLServer
- Oracle 監聽Oracle
- oracle em 修改埠Oracle
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- windows10怎麼檢視監聽埠_windows10檢視監聽埠的方法Windows
- nginx 80埠監聽多個域名Nginx
- Tomcat監聽443埠的方法Tomcat
- mysql的啟動,以及修改偵聽埠。MySql
- oracle更改預設埠號,監聽器加密,限制ip訪問Oracle加密
- Oracle監聽(1)Oracle
- ORACLE動態監聽與靜態監聽Oracle
- oracle靜態監聽和動態監聽Oracle
- 【oracle】動態監聽與靜態監聽Oracle