1 创建一个路径
create or replace directory trc as 'E:\oracle\diag\rdbms\mydb\mysid\trace';
查看是否创建成功
select * from dba_directories;
2 创建外部表
create table alert_log ( text varchar2(400) )
organization external (
type oracle_loader
default directory trc
access parameters (
records delimited by newline
nobadfile
nodiscardfile
nologfile
)
location('mysid_ora_2772.trc') 这个文件要放在trc指定的目录下
)
reject limit unlimited
3查看外部表
select * from alert_log where rownum < 5;