Oracle控制ip的串連

來源:互聯網
上載者:User

Oracle控制ip的串連(我們也可以用資料庫觸發器記錄使用者的登入情況,但是不能記錄dba許可權的使用者),單純的設定允許的IP 和 禁止的IP,在oracle9i以前有文檔說增加或修改protocol.ora檔案,在9i及以後版本中真正起作用的是sqlnet.ora檔案,我們修改sqlnet.ora其實是最好最快的方法

sqlnet.ora檔案的功能:
1. Specify the client domain to append to unqualified names
2. Prioritize naming methods
3. Enable logging and tracing features
4. Route connections through specific processes
5. Configure parameters for external naming
6. Configure Oracle Advanced Security
7. Use protocol-specific parameters to restrict access to the database
我在這裡用的就是第7個功能

在sqlnet.ora中增加如下部分
-----------------------------

tcp.validnode_checking=yes 
 
#允許訪問的IP
tcp.invited_nodes=(ip1,ip2……) 
 
#禁止訪問的IP
tcp.excluded_nodes=(ip1,ip2……)
 
之後重新啟動監聽器即可

eg:
# sqlnet.ora Network Configuration File: E:\oracle\product\10.2.0\db_3\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
#skate modify
tcp.validnode_checking=yes
tcp.invited_nodes=(192.168.0.103)
tcp.excluded_nodes=(192.168.0.10)

需要注意的問題:
1、 需要設定參數為YES,這樣才能啟用。
2、 建議設定允許訪問的IP,因為IP地址有可能被隨意修改,就不能起到自己的目的。
3、 TCP當參數TCP.INVITED_NODES和TCP.EXCLUDED_NODES設定的地址相同的時候將覆蓋TCP.EXCLUDED_NODES設定。
4、 需要重啟監聽器才會生效。
5、 這個方式只是適合TCP協議。
6、 這個配置適用於9i以上版本。在9i之前的版本使用檔案protocol.ora。
7、 在伺服器上直接連接資料庫不受影響。
8、 這種限制方式事通過監聽器來限制的。
9、 這個限制只是針對IP檢測,對於使用者名稱檢測事不支援的。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.