Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Restricting Oracle access

Oracle Database Tips by Donald BurlesonOctober 8, 2015

Question:  I have an APEX system and I've noticed some of my end-users using SQL*Plus to access the data.  Because I have coded special rules in the application, I need to restrict my end users and block them from accessing Oracle, except via my application.  How can I use a logion trigger to restrict access to end-users from tools like SQL*Plus, ODBC, Crystal Reports and so on?

Answer: It's always a best practice to do whatever you can to ensure that your end-users "play by the rules" and only access their Oracle data.  This is especially true when you are using standard "grant" security, but it's not necessary when using the "grant execute" security, since end-users can only get the data when they execute your stored procedure or function.

See my general note here on blocking access to Oracle tools.

To block end-users from using external tools like ODBC or SQL*Plus, you can deploy a login trigger to force them to only use your application tool.

Oracle author Kamran Agayev Agamehdi has this snippet on preventing external connections to Oracle

CREATE OR REPLACE TRIGGER block_tools_from_prod
  v_prog sys.v_$session.program%TYPE;
  SELECT program INTO v_prog
    FROM sys.v_$session
    AND  audsid != 0  -- Don't Check SYS Connections
    AND  ROWNUM = 1;  -- Parallel processes will have the same AUDSID's
  IF UPPER(v_prog) LIKE '%TOAD%' OR UPPER(v_prog) LIKE '%T.O.A.D%' OR -- Toad
     UPPER(v_prog) LIKE '%SQLNAV%' OR     -- SQL Navigator
     UPPER(v_prog) LIKE '%PLSQLDEV%' OR -- PLSQL Developer
     UPPER(v_prog) LIKE '%BUSOBJ%' OR   -- Business Objects
     UPPER(v_prog) LIKE '%EXCEL%'       -- MS-Excel plug-in
     RAISE_APPLICATION_ERROR(-20000, 'Development tools are not allowed here.');

If you like Oracle tuning, you may enjoy my new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.