日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle alter_log,在线查看alter.log文件内容

發(fā)布時(shí)間:2023/12/15 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle alter_log,在线查看alter.log文件内容 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在Oracle9i中,使用External Table和動態(tài)SQL,在線地查看alter.log文件內(nèi)容,從而進(jìn)行某些查詢、工作調(diào)度來監(jiān)控錯誤。

使用下面的腳本可以實(shí)現(xiàn)上述的要求。

SQL> drop table e_alert_log;

Table dropped.

SQL> drop table t_perm_alert_log;

Table dropped.

SQL> drop table t_temp_alert_log;

Table dropped.

SQL> create or replace DIRECTORY alert_dir as 'D:oracleadminoracle9bdump';

Directory created.

SQL> create table e_alert_log

2 (detail_line VARCHAR2(2000)

3 ) ORGANIZATION EXTERNAL

4 (TYPE oracle_loader

5 DEFAULT DIRECTORY alert_dir

6 ACCESS PARAMETERS

7 ( RECORDS DELIMITED BY NEWLINE

8 nobadfile

9 nologfile

10 nodiscardfile

11 FIELDS TERMINATED by ' '

12 MISSING FIELD VALUES ARE NULL

13 (detail_line )

14 )

15 LOCATION('alert_oracle9.log') )

16 parallel 5

17 REJECT LIMIT UNLIMITED;

Table created.

SQL> create table t_perm_alert_log

2 (row_id number,

3 detail_line varchar2(2000) )

4 tablespace users

5 storage (initial 1m next 1m pctincrease 0);

Table created.

SQL>

SQL> create table t_temp_alert_log

2 (row_id number,

3 detail_line varchar2(2000) )

4 tablespace users

5 storage (initial 1m next 1m pctincrease 0);

Table created.

SQL>

SQL>

SQL> create or replace procedure update_alert as

2 BEGIN

3

4 -- This truncates the temp table from the last run...

5 execute immediate 'truncate table t_temp_alert_log';

6

7 -- Now, populate the temp table with all the alert log contents....

8 execute immediate 'insert into t_temp_alert_log select rownum,

9 detail_line from e_alert_log';

10

11 -- Now, populate the perm table with just the changes.....

12 execute immediate 'insert into t_perm_alert_log select row_id,

13 detail_line from t_temp_alert_log b

14 where b.row_id > (select nvl(max(a.row_id),0) from t_perm_alert_log a)';

15 END;

16 /

Procedure created.

SQL> exec update_alert

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

SQL> select DETAIL_LINE from t_temp_alert_log sample(0.1) ;

DETAIL_LINE

--------------------------------------------------------------------------------

ORA-12012: error on auto execute of job 1

Created Undo Segment _SYSSMU18$

Undo Segment 8 Offlined

3 rows selected.

總結(jié)

以上是生活随笔為你收集整理的oracle alter_log,在线查看alter.log文件内容的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。