Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

BG Oracle Certified Professional Restricting the users based on IP

There are two basic methods using which you can restrict the users connecting to the database based on their IP address. Method 1 : Add the following entries in sqlnet.ora(for Oracle 9i) or protocol.ora(for Oracle 8i). If protocol.ora is not available, create a new file and add the following entries tcp.validnode_checking=YES tcp.invited_nodes=(xxx.xxx.xxx.xxx) #The nodes which are allowed tcp.excluded_nodes=(XXX.XXX.XXX.XXX) #The nodes which are blocked

Method 2 : Create the following database trigger under user SYS or SYSTEM.
CREATE OR REPLACE TRIGGER CHECK_ON_LOGON AFTER LOGON ON DATABASE DECLARE TEST VARCHAR2(30); BEGIN SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') INTO TEST FROM DUAL; IF TEST='XXX.XXX.XXX.XXX' THEN RAISE_APPLICATION_ERROR(-20001,'SORRY!!!!'); END IF; END;

Using method 2, if the users having DBA privilege or administer database trigger privilege, then they can connect to the database.

Evaluation notes were added to the output document. To get rid of these notes, please order your copy of ePrint IV now.

You might also like