首先了解什麼是外部表
一
外部表定義
作用
與其它表的區別
二
因為外部表主要是查看OS上的文件
mkdir
vi /oracle/ext/ext
在此我們先建一個新用戶
create user test identified by
用戶授權
SQL> grant create any directory to test;
建立目錄對象
SQL> conn test /
Connected
SQL> create directory ext as
Directory created
SQL> create table exttable(
id number
)organization external
(type oracle_loader
default directory ext
Access parameters
(records delimited by newline
fields terminated by
)location(
);
SQL> select * from exttable;
ID NAME I
測試成功
二
由於在上面實驗中已建立了一個用戶
SQL> conn test /
Connected
SQL> create directory bdump as
Directory created
SQL> create table alert_log(
text varchar
)organization external
(type oracle_loader
default directory bdump
access parameters
(records delimited by newline
)location(
);
首先查看能否查到alert_db
SQL> select * from alert_log where rownum <
TEXT
Thu Jun
Starting ORACLE instance (normal)
Cannot determine all dependent dynamic libraries for /proc/self/exe
Unable to find dynamic library libocr
RPATH = /ade/aime
de/aime
LD_LIBRARY_PATH is not set!
The default library directories are /lib and /usr/lib
Unable to find dynamic library libocrb
Unable to find dynamic library libocrutl
測試成功
然後我們測試查報警信息
SQL> select * from alert_log where text like
TEXT
ORA
ORA
ORA
ORA
og
ORA
ORA
ORA
TEXT
ORA
ORA
ORA
ORA
ORA
ORA
ORA
測試成功
可見我們可以使用外部表來方便的查看ORACLE的報警信息
From:http://tw.wingwit.com/Article/program/Oracle/201311/17260.html