[20211020]奇怪lsnrctl status顯示.txt
[20211020]奇怪lsnrctl status顯示.txt
--//這幾天一直在收尾同事配置dg的問題。生產系統安全問題比較複雜,透過測試環境演示該問題。
SYS@book> alter system register;
System altered.
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-OCT-2021 10:10:00
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 20-OCT-2021 10:09:07
Uptime 0 days 0 hr. 0 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/11.2.0.4/dbhome_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "booK" has 1 instance(s).
Instance "book", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
SYS@book> alter system register;
System altered.
--//lsnrctl status 狀態僅僅顯示一個booK服務,而且是靜態註冊的。
--//我在listener.ora配置如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SDU = 32767)
(GLOBAL_DBNAME = booK)
(ARGV0 = myapp0)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1)
(SID_NAME = book)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
--//簡單說明一下ARGV0 = myapp0,GLOBAL_DBNAME = booK(大小寫混用也是測試目的),以前的測試我都忘了。
$ rlsql scott/book@127.0.0.1:1521/boOK
SCOTT@127.0.0.1:1521/boOK> @ spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
44 4465 42539 DEDICATED 42541 27 177 alter system kill session '44,4465' immediate;
sqlplus scott/book@192.168.100.78:1521/Book
sqlplus scott/book
--//獲取程式號略。
$ ps -fp 42541,42556,42549
UID PID PPID C STIME TTY TIME CMD
oracle 42541 1 0 10:15 ? 00:00:00 myapp0 (DESCRIPTION=(LOCAL=NO)(SDU=32767))
oracle 42549 1 0 10:17 ? 00:00:00 myapp0 (DESCRIPTION=(LOCAL=NO)(SDU=32767))
oracle 42556 42555 0 10:17 ? 00:00:00 oraclebook (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
--//相當於這時無論我本地或者遠端透過網路登入,使用的都是靜態服務。裡面的ARGV0 = myapp0相當於改了引數0.
SYS@book> show parameter dispatchers
NAME TYPE VALUE
----------- ------ ---------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=bookXDB)
--//同時共享服務名也沒有顯示。
# netstat -tnlp | grep -v sshd
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 42335/tnslsnr
tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 9290/rsyslogd
tcp 0 0 0.0.0.0:963 0.0.0.0:* LISTEN 4173/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 4136/portmap
tcp 0 0 :::11794 :::* LISTEN 57352/ora_d000_book
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcp 0 0 :::514 :::* LISTEN 9290/rsyslogd
--//ora_d000_book存在。
--//後面檢查發現在/etc/hostse檔案中沒有配置主機名。
# grep 78 /etc/hosts
# 192.168.100.78 xxxxdg4.com xxxxdg4
--//取消註解後
SCOTT@127.0.0.1:1521/boOK> alter system register;
System altered.
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-OCT-2021 10:31:04
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 20-OCT-2021 10:28:22
Uptime 0 days 0 hr. 2 min. 41 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/11.2.0.4/dbhome_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "BOOKSHARE" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
Service "booK" has 2 instance(s).
Instance "book", status UNKNOWN, has 1 handler(s) for this service...
Instance "book", status READY, has 1 handler(s) for this service...
Service "bookXDB" has 1 instance(s).
Instance "book", status READY, has 1 handler(s) for this service...
The command completed successfully
--//問題解決。很奇怪新版本使用centos 7.9 , 新的hostnamectl命令並不會修改/etc/hosts檔案。
$ sqlplus scott/book@192.168.100.78:1521/book
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
30 2327 6268:4120 DEDICATED 43112 26 76 alter system kill session '30,2327' immediate;
# ps -fp 43112
UID PID PPID C STIME TTY TIME CMD
oracle 43112 1 0 11:13 ? 00:00:00 oraclebook (LOCAL=NO)
--//可以發現在動態,靜態服務註冊的情況下,優先使用註冊的動態服務名。怎麼能在這種情況下使用靜態的服務名呢?
$ sqlplus scott/book@"(DESCRIPTION=(ARGV0=xxxxxx)(ENABLE=BROKEN)(CONNECT_DATA=(ARGV0=yyyyy)(SERVICE_NAME=book)(SERVER = DEDICATED))(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.78)(PORT=1521)))"
SCOTT@book> @ spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
30 2329 4108:7656 DEDICATED 43120 26 77 alter system kill session '30,2329' immediate;
# ps -fp 43120
UID PID PPID C STIME TTY TIME CMD
oracle 43120 1 0 11:14 ? 00:00:00 oraclebook (LOCAL=NO)
--//不行,放棄!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2838378/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20230405]奇怪的顯示輸出寬度.txt
- [20211020]XXXX_DGB服務名.txt
- [20211020]改變備庫的rman配置.txt
- git status顯示了未修改的檔案Git
- [20211020]windows新建文字檔案帶日期.txtWindows
- [20190321]smem的顯示缺陷.txt
- [20180811]windows 7 顯示桌面.txtWindows
- [20230905]奇怪的語法.txt
- [20210301]延遲顯示輸出.txt
- [20190412]bash顯示日期相減.txt
- [20180628]顯示bbed x命令格式.txt
- [20200319]KILL STATUS ='KILLED'的程式.txt
- [20221020]奇怪的增量備份.txt
- [20220822]奇怪的ashtop輸出.txt
- [20211111]奇怪的ashtop輸出.txt
- [20210802]grep奇怪的過濾.txt
- [20210924]awk奇怪的輸出.txt
- [20201106]奇怪的awr報表.txt
- [20181120]奇怪的insert語句.txt
- [20231207]ls -f的顯示問題.txt
- [20181207]sqlplus下顯示資料精度.txtSQL
- [20180312]iostat顯示輸出問題.txtiOS
- [20210506]RAC crsctl status ... -v 獲取last started or status changes資訊.txtAST
- [20231012]奇怪的執行時長.txt
- [20230426]奇怪的AVG_IOW_MS.txt
- [20211026]奇怪註解不起作用.txt
- [20190306]奇怪的查詢結果.txt
- [20200217]bash顯示path環境變數.txt變數
- [20201103]lsof顯示link=0的檔案.txt
- [20201121]顯示時間戳高精度版本.txt時間戳
- Oracle OCP(44):LSNRCTLOracle
- [20221103]奇怪的mail資訊(整理版本).txtAI
- [20211018]奇怪的歸檔目的地.txt
- [20210924]awk奇怪的輸出2.txt
- [20211210]優化遇到的奇怪問題.txt優化
- [20180417]奇怪的grep過濾問題.txt
- [20230501]為什麼沒有顯示輸出.txt
- [20220826]顯示alert日誌檔案全路徑.txt