dbTalk Databases Forums  

How to track structural changes in db

comp.databases.oracle comp.databases.oracle


Discuss How to track structural changes in db in the comp.databases.oracle forum.



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

Default How to track structural changes in db - 06-24-2004 , 03:44 AM






hi,
i worry about people doing something they shouldn't to my db and I
would like to track any structural changes (who and which)to my db. I
am using oracle 8.0.6.0.0 and 9.2.0.2.0.

regards,
Lee Cho

Reply With Quote
  #2  
Old   
Jim Kennedy
 
Posts: n/a

Default Re: How to track structural changes in db - 06-24-2004 , 08:18 AM







"LC" <leecholim (AT) hotmail (DOT) com> wrote

Quote:
hi,
i worry about people doing something they shouldn't to my db and I
would like to track any structural changes (who and which)to my db. I
am using oracle 8.0.6.0.0 and 9.2.0.2.0.

regards,
Lee Cho
Best way is to not give them the rights to do any. If you have to then
create a trigger on ddl changes and track the user and when in a table. See
SQL Reference documentation.
Jim




Reply With Quote
  #3  
Old   
abhay
 
Posts: n/a

Default Re: How to track structural changes in db - 06-24-2004 , 11:12 AM



leecholim (AT) hotmail (DOT) com (LC) wrote in message news:<d15e389.0406240044.65c6e9cd (AT) posting (DOT) google.com>...
Quote:
hi,
i worry about people doing something they shouldn't to my db and I
would like to track any structural changes (who and which)to my db. I
am using oracle 8.0.6.0.0 and 9.2.0.2.0.

regards,
Lee Cho
At least in case of 9.2.0.2.0 database, you can use APPLICATION_DDL trigger.


Reply With Quote
  #4  
Old   
tracy
 
Posts: n/a

Default Re: How to track structural changes in db - 06-25-2004 , 02:48 AM



hi, Lee Cho
try this as provided by norman dunbar in DBAZine.
step 1: create tablespace, user and table using system as below:

conn system/manager@test

/* create tablespace*/
create tablespace logging
datafile'/data2/test/logging.dbf' size 200m
extent management local
uniform size 64k;

tablespace created

/*create user*/
create user logging identified by daft
default tablespace logging
temporary tablespace temp
quota 0 on system
quota 200m on logging

user created

/* create table*/

create table logging.ddl_log(
user_name varchar2(30),
ddl_date date,
ddl_type varchar2(30),
object_type varchar2(100),
owner varchar2(100),
object_name varchar2(150)
) tablespace logging

table created


-------
connect sys@test
enter password: XXX
connected.

/*create trigger*/
create or replace trigger DDLtrigger
after DDL on database
begin
insert into logging.ddl_log
values(ora_login_user,
sysdate,
ora_sysevent,
ora_dict_obj_type,
ora_dict_obj_owner,
ora_dict_obj_name);
exception
when others then
NULL;
end;

trigger created.

then using a userid and login. simply perform some ddl statemnet.

then query the table :
column user_name format a10
column ddl_date format a20
column owner_ format a10
column object_name format a20
column object_type format a20
column ddl_type format a20
set lines 150
set pages 50
select * from logging.ddl_log
/

u will able to see the track.

all the best!

regards,
tracy















kumara (AT) questdiagnostics (DOT) com (abhay) wrote in message news:<23185450.0406240812.7d77ed6b (AT) posting (DOT) google.com>...
Quote:
leecholim (AT) hotmail (DOT) com (LC) wrote in message news:<d15e389.0406240044.65c6e9cd (AT) posting (DOT) google.com>...
hi,
i worry about people doing something they shouldn't to my db and I
would like to track any structural changes (who and which)to my db. I
am using oracle 8.0.6.0.0 and 9.2.0.2.0.

regards,
Lee Cho

At least in case of 9.2.0.2.0 database, you can use APPLICATION_DDL trigger.

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.