How to Restrict Access of Some Users or Program in Oracle Prodcution Database

CREATE OR REPLACE TRIGGER programe_restrication

AFTER LOGON ON DATABASE

BEGIN

FOR x IN (SELECT username, program

FROM SYS.v_$session

WHERE audsid = USERENV (‘sessionid’))

LOOP

IF LTRIM (RTRIM (x.username)) = ‘AHMADBILAL’

AND LTRIM (RTRIM (x.program)) IN (‘sqlplusw.exe’, ‘TOAD.exe’)

THEN

raise_application_error

(-20999,

‘Not authorized to use in the Production environment!’

);

END IF;

END LOOP;

END programe_restrication;

/

Advertisements

One thought on “How to Restrict Access of Some Users or Program in Oracle Prodcution Database

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s