Why Doesn’t This Trigger Work – No Developer Tools Allowed in the Database

Charles Hooper's Oracle Notes

March 10, 2010

In one of last week’s blog articles I asked why a SQL statement that had appeared in a book, was copied to various websites, and was offered as an example of good SQL simply did not work.  A couple of readers of this blog took up the challenge to offer suggestions.  I think that I found another example of blindly reproducing other’s code without verifying that the code works as expected.  What did I find this time?


rem ----------------------------------------------------------------------- rem Filename:   NoTOAD.sql rem Purpose:    Block developers from using TOAD and other tools on rem             production databases. rem Date:       19-Jan-2004 rem Author:     Frank Naude rem ----------------------------------------------------------------------- CONNECT / AS SYSDBA; CREATE OR REPLACE TRIGGER block_tools_from_prod   AFTER LOGON ON DATABASE DECLARE   v_prog sys.v_$session.program%TYPE; BEGIN   SELECT program INTO v_prog     FROM sys.v_$session   WHERE  audsid = USERENV('SESSIONID')     AND  audsid != 0  -- Don't Check SYS Connections    …

View original post 590 more words


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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s