ITPub博客

首页 > 数据库 > Oracle > Oracle数据库限制访问IP

Oracle数据库限制访问IP

原创 Oracle 作者:chenoracle 时间:2023-02-07 15:23:20 0 删除 编辑

测试Oracle数据库限制访问IP

限制之前10.1.13.38、10.1.13.165可以远程访问10.1.13.151数据库。

10.1.13.38

sqlplus username/***@10.1.13.151:port/instance_name
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 27 16:22:25 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL> exit

10.1.13.165
sqlplus username/***@10.1.13.151:port/instance_name
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 27 16:20:32 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL>

限制10.1.13.151数据库IP访问来源

cd $ORACLE_HOME/network/admin
ls
listener.ora listener.ora.bak samples shrept.lst tnsnames.ora tnsnames.ora.bak

vi sqlnet.ora

#开启IP限制功能
tcp.validnode_checking=yes
#允许访问数据库IP地址列表
tcp.invited_nodes(10.1.13.151,127.0.0.1,10.1.13.38,192.168.1.10)

重启监听

lsnrctl stop
lsnrctl start
lsnrctl reload

手动注册监听

sqlplus / as sysdba
alter system register;

查看监听状态

lsnrctl status

验证

10.1.13.165无法远程151数据库

sqlplus username/***@10.1.13.151:port/instance_name
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 27 16:30:06 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:

10.1.13.38可以远程访问151数据库

sqlplus username/***@10.1.13.151:port/instance_name
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 27 16:32:27 2022
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL> exit

###chenjuchao 20230207###

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29785807/viewspace-2934240/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE、OCMU 用户组成员、Oracle 11g OCM、微信公众号"IT小Chen"

注册时间:2014-08-05

  • 博文量
    853
  • 访问量
    2727200