From oracle-l-bounce@freelists.org Thu Jan 13 06:35:14 2005 Return-Path: Received: from air189.startdedicated.com (root@localhost) by orafaq.com (8.11.6/8.11.6) with ESMTP id j0DCZEv27051 for ; Thu, 13 Jan 2005 06:35:14 -0600 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id j0DCZDn27045 for ; Thu, 13 Jan 2005 06:35:13 -0600 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0DE4972CB1F; Thu, 13 Jan 2005 07:41:50 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18115-04; Thu, 13 Jan 2005 07:41:49 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id F0D6F72CB8C; Thu, 13 Jan 2005 07:41:47 -0500 (EST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: RE: ddl audit trigger Date: Thu, 13 Jan 2005 14:39:44 +0200 Message-ID: <1831A554E8800049B6B970790D2513C001C35FBF@fnbkrkmx01.fnb.co.za> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ddl audit trigger Thread-Index: AcT5bHod3AmpJKjGSQGXjoDbkeMbxgAAEVzg From: "Leonard, George" To: "rjamya" Cc: "Oracle-L Freelists" X-OriginalArrivalTime: 13 Jan 2005 12:39:48.0399 (UTC) FILETIME=[F7E523F0:01C4F96C] X-archive-position: 14756 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: GLeonard@wesbank.co.za Precedence: normal Reply-To: GLeonard@wesbank.co.za X-list: oracle-l X-Virus-Scanned: by amavisd-new at freelists.org Hi all Well the drop is happily happening, so as for Raj race, the drop wins every time. The reason I want to catch it is to log the drop to a special hidden place. Just in case someone tries to drop it to cause some mischief. This is especially relevant in the development environment where one of the user logins have DBA (don't ask) thus able to drop the trigger. George =20________________________________________________ George Leonard Oracle Database Administrator New Dawn Technologies @ Wesbank E-mail:gleonard@wesbank.co.za =20 You Have The Obligation to Inform One Honestly of the risk, And As a Person You Are Committed to Educate Yourself to the Total Risk In Any Activity! Once Informed & Totally Aware of the Risk, Every Fool Has the Right to Kill or Injure Themselves as They See Fit! =20 -----Original Message----- From: rjamya [mailto:rjamya@gmail.com]=20 Sent: 13 January 2005 14:36 PM To: Leonard, George Cc: Oracle-L Freelists Subject: Re: ddl audit trigger let me put it this way ...=20 if you shot yourself dead, would you still call 911 and report yourself?=20 since drop will acquire a ddl lock (loose term), execution will be prevented as execution also needs a lock to stop the underlying object from being modified. If what you want must happen, this will become a classic example of a race condition. Basically first one to get the lock wins, in this case the 'drop' got the lock first. obviously I could be wrong, but a correction is appreciated. Raj On Thu, 13 Jan 2005 14:06:14 +0200, Leonard, George wrote: > Hi all >=20 > Written a database trigger ddltrigger that fires on ddl on database. > Owned by system >=20 > Prompt Creating Trigger ddltrigger > CREATE OR REPLACE TRIGGER DDLTrigger > BEFORE DROP OR DDL ON DATABASE >=20 > DECLARE > BEGIN > =3D09ddlaudit.audit; > END; >=20 > This then calls a package that does a small amount of work (also owned > by system), this then calls the meaty packaged owned by another user > (not system) that does the actual logging. >=20 > Problem I am having is this trigger does not fire when it is dropped > itself. >=20 > Any ideas >=20 > George > =3D20________________________________________________ > George Leonard > Oracle Database Administrator > New Dawn Technologies @ Wesbank > E-mail:gleonard@wesbank.co.za > =3D20 > You Have The Obligation to Inform One Honestly of the risk, And As a > Person > You Are Committed to Educate Yourself to the Total Risk In Any Activity! > Once Informed & Totally Aware of the Risk, > Every Fool Has the Right to Kill or Injure Themselves as They See Fit! > =3D20 >=20 > ________________________________________________________________________ _=3D > __________________________ >=20 > The views expressed in this email are, unless otherwise stated, those of =3D > the author and not those > of the FirstRand Banking Group an Authorised Financial Service Provider o=3D > r its management. > The information in this e-mail is confidential and is intended solely for=3D > =3D20the addressee. > Access to this e-mail by anyone else is unauthorised. > If you are not the intended recipient, any disclosure, copying, distribut=3D > ion or any action taken or=3D20 > omitted in reliance on this, is prohibited and may be unlawful. > Whilst all reasonable steps are taken to ensure the accuracy and integrit=3D > y of information and data=3D20 > transmitted electronically and to preserve the confidentiality thereof, n=3D > o liability or=3D20 > responsibility whatsoever is accepted if information or data is, for what=3D > ever reason, corrupted=3D20 > or does not reach its intended destination. >=20 > =3D20 ________________________________ > -- > http://www.freelists.org/webpage/oracle-l >=20 --=20 ------------------------------ select standard_disclaimer from company_requirements where category =3D 'MANDATORY'; _________________________________________________________________________= __________________________ The views expressed in this email are, unless otherwise stated, those of = the author and not those of the FirstRand Banking Group an Authorised Financial Service Provider o= r its management. The information in this e-mail is confidential and is intended solely for= =20the addressee. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribut= ion or any action taken or=20 omitted in reliance on this, is prohibited and may be unlawful. Whilst all reasonable steps are taken to ensure the accuracy and integrit= y of information and data=20 transmitted electronically and to preserve the confidentiality thereof, n= o liability or=20 responsibility whatsoever is accepted if information or data is, for what= ever reason, corrupted=20 or does not reach its intended destination. =20 ________________________________ -- http://www.freelists.org/webpage/oracle-l