您好,登錄后才能下訂單哦!
今天就跟大家聊聊有關(guān)如何設(shè)置Oracle 監(jiān)聽器密碼,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
設(shè)置 Oracle 監(jiān)聽器密碼(LISTENER)
監(jiān)聽器也有安全?Sure!在缺省的情況下,任意用戶不需要使用任何密碼即通過lsnrctl 工具對Oracle
Listener進(jìn)行操作或關(guān)閉,從
而造成任意新的會話都將無法建立連接。在Oracle 9i
中Oracle監(jiān)聽器允許任何一個(gè)人利用lsnrctl從遠(yuǎn)程發(fā)起對監(jiān)聽器的管理。也容易導(dǎo)致數(shù)
據(jù)庫受到損壞。
1.
未設(shè)定密碼情形下停止監(jiān)聽
[oracle@test ~]$ lsnrctl stop
listener_demo92
-->停止監(jiān)聽,可以看出不需要任何密碼即可停止
LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011
08:22:26
Copyright (c) 1991, 2006, Oracle Corporation.
All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
The command completed
successfully
2. 重新啟動監(jiān)聽并設(shè)置密碼
[oracle@test ~]$
lsnrctl
LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011
08:24:09
Copyright (c) 1991, 2006, Oracle Corporation.
All rights reserved.
Welcome to LSNRCTL, type "help" for
information.
LSNRCTL> set current_listener
listener_demo92
-->設(shè)置當(dāng)前監(jiān)聽器
Current Listener is
listener_demo92
LSNRCTL>
start
-->啟動過程也不需要任何密碼,啟動的詳細(xì)信息省略
LSNRCTL>
change_password
-->使用change_password來設(shè)置密碼
Old
password:
New
password:
Reenter new
password:
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
Password changed for
listener_demo92
The command completed
successfully
LSNRCTL>
save_config
-->注意此處的save_config失敗
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
TNS-01169: The listener has not recognized the password
LSNRCTL> set
password
-->輸入新設(shè)定的密碼驗(yàn)證
Password:
The command completed
successfully
LSNRCTL>
save_config
-->再次save_config成功
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
Saved listener_demo92 configuration
parameters.
Listener Parameter File
/oracle/92/network/admin/listener.ora
Old Parameter File
/oracle/92/network/admin/listener.bak
The command completed
successfully
-->增加密碼之后可以看到listener.ora文件中有一條新增的記錄,即密碼選項(xiàng)(注:盡管使用了密碼管理方式,仍然可以無需密碼啟動監(jiān)聽)
[oracle@test admin]$ more
listener.ora
#----ADDED BY TNSLSNR 26-JUN-2011 05:12:48---
PASSWORDS_listener_demo92 =
#--------------------------------------------
3. 嘗試未使用密碼的情況下停止監(jiān)聽
[oracle@test ~]$ lsnrctl stop
listener_demo92
LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011
06:09:51
Copyright (c) 1991, 2006, Oracle Corporation.
All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
TNS-01169: The listener has not recognized the
password
-->收到錯(cuò)誤信息,需要使用密碼認(rèn)證
4. 使用密碼來停止監(jiān)聽
[oracle@test ~]$ lsnrctl
LSNRCTL> set current_listener
listener_demo92
Current Listener is
listener_demo92
LSNRCTL>
stop
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
TNS-01169: The listener has not recognized the
password
LSNRCTL> set
password
Password:
The command completed
successfully
LSNRCTL>
stop
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
The command completed
successfully
5. save_config失敗的問題
-->在 Oracle
9i中,使用save_config命令將會失敗
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=)))
TNS-01169: The listener has not recognized the password
-->應(yīng)該先使用set
password之后再save_config,則保存配置成功。
LSNRCTL> set password
Password:
The command completed successfully
6.
配置listener.ora中ADMIN_RESTRICTIONS參數(shù)
參數(shù)作用:
當(dāng)在listener.ora文件中設(shè)置了ADMIN_RESTRICTIONS參數(shù)后,在監(jiān)聽器運(yùn)行時(shí),不允許執(zhí)行任何管理命令,同時(shí)set命令將不可用
,不論是在服務(wù)器本地還是從遠(yuǎn)程執(zhí)行都不行。此時(shí)對于監(jiān)聽的設(shè)置僅僅通過手工修改listener.ora文件,要使修改生效,只能
使用lsnrctl reload命令或lsnrctl stop/start命令重新載入一次監(jiān)聽器配置信息。
修改方法:
在listener.ora文件中手動加入下面這樣一行
ADMIN_RESTRICTIONS_<監(jiān)聽器名> = ON
看完上述內(nèi)容,你們對如何設(shè)置Oracle 監(jiān)聽器密碼有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注億速云行業(yè)資訊頻道,感謝大家的支持。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。