Pular para o conteúdo

Habilitar DDL no alert.log Oracle

Habilitar DDL no alert.log Oracle

Fala pessoal, o 11g tem um recurso interessante que é habilitar o log de comandos DDLs no alert.log, para habilitar é bem simples basta alterar o parâmetro ENABLE_DDL_LOGGING para true, segue abaixo um pequeno step by step que altera o parâmetro e cria alguns objetos para teste.

 COLUMN DESCRIPTION FORMAT A30
 COLUMN VALUE FORMAT A30
 SET LINESIZE 120
 
 SQL> select value,isdefault,isses_modifiable, issys_modifiable,isbasic,description  
 from v$parameter  where name='enable_ddl_logging';
 
 VALUE  ISDEFAULT ISSES ISSYS_MOD ISBAS DESCRIPTION
 ------ --------- ----- --------- ----- -------------------
 FALSE   TRUE    TRUE  IMMEDIATE FALSE enable ddl logging
 
 SQL> alter system set ENABLE_DDL_LOGGING=true ;
 
 System altered.
 
 SQL> conn hudson/c402d92
 
 Connected
 
 SQL> create table t_hudson as select * from user_tables;
 
 Table created.
 
 SQL> grant select on t_hudson to public;
 
 Grant succeeded.
 
 SQL> alter table t_hudson read only;
 
 Table altered.
 
 SQL> drop table t_hudson ;
 
 Table dropped.

Após a alteração do parâmetro vamos verificar se foi gerado o log no alert.log:

[oracle@rjhud trace]$ tail -f alert_centro.log

Mon Nov 21 15:58:43 2011

SMCO started with pid=31, OS id=5981

Mon Nov 21 16:08:37 2011

ALTER SYSTEM SET enable_ddl_logging=TRUE SCOPE=SPFILE;

ALTER SYSTEM SET enable_ddl_logging=TRUE SCOPE=BOTH;

Mon Nov 21 16:09:41 2011

create table t_hudson as select * from user_tables

Mon Nov 21 16:10:09 2011

alter table t_hudson read only

drop table t_hudson

Para maiores informações sobre o parâmetro é só consultar o link.

Quão útil foi este post ?

Clique em uma estrela para classificar o post

nota média 5 / 5. Contagem de votos: 22

Sem votos ! Seja o primeiro a classificar !

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

plugins premium WordPress