top of page
Writer's pictureHanh Nguyen

How to Restrict User from Connecting to Database Through Specific Ip Address

The example below explains how to restrict user shy from accessing database from IP address 159.09.208.953 Step 1:-

Create the following trigger :-

Create or replace trigger logontrig after logon on database Begin if ora_client_ip_address='159.09.208.953' and ora_login_user='SHY' THEN RAISE_APPLICATION_ERROR(-20001, 'You are not authorized to login into this machine shy'); END IF; end;

Trigger code explanation:-

i) The trigger fires whenever user shy connects to the database . ii) Internally it checks the IP address of the machine from where the user is trying to log on to the database iii) If the IP address of the machine from which the user connects matches the trigger condition it raises the error message  and  prevents the user from connecting to the database.

0 views0 comments

Recent Posts

See All

Transparent Data Encryption in Oracle 12c

1. Set the ENCRYPTION_WALLET_LOCATION in $ORACLE_HOME/network/admin/sqlnet.ora Example: oracle@seclindbs /u01/app/oracle/product/12.1.0.2...

Comments


bottom of page