dbTalk Databases Forums  

DDL Trigger on schema - capturing content

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss DDL Trigger on schema - capturing content in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Luch
 
Posts: n/a

Default DDL Trigger on schema - capturing content - 03-08-2008 , 01:56 PM






I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.



Reply With Quote
  #2  
Old   
Maxim Demenko
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 03:26 PM






Luch schrieb:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.


Have you looked at
http://download.oracle.com/docs/cd/B...s.htm#ADFNS012
in particular on ora_sql_txt ?

Best regards

Maxim


Reply With Quote
  #3  
Old   
Maxim Demenko
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 03:26 PM



Luch schrieb:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.


Have you looked at
http://download.oracle.com/docs/cd/B...s.htm#ADFNS012
in particular on ora_sql_txt ?

Best regards

Maxim


Reply With Quote
  #4  
Old   
Maxim Demenko
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 03:26 PM



Luch schrieb:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.


Have you looked at
http://download.oracle.com/docs/cd/B...s.htm#ADFNS012
in particular on ora_sql_txt ?

Best regards

Maxim


Reply With Quote
  #5  
Old   
Maxim Demenko
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 03:26 PM



Luch schrieb:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.


Have you looked at
http://download.oracle.com/docs/cd/B...s.htm#ADFNS012
in particular on ora_sql_txt ?

Best regards

Maxim


Reply With Quote
  #6  
Old   
DA Morgan
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 06:36 PM



Luch wrote:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.
Demo in Morgan's Library under DDL event triggers at www.psoug.org.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #7  
Old   
DA Morgan
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 06:36 PM



Luch wrote:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.
Demo in Morgan's Library under DDL event triggers at www.psoug.org.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #8  
Old   
DA Morgan
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 06:36 PM



Luch wrote:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.
Demo in Morgan's Library under DDL event triggers at www.psoug.org.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #9  
Old   
DA Morgan
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-08-2008 , 06:36 PM



Luch wrote:
Quote:
I'm using a trigger like so:
CREATE OR REPLACE
TRIGGER TRG_SCHEMA_CHANGES
AFTER DDL ON "MYSCHEMA".SCHEMA

To capture all schema changes to a table I made. I use these variables
to capture some pertinent data:
ora_login_user;
ora_sysevent;
ora_dict_obj_type;
ora_dict_obj_owner;
ora_dict_obj_name;

I put the above into fields of the table I made. Seems to work fine.

What I would like to know is, how do I capture the ddl statement
itself? I'd like to put the DDL statement itself that fired the
trigger into a clob/blob field.
Demo in Morgan's Library under DDL event triggers at www.psoug.org.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #10  
Old   
Luch
 
Posts: n/a

Default Re: DDL Trigger on schema - capturing content - 03-09-2008 , 11:16 AM



On Mar 8, 5:26 pm, Maxim Demenko <mdeme... (AT) gmail (DOT) com> wrote:
Quote:
Have you looked athttp://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_...
in particular on ora_sql_txt ?
Thanks guys, that's what I wanted.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.