oracle12c 端口查看,Oracle12c修改端口号
Oracle12c數據庫更改端口號
修改端口號的整體步驟
1.1、查看當前監聽的狀態
1.2、停止監聽
1.3、修改監聽文件的端口號
1.4、修改初始化參數local_listener
1.5、重啟監聽器
1.6、修改完畢,使用新端口登錄測試
實踐步驟:
1、查看當前監聽的狀態
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:34:54
Copyright (c) 1991, 2014, Oracle. ?All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias ????????????????????LISTENER
Version ??????????????????TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date ???????????????20-DEC-2016 22:26:52
Uptime ???????????????????0 days 19 hr. 8 min. 1 sec
Trace Level ??????????????off
Security ?????????????????ON: Local OS Authentication
SNMP ?????????????????????OFF
Listener Parameter File ??/u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File ????????/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/qywsxxdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "qyws_jkda" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_qyrk" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_tjzb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_xnh" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_yzxt" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdbXDB" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb_pdb1" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
The command completed successfully
2、停止監聽
[oracle@localhost admin]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:56:15
Copyright (c) 1991, 2014, Oracle. ?All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully
3、修改監聽文件的端口號
監聽文件位置:$ORACLE_HOME/network/admin/通過系統自帶vi工具將listener.ora和tnsname.ora文件中port參數的值由1521改成1522,存盤即可。或者通過netca實用程序配置更改監聽端口。
4、啟動監聽程序
[oracle@localhost admin]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:56:20
Copyright (c) 1991, 2014, Oracle. ?All rights reserved.
Starting /u01/app/oracle/12.1.0/db/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /u01/app/oracle/12.1.0/db/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ????????????????????LISTENER
Version ??????????????????TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date ???????????????21-DEC-2016 17:56:20
Uptime ???????????????????0 days 0 hr. 0 min. 0 sec
Trace Level ??????????????off
Security ?????????????????ON: Local OS Authentication
SNMP ?????????????????????OFF
Listener Parameter File ??/u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File ????????/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
The listener supports no services
The command completed successfully
5、修改初始化參數local_listener參數
此處將4和5步驟調換,就是為了通過測試,說明為什么要修改local_listener參數,首先,在不修改該參數的情況,我們注冊數據庫到監聽程序。
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Dec 21 17:56:25 2016
Copyright (c) 1982, 2014, Oracle. ?All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter local_li
NAME ?????TYPE ?VALUE
------------------------------------ ----------- ------------------------------
local_listener ?????string
SQL> alter system register;
System altered.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@localhost admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:56:36
Copyright (c) 1991, 2014, Oracle. ?All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ????????????????????LISTENER
Version ??????????????????TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date ???????????????21-DEC-2016 17:56:20
Uptime ???????????????????0 days 0 hr. 0 min. 15 sec
Trace Level ??????????????off
Security ?????????????????ON: Local OS Authentication
SNMP ?????????????????????OFF
Listener Parameter File ??/u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File ????????/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
The listener supports no services
The command completed successfully
通過手動注冊數據庫,可以看到數據庫并未注冊到監聽程序,此時的local_listener為默認值,默認情況下會注冊默認監聽程序。接下來我們修改local_listener參數的值,看看修改后的效果。
SQL> alter system set local_listener="(address = (protocol = tcp)(host = 192.168.227.11)(port = 1522))" scope=both;
System altered.
SQL>
SQL>
SQL> show parameter local_li
NAME ?????TYPE ?VALUE
------------------------------------ ----------- ------------------------------
local_listener ?????string ?(address = (protocol = tcp)(ho
st = 192.168.227.11)(port = 15
22))
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 18:02:09
Copyright (c) 1991, 2014, Oracle. ?All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias ????????????????????LISTENER
Version ??????????????????TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date ???????????????21-DEC-2016 17:56:20
Uptime ???????????????????0 days 0 hr. 5 min. 49 sec
Trace Level ??????????????off
Security ?????????????????ON: Local OS Authentication
SNMP ?????????????????????OFF
Listener Parameter File ??/u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File ????????/u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/qywsxxdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "qyws_jkda" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_qyrk" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_tjzb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_xnh" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_yzxt" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdbXDB" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb_pdb1" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
The command completed successfully
可以看到監聽程序很快就會自動注冊可以識別到的數據庫實例。
那么為什么在這里要修改local_listener參數的值呢,默認情況下該參數為空值,依然可以動態將數據庫實例自動注冊監聽呢?首先,我們得知道是pmon進程在實時動態注冊數據庫的,一般在默認情況下,pmon只會動態注冊port等于1521的監聽,否則pmon不能動態注冊listener,如果想讓pmon動態注冊listener,那么就需要設置local_listener參數。這也是為什么必須在修改端口時,必須要修改local_listener參數的原因。
來自 “ ITPUB博客 ” ,鏈接:http://blog.itpub.net/31403259/viewspace-2131183/,如需轉載,請注明出處,否則將追究法律責任。
總結
以上是生活随笔為你收集整理的oracle12c 端口查看,Oracle12c修改端口号的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 影片备案两年过期(影片备案)
- 下一篇: c语言找出公共子字符串,经典C语言面试题