Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: audit alter table add column and drop column

Re: audit alter table add column and drop column

From: aman.oracle.dba <aman.oracle.dba_at_gmail.com>
Date: 3 Jan 2007 22:09:42 -0800
Message-ID: <1167890981.612364.95960@i80g2000cwc.googlegroups.com>

janik_at_pobox.sk wrote:
> One option is via system event triggers, you can audit ALTER TABLE
> command. If you want to audit just a specific operation, you can
> achieve it via string functions + IF.. THEN.
>
> CREATE OR REPLACE TRIGGER test
> BEFORE ALTER ON SCHEMA
> DECLARE
>
> sql_text ora_name_list_t;
> stmt VARCHAR2(2000);
> n integer;
>
> BEGIN
> null;
> IF (ora_dict_obj_type IN ( 'TABLE') )
> then
> n:= ora_sql_txt(sql_text);
>
> FOR i IN 1..n LOOP
> stmt := stmt || sql_text(i);
> END LOOP;
>
> INSERT NTO your_table (username,sql_text) VALUES (user,stmt);
>
> END IF;
> END test;
>

Thank You
> Jan
>
>
> aman.oracle.dba napísal(a):
> > hi all,
> > I can audit create table and drop table commands but I want to audit
> > alter table command.
> > basically I want to audit add columns and drop columns commands. Is it
> > possible and if yes then how.
Received on Thu Jan 04 2007 - 00:09:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US