Wednesday, February 1, 2012

Create external table to read alert log

connect sys /as sysdba

create directory BDUMP as 'C:\app\Administrator\diag\rdbms\orcl\orcl\trace';

create table
alertlog ( msg varchar2(100) )
organization external (
type oracle_loader
default directory BDUMP
access parameters (
records delimited by newline
)
location('alert_orcl.log')
)
reject limit unlimited;


select msg from alertlog;

MSG
-----------------------------

Wed Feb 01 14:51:51 2012
DBW0 started with pid=9
Wed Feb 01 14:51:51 2012
LGWR started with pid=10
Wed Feb 01 14:51:52 2012
CKPT started with pid=11
Wed Feb 01 14:51:52 2012
SMON started with pid=12
Wed Feb 01 14:51:52 2012
RECO started with pid=13
Wed Feb 01 14:51:52 2012

No comments:

Post a Comment