標籤:
資料庫版本:11.2.0.4資料庫層面可以通過配置Oracle sqlnet.ora檔案中相關參數限制訪問IP。
一、修改sqlnet.ora 檔案sqlnet.ora檔案在$ORACLE_HOME/network/admin 目錄下,添加如下內容: tcp.validnode_checking=yes #允許訪問的IP tcp.invited_nodes=(ip1,ip2…) #禁止訪問的IP tcp.excluded_nodes=(ip1,ip2…)
重啟監聽,生效!只有配置tcp.validnode_checking=yes,其他兩個參數配置才生效。tcp.invited_nodes和tcp.excluded_nodes可以同時使用,也可以單獨使用。
二、相關參數說明相關參數: TCP.VALIDNODE_CHECKING、TCP.INVITED_NODES、TCP.EXCLUDED_NODES官方文檔說明: TCP.VALIDNODE_CHECKING Purpose :To enable and disable valid node checking for incoming connections. If this parameter is set to yes, then incoming connections are allowed only if they originate from a node that conforms to list specified by TCP.INVITED_NODES or TCP.EXCLUDED_NODES parameters. Usage Notes :The TCP.INVITED_NODES and TCP.EXCLUDED_NODES parameters are valid only when the TCP.VALIDNODE_CHECKING parameter is set to yes. Example: TCP.VALIDNODE_CHECKING=yes TCP.INVITED_NODESPurpose :To specify which clients are allowed access to the database. This list takes precedence over the TCP.EXCLUDED_NODES parameter if both lists are present.
TCP.INVITED_NODES優先順序高於TCP.EXCLUDED_NODES。Syntax: TCP.INVITED_NODES=(hostname | ip_address, hostname | ip_address, ...) Usage Notes:This parameter is only valid when the TCP.VALIDNODE_CHECKING parameter is set to yes. This parameter can use wildcards for IPv4 addresses and CIDR notation for IPv4 and IPv6 addresses. Example: TCP.INVITED_NODES=(sales.us.example.com, hr.us.example.com, 192.168.*, 2001:DB8:200C:433B/32) TCP.EXCLUDED_NODESPurpose :To specify which clients are denied access to the database. Syntax: TCP.EXCLUDED_NODES=(hostname | ip_address, hostname | ip_address, ...) Usage Notes :This parameter is only valid when the TCP.VALIDNODE_CHECKING parameter is set to yes. This parameter can use wildcards for IPv4 addresses and CIDR (Classless Inter-Domain Routing) notation for IPv4 and IPv6 addresses. Example: TCP.EXCLUDED_NODES=(finance.us.example.com, mktg.us.example.com, 192.168.2.25, 172.30.*, 2001:DB8:200C:417A/32) 三、測試測試後,並未發現網上所說的需要在TCP.INVITED_NODES中添加資料庫伺服器IP,
oracle資料庫層面限制IP訪問