Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: audit alter table add column and drop column
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;
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 Wed Jan 03 2007 - 07:07:16 CST