使用外部表查看ORACLE报警日志
2009-06-22 11:50:29 来源:WEB开发网测试成功,可见在数据库中可以查询OS文件的数据
2. 使用外部表查看oracle报警日志
由于在上面实验中已建立了一个用户,并赋相应的权限,而且也有了OS文件(即报警文件alert_SID.log),所以在此直接建立目录对象并建立外部表就可以了。
1.建立目录对象 SQL> conn test / 123
Connected.
SQL> create directory bdump as '/oracle/u01/app/oracle/admin/db2/bdump';
Directory created.
2.建立外部表 SQL> create table alert_log(
text varchar2(400)
)organization external
(type oracle_loader
default directory bdump
access parameters
(records delimited by newline
)location('alert_db2.log')
);
3.测试
首先查看能否查到alert_db2.log的内容
SQL> select * from alert_log where rownum < 10;
TEXT
--------------------------------------------------------------------------------
Thu Jun 11 00:51:46 2009
Starting ORACLE instance (normal)
Cannot determine all dependent dynamic libraries for /proc/self/exe
Unable to find dynamic library libocr10.so in search paths
RPATH = /ade/aime1_build2101/oracle/has/lib/:/ade/aime1_build2101/oracle/lib/:/a
de/aime1_build2101/oracle/has/lib/:
LD_LIBRARY_PATH is not set!
The default library directories are /lib and /usr/lib
Unable to find dynamic library libocrb10.so in search paths
Unable to find dynamic library libocrutl10.so in search paths
9 rows selected.
更多精彩
赞助商链接