Hoy vamos a ver una entrada muy rápida sobre alguna información albergada en el alert.log
Como hemos hablado en alguna entrada anterior , las versiones 11 y 12 de Oracle disponen de una vista con la información del alert.log, ¿de que nos sirve esto?
Pues puede sernos muy útil para obtener mediante consultas SQL algunos patrones, por ejemplo
Veces que se ha hecho un ALTER en lo que llevamos de año
select
ORIGINATING_TIMESTAMP,
MESSAGE_TEXT
from sys.x$dbgalertext
where ORIGINATING_TIMESTAMP >
TO_TIMESTAMP('01-01-14 00:00:00','DD-MM-RR HH24:MI:SS')
and ( MESSAGE_TEXT like 'ALTER%')
Podemos filtrar mucho mas, por ejemplo , quitando las opciones de rman
Veces que se ha hecho un ALTER en lo que llevamos de año quitando el rman
select
ORIGINATING_TIMESTAMP,
MESSAGE_TEXT
from sys.x$dbgalertext
where ORIGINATING_TIMESTAMP >
TO_TIMESTAMP('01-01-14 00:00:00','DD-MM-RR HH24:MI:SS')
and module_id not in ('rman')
and ( MESSAGE_TEXT like 'ALTER%')
and( MESSAGE_TEXT not like 'ALTER DATABASE BACKUP CONTROLFILE TO %')
O si queremos ver las veces que se ha llevado a cabo un evento concreto como arrancado la base de datos
Veces que se ha hecho un ALTER DATABASE OPEN
select
ORIGINATING_TIMESTAMP,
MESSAGE_TEXT
from sys.x$dbgalertext
where ORIGINATING_TIMESTAMP >
TO_TIMESTAMP('01-01-14 00:00:00','DD-MM-RR HH24:MI:SS')
and( MESSAGE_TEXT like 'ALTER DATABASE OPEN%')
Como decía al principio, es una entrada muy sencilla, pero que, puede aportarnos información útil en muchos casos