使用外部表讀日誌檔案

wmlm發表於2007-04-11
根據TOM的提示,使用外部表來檢視資料庫的警告日誌檔案[@more@]conn system/manager
grant create any directory to scott;
grant drop any directory to scott;
conn scott/tiger
create or replace directory data_dir as 'D:oracleadmingswebbdump';
-- grant read,write on directory data_dir to scott ;
CREATE TABLE alert_log
(
text_line varchar2(255)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY DATA_DIR
ACCESS PARAMETERS
(
records delimited by newline
fields
REJECT ROWS WITH ALL NULL FIELDS
)
LOCATION
(
'alert_gsweb.log'
)
)
REJECT LIMIT unlimited
/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-909954/,如需轉載,請註明出處,否則將追究法律責任。

相關文章