当前所在位置:珠峰网资料 >> 计算机 >> Oracle认证 >> 正文
禁止特定IP访问Oracle数据库(一)
发布时间:2010/10/19 9:34:30 来源:www.xue.net 编辑:城市总裁吧

      通过使用数据库服务器端的sqlnet.ora文件可以实现禁止指定IP主机访问数据库的功能,这对于提升数据库的安全性有很大的帮助,与此同时,这个技术为我们管理和约束数据库访问控制提供了有效的手段。下面是实现这个目的的具体步骤仅供参考:

    1.默认的服务器端sqlnet.ora文件的内容:

    这里我们以Oracle 10.2.0.3版本为例进行简述,先来看一下当前sqlnet.ora文件内容:

    # 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)

    2.确认客户端的IP地址:

    C:\Documents and Settings\Administrator>ipconfig

    Windows IP Configuration

    Ethernet adapter Local Area Connection 2:

    Media State . . . . . . . . . . . : Media disconnected

    Ethernet adapter Local Area Connection:

    Connection-specific DNS Suffix  . :

    IP Address. . . . . . . . . . . . : 9.123.112.16

    Subnet Mask . . . . . . . . . . . : 255.255.255.0

    Default Gateway . . . . . . . . . : 9.123.112.1

    3.在客户端分别使用tnsping命令和sqlplus命令来验证数据库的连通性:

    C:\Documents and Settings\Administrator>tnsping irmdb

    TNS Ping Utility for 32-bit Windows: Version 10.2.0.3.0 - Production on 06-APR-2010 11:05:09

    Copyright (c) 1997, 2006, Oracle.  All rights reserved.

    Used parameter files:

    C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora

    Used TNSNAMES adapter to resolve the alias

    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)

    (HOST = 9.123.112.34)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = irmdb)))

    OK (20 msec)

    C:\Documents and Settings\Administrator>sqlplus /nolog

    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Apr 6 11:05:12 2010

    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

    SQL> conn irmadmin/passw0rd@irmdb

    Connected.

    到这里说明在客户端两种方式都证明的数据库的可连通性。

广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved