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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle 查看任务数量,关于dbms_scheduler创建任务数量的疑问

發布時間:2023/12/19 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle 查看任务数量,关于dbms_scheduler创建任务数量的疑问 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本帖最后由 cszxheap 于 2015-3-19 17:52 編輯

首先確認系統版本號

SQL> select * from v$version;

BANNER? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? CON_ID

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

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production? ?? ?? ?? ???0

PL/SQL Release 12.1.0.2.0 - Production? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? 0

CORE? ? 12.1.0.2.0? ?? ?Production? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? 0

TNS for Linux: Version 12.1.0.2.0 - Production? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???0

NLSRTL Version 12.1.0.2.0 - Production? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? 0

Elapsed: 00:00:00.01

SQL> show user

USER is "SEAN"

SQL> SQL> CREATE OR REPLACE PROCEDURE sp_abc --計劃任務執行的過程

AS

BEGIN

dbms_output.put_line('BEGIN:'||to_char(SYSDATE,'HH24:MI:SS'));

dbms_lock.sleep(2);

dbms_output.put_line('END:'||to_char(SYSDATE,'HH24:MI:SS'));

END;??2? ? 3? ? 4? ? 5? ? 6? ? 7

8??/

Procedure created.

Elapsed: 00:00:00.02

我們開始執行100個并發任務。。。。

SQL>? ?2? ?? ?-- Local variables here

3? ?? ?i INTEGER;

4

5

12? ?? ?v_jobname VARCHAR2(100);

BEGIN

13? ?14? ?? ?-- Test statements here

15? ?? ?FOR x IN 1 .. 100

16? ?? ?LOOP

17? ?? ?? ? --制定任務

18? ?? ?? ? SELECT 'SEAN_' || lpad(x, 3, '0') INTO v_jobname FROM dual;

19? ?? ?? ? dbms_output.put_line(v_jobname);

20? ?? ?? ? dbms_scheduler.create_job(job_name? ?=> v_jobname,

21? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?job_type? ?=> 'stored_procedure',

22? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?job_action => 'sp_abc',

23? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?enabled? ? => TRUE);

24

25? ?? ?END LOOP;

26??END;

27??/

SEAN_001

SEAN_002

..

SEAN_099

SEAN_100

PL/SQL procedure successfully completed.

查看系統設置參數。。。。

Elapsed: 00:00:00.20

SQL> show parameter job

NAME? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?TYPE? ?? ???VALUE

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

job_queue_processes? ?? ?? ?? ?? ?? ?integer? ???1000

到這里,任務創建并開始執行,后臺job進程數設置為1000,然后我們去系統看看進程數,發現

[oracle@cfx-db1:/home/oracle]$ps -fu oracle | grep ora_j | grep -v grep

oracle? ? 65512? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j000_cfxdba

oracle? ? 65516? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j001_cfxdba

oracle? ? 65520? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j002_cfxdba

oracle? ? 65524? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j003_cfxdba

oracle? ? 65528? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j004_cfxdba

oracle? ? 65532? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j005_cfxdba

oracle? ? 65536? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j006_cfxdba

oracle? ? 65540? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j007_cfxdba

[oracle@cfx-db1:/home/oracle]$ps -fu oracle | grep ora_j | grep -v grep

oracle? ? 65512? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j000_cfxdba

oracle? ? 65516? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j001_cfxdba

oracle? ? 65520? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j002_cfxdba

oracle? ? 65524? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j003_cfxdba

oracle? ? 65528? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j004_cfxdba

oracle? ? 65532? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j005_cfxdba

oracle? ? 65536? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j006_cfxdba

oracle? ? 65540? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j007_cfxdba

[oracle@cfx-db1:/home/oracle]$ps -fu oracle | grep ora_j | grep -v grep

oracle? ? 65512? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j000_cfxdba

oracle? ? 65516? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j001_cfxdba

oracle? ? 65520? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j002_cfxdba

oracle? ? 65524? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j003_cfxdba

oracle? ? 65528? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j004_cfxdba

oracle? ? 65532? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j005_cfxdba

oracle? ? 65536? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j006_cfxdba

oracle? ? 65540? ?? ?1??0 09:31 ?? ?? ???00:00:00 ora_j007_cfxdba

單位時間內最多只有8個job進程在工作,然后看看日志

SELECT s.owner,

s.job_name,

s.req_start_date,

s.actual_start_date,

s.actual_start_date-s.req_start_date,

s.run_duration

FROM dba_scheduler_job_run_details s

ORDER BY s.JOB_NAME DESC;

OWNER? ?? ???JOB_NAME? ?? ???REQ_START_DATE? ?? ???ACTUAL_START_DATE? ?? ???S.ACTUAL_START_DATE-S.REQ_STAR? ?? ???RUN_DURATION

1? ?? ???SEAN? ?? ???SEAN_100? ?? ???19-3月 -15 09.31.56.609939 上午 PRC? ?? ???19-3月 -15 09.33.43.704488 上午 PRC? ?? ???+000000000 00:01:47.094549? ?? ???+000 00:00:05

2? ?? ???SEAN? ?? ???SEAN_099? ?? ???19-3月 -15 09.31.56.607759 上午 PRC? ?? ???19-3月 -15 09.33.43.704622 上午 PRC? ?? ???+000000000 00:01:47.096863? ?? ???+000 00:00:05

3? ?? ???SEAN? ?? ???SEAN_098? ?? ???19-3月 -15 09.31.56.605817 上午 PRC? ?? ???19-3月 -15 09.33.35.479287 上午 PRC? ?? ???+000000000 00:01:38.873470? ?? ???+000 00:00:05

4? ?? ???SEAN? ?? ???SEAN_097? ?? ???19-3月 -15 09.31.56.603942 上午 PRC? ?? ???19-3月 -15 09.33.35.477664 上午 PRC? ?? ???+000000000 00:01:38.873722? ?? ???+000 00:00:05

5? ?? ???SEAN? ?? ???SEAN_096? ?? ???19-3月 -15 09.31.56.601962 上午 PRC? ?? ???19-3月 -15 09.33.35.477651 上午 PRC? ?? ???+000000000 00:01:38.875689? ?? ???+000 00:00:05

6? ?? ???SEAN? ?? ???SEAN_095? ?? ???19-3月 -15 09.31.56.599939 上午 PRC? ?? ???19-3月 -15 09.33.35.477781 上午 PRC? ?? ???+000000000 00:01:38.877842? ?? ???+000 00:00:05

7? ?? ???SEAN? ?? ???SEAN_094? ?? ???19-3月 -15 09.31.56.597746 上午 PRC? ?? ???19-3月 -15 09.33.35.477789 上午 PRC? ?? ???+000000000 00:01:38.880043? ?? ???+000 00:00:05

8? ?? ???SEAN? ?? ???SEAN_093? ?? ???19-3月 -15 09.31.56.595880 上午 PRC? ?? ???19-3月 -15 09.33.35.477724 上午 PRC? ?? ???+000000000 00:01:38.881844? ?? ???+000 00:00:05

9? ?? ???SEAN? ?? ???SEAN_092? ?? ???19-3月 -15 09.31.56.594021 上午 PRC? ?? ???19-3月 -15 09.33.35.477645 上午 PRC? ?? ???+000000000 00:01:38.883624? ?? ???+000 00:00:05

10? ?? ???SEAN? ?? ???SEAN_091? ?? ???19-3月 -15 09.31.56.592154 上午 PRC? ?? ???19-3月 -15 09.33.30.160901 上午 PRC? ?? ???+000000000 00:01:33.568747? ?? ???+000 00:00:05

11? ?? ???SEAN? ?? ???SEAN_090? ?? ???19-3月 -15 09.31.56.590239 上午 PRC? ?? ???19-3月 -15 09.33.30.160508 上午 PRC? ?? ???+000000000 00:01:33.570269? ?? ???+000 00:00:05

12? ?? ???SEAN? ?? ???SEAN_089? ?? ???19-3月 -15 09.31.56.588048 上午 PRC? ?? ???19-3月 -15 09.33.30.160469 上午 PRC? ?? ???+000000000 00:01:33.572421? ?? ???+000 00:00:05

13? ?? ???SEAN? ?? ???SEAN_088? ?? ???19-3月 -15 09.31.56.586082 上午 PRC? ?? ???19-3月 -15 09.33.30.160523 上午 PRC? ?? ???+000000000 00:01:33.574441? ?? ???+000 00:00:05

14? ?? ???SEAN? ?? ???SEAN_087? ?? ???19-3月 -15 09.31.56.584224 上午 PRC? ?? ???19-3月 -15 09.33.30.160527 上午 PRC? ?? ???+000000000 00:01:33.576303? ?? ???+000 00:00:05

15? ?? ???SEAN? ?? ???SEAN_086? ?? ???19-3月 -15 09.31.56.582344 上午 PRC? ?? ???19-3月 -15 09.33.30.160394 上午 PRC? ?? ???+000000000 00:01:33.578050? ?? ???+000 00:00:05

16? ?? ???SEAN? ?? ???SEAN_085? ?? ???19-3月 -15 09.31.56.580443 上午 PRC? ?? ???19-3月 -15 09.33.30.160911 上午 PRC? ?? ???+000000000 00:01:33.580468? ?? ???+000 00:00:05

。。。。。。。。。。。。。

87? ?? ???SEAN? ?? ???SEAN_014? ?? ???19-3月 -15 09.31.56.444196 上午 PRC? ?? ???19-3月 -15 09.32.04.850244 上午 PRC? ?? ???+000000000 00:00:08.406048? ?? ???+000 00:00:05

88? ?? ???SEAN? ?? ???SEAN_013? ?? ???19-3月 -15 09.31.56.442356 上午 PRC? ?? ???19-3月 -15 09.32.04.850291 上午 PRC? ?? ???+000000000 00:00:08.407935? ?? ???+000 00:00:05

89? ?? ???SEAN? ?? ???SEAN_012? ?? ???19-3月 -15 09.31.56.440439 上午 PRC? ?? ???19-3月 -15 09.32.04.850355 上午 PRC? ?? ???+000000000 00:00:08.409916? ?? ???+000 00:00:05

90? ?? ???SEAN? ?? ???SEAN_011? ?? ???19-3月 -15 09.31.56.438361 上午 PRC? ?? ???19-3月 -15 09.32.04.850315 上午 PRC? ?? ???+000000000 00:00:08.411954? ?? ???+000 00:00:05

91? ?? ???SEAN? ?? ???SEAN_010? ?? ???19-3月 -15 09.31.56.436556 上午 PRC? ?? ???19-3月 -15 09.32.04.850355 上午 PRC? ?? ???+000000000 00:00:08.413799? ?? ???+000 00:00:05

92? ?? ???SEAN? ?? ???SEAN_009? ?? ???19-3月 -15 09.31.56.434471 上午 PRC? ?? ???19-3月 -15 09.32.04.849637 上午 PRC? ?? ???+000000000 00:00:08.415166? ?? ???+000 00:00:05

93? ?? ???SEAN? ?? ???SEAN_008? ?? ???19-3月 -15 09.31.56.432617 上午 PRC? ?? ???19-3月 -15 09.32.04.849642 上午 PRC? ?? ???+000000000 00:00:08.417025? ?? ???+000 00:00:05

94? ?? ???SEAN? ?? ???SEAN_007? ?? ???19-3月 -15 09.31.56.430785 上午 PRC? ?? ???19-3月 -15 09.31.56.627770 上午 PRC? ?? ???+000000000 00:00:00.196985? ?? ???+000 00:00:05

95? ?? ???SEAN? ?? ???SEAN_006? ?? ???19-3月 -15 09.31.56.428984 上午 PRC? ?? ???19-3月 -15 09.31.56.600048 上午 PRC? ?? ???+000000000 00:00:00.171064? ?? ???+000 00:00:05

96? ?? ???SEAN? ?? ???SEAN_005? ?? ???19-3月 -15 09.31.56.427186 上午 PRC? ?? ???19-3月 -15 09.31.56.613400 上午 PRC? ?? ???+000000000 00:00:00.186214? ?? ???+000 00:00:05

97? ?? ???SEAN? ?? ???SEAN_004? ?? ???19-3月 -15 09.31.56.425017 上午 PRC? ?? ???19-3月 -15 09.31.56.585836 上午 PRC? ?? ???+000000000 00:00:00.160819? ?? ???+000 00:00:05

98? ?? ???SEAN? ?? ???SEAN_003? ?? ???19-3月 -15 09.31.56.423124 上午 PRC? ?? ???19-3月 -15 09.31.56.571928 上午 PRC? ?? ???+000000000 00:00:00.148804? ?? ???+000 00:00:05

99? ?? ???SEAN? ?? ???SEAN_002? ?? ???19-3月 -15 09.31.56.421122 上午 PRC? ?? ???19-3月 -15 09.31.56.555690 上午 PRC? ?? ???+000000000 00:00:00.134568? ?? ???+000 00:00:05

100? ?? ???SEAN? ?? ???SEAN_001? ?? ???19-3月 -15 09.31.56.419074 上午 PRC? ?? ???19-3月 -15 09.31.56.438919 上午 PRC? ?? ???+000000000 00:00:00.019845? ?? ???+000 00:00:05

果然在REQ_START_DATE基本相同的情況下,ACTUAL_START_DATE越來越推遲,每個批次(ACTUAL_START_DATE類似)的數量也為7個左右

問題來了

1:為何后臺進程運參數設置為1000,而實際只有8個在并行跑?

2:是否需要考慮設置scheduler的max_job_slave_process參數?現在為默認值NULL,可是從reference上說明了job_queue_process的值大于0則該參數無意義

總結

以上是生活随笔為你收集整理的oracle 查看任务数量,关于dbms_scheduler创建任务数量的疑问的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。