| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> oracle >> Oracle 10g DBMS_SCHEDULER de zhong du jie xi
 

Oracle 10g DBMS_SCHEDULER de zhong du jie xi

2008-08-15 05:14:52 编辑來源:互联网 评论
 
本文为【Oracle 10g DBMS_SCHEDULER的中度解析】的拼音翻译版
  zhe pian lun tan wen zhang ( sai di wang ji shu she qu ) zhen dui DBMS_SCHEDULER de shi yong fang fa jin xing le xiang jin de jie shao , geng duo nei rong qing shen kao xia wen :
  DBMS_SCHEDULER shi Oracle 10G zhong xin zeng de yi ge bao , yu lao ban ben de dbms_job bao xiang bi ,dbms_scheduler you hen duo xin te xing , wo jiang tong guo yi xi lie de wen zhang lai jie shao yi xia ru he shi yong zhe ge bao .
  1. chuang jian job
  job shi shen me ne ? jian dan de shuo jiu shi ji hua (schedule) jia shang ren wu shuo ming . ling wai huan you yi xie bi xu de shen shu .
  zhe li ti dao de " ren wu " ke yi shi shu ju ku nei bu de cun chu guo cheng , ni ming de PL/SQL kuai , ye ke yi shi cao zuo xi tong ji bie de jiao ben .
  ke yi you liang zhong fang shi lai ding yi " ji hua ":
  1) shi yong DBMS_SCHDULER.CREATE_SCHEDULE ding yi yi ge ji hua ;
  2) tiao yong DBMS_SCHDULER.CREATE_JOBE guo cheng zhi jie zhi ding ( xia mian hui xiang xi shuo ming )
  zai chuang jian yi ge ji hua shi , ni zhi shao xu yao zhi ding xia mian de shu xing , ta men shi job yun xing suo bi xu de :
  kai shi shi jian (start_time);
  chong fu pin lv (repeat_interval);
  jie shu shi jian (end_time)
  ling wai , dui yu yi ge job er yan , huan you hen duo de fu jia shen shu :
  job_class
  job_priority
  auto_drop
  restartable
  max_runs
  max_failures
  schedule_limit
  logging_level
  xia mian , wo yi wen da de xing shi lai ju ti jie shi .
  Q1: zen me cong shu ju ku zhong cha xun job de shu xing ?
  A1: you liang zhong fang fa :
  1) cha xun (DBA|ALL|USER)_SCHEDULER_JOBS shi tu
  ( ti shi : gen ju yong hu quan xian de bu tong , xuan ze xing de cha xun DBA|ALL|USER shi tu )
  2) tiao yong DBMS_SCHEDULER bao zhong de GET_ATTRIBUTE guo cheng
  Q2: zen me she zhi zhe xie shu xing ne ?
  A2: ye shi you liang zhong fang fa
  1) zai chuang jian job shi zhi jie zhi ding
  2) tiao yong DBMS_SCHEDULER bao zhong de SET_ATTRIBUTE guo cheng
  Q3: " wo xu yao shen me quan xian cai neng chuang jian job" ?
  ta ke yi chuang jian shu zhu wei ren he yong hu (SYS yong hu chu wai ) de job.
  que sheng qing kuang xia ,job hui bei chuang jian zai dang qian de schema xia , bing qie shi mei you ji huo de ; ru guo yao shi job yi chuang jian
  jiu zi dong ji huo , xu yao xian shi de she zhi enabled shu xing wei true, lai kan yi ge li zi :
  begin
  dbms_scheduler.create_job
  (
  job_name => 'ARC_MOVE',
  schedule_name => 'EVERY_60_MINS',
  job_type => 'EXECUTABLE',
  job_action => '/home/dbtools/move_arcs.sh',
  enabled => true,
  comments => 'Move Archived Logs to a Different Directory'
  );
  end;
  /
  Q4: neng bu neng xiang xi di jiang shu yi xia shang mian zhe ge guo cheng yong dao de ge ge shen shu ?
  A4:
  job_name: gu ming si yi , mei ge job dou bi xu you yi ge de ming cheng
  schedule_name: ru guo ding yi le ji hua , zai zhe li zhi ding ji hua de ming cheng
  job_type: mu qian zhi chi san zhong lei xing :
  PL/SQL kuai : PLSQL_BLOCK,
  cun chu guo cheng : STORED_PROCEDURE
  wai bu cheng xu : EXECUTABLE ( wai bu cheng xu ke yi shi yi ge shell jiao ben , ye ke yi shi cao zuo xi tong ji bie de zhi ling ).
  job_action: gen ju job_type de bu tong ,job_action you bu tong de han yi .
  ru guo job_type zhi ding de shi cun chu guo cheng , jiu xu yao zhi ding cun chu guo cheng de ming zi ;
  ru guo job_type zhi ding de shi PL/SQL kuai , jiu xu yao shu ru wan zheng de PL/SQL dai ma ;
  ru guo job_type zhi ding de wai bu cheng xu , jiu xu yao shu ru script de ming cheng huo zhe cao zuo xi tong de zhi ling ming
  enabled: shang mian yi jing shuo guo le , zhi ding job chuang jian wan bi shi fou zi dong ji huo
  comments: dui yu job de jian dan shuo ming
  2. zhi ding job de zhi xing pin lv
  ru guo wo men chuang jian le yi ge job, bing qie xi wang ta an zhao wo men zhi ding de ri qi he shi jian lai yun xing , jiu xu yao ding yi job de chong fu pin du le . li ru mei tian yun xing , mei zhou ri de 22:00 yun xing , mei zhou yi , san , wu yun xing , mei nian de zui hou yi ge xing qi tian yun xing deng deng .
  ( shuo ming :10G yi qian de ban ben , yu cao zuo xi tong de jiao hu fang mian , shi xian de bu shi hen hao 。 li ru yao shi xian yi ge ding qi de rman bei fen ren wu , jiu xu yao jie he OS de ming ling lai shi xian , zai UNIX xia ke yi yong crontab shi xian , zai windows xia yong AT ming ling lai shi xian )
  10G zai zhe fang mian you le hen da de zeng qiang , yin wei chuang jian job shi ke yi zhi jie zhi ding cao zuo xi tong de ming ling huo zhe jiao ben , zai he li de ding yi job de zhi xing pin lv , ke yi hen qing song di wan cheng fu duo de tiao du ren wu .
  10G zhi chi liang zhong mo shi de repeat_interval, yi zhong shi PL/SQL biao da shi , zhe ye shi dbms_job bao zhong suo shi yong de , li ru SYSDATE+1, SYSDATE + 30/24*60; ling yi zhong jiu shi ri li biao da shi 。
  li ru MON biao shi xing qi yi ,SUN biao shi xing qi tian ,DAY biao shi mei tian ,WEEK biao shi mei zhou deng deng . xia mian lai kan ji ge shi yong ri li biao da shi de li zi :
  repeat_interval => 'FREQ=HOURLY; INTERVAL=2'
  mei ge 2 xiao shi yun xing yi ci job
  repeat_interval => 'FREQ=DAILY'
  mei tian yun xing yi ci job
  repeat_interval => 'FREQ=WEEKLY; BYDAY=MON,WED,FRI"
  mei zhou de 1,3,5 yun xing job
  repeat_interval => 'FREQ=YEARLY; BYMONTH=MAR,JUN,SEP,DEC; BYMONTHDAY=30'
  mei nian de 3,6,9,12 yue de 30 hao yun xing job
  yong guo crontab de ren ying gai dou you zhong si zeng xiang shi de gan jiao ba , he he
  xia mian zai shuo shuo shi yong ri li biao da shi de gui ze :
  ri li biao da shi ji ben fen wei san bu fen : di yi bu fen shi pin lv , ye jiu shi "FREQ" zhe ge guan jian zi , ta shi bi xu zhi ding de ; di er bu fen shi shi jian jian ge , ye jiu shi "INTERVAL" zhe ge guan jian zi , qu zhi fan wei shi 1-999. ta shi ke xuan de shen shu ; zui hou yi bu fen shi fu jia de shen shu , ke yong yu jing que di zhi ding ri qi he shi jian , ta ye shi ke xuan de shen shu , li ru xia mian zhe xie zhi dou shi he fa de :
  BYMONTH,BYWEEKNO,BYYEARDAY,BYMONTHDAY,BYDAY
  BYHOUR,BYMINUTE,BYSECOND
  xiang xi de shen shu shuo ming qing shen kao dbms_scheduler de shi yong shuo ming .
  ji ran shuo dao le repeat_interval, ni ke neng yao wen :" you mei you yi zhong jian bian de fang fa lai de chu , huo zhe shuo shi ping gu chu job de mei ci yun xing shi jian , yi ji xia yi ci de yun xing shi jian ne ?"
  dbms_scheduler bao ti gong le yi ge guo cheng evaluate_calendar_string, ke yi hen fang bian di wan cheng zhe ge xu qiu . lai kan xia mian de li zi :
  SQL> set serveroutput on size 999999
  SQL> declare
  L_start_date TIMESTAMP;
  l_next_date TIMESTAMP;
  l_return_date TIMESTAMP;
  begin
  l_start_date := trunc(SYSTIMESTAMP);
  l_return_date := l_start_date;
  for ctr in 1..10 loop
  dbms_scheduler.evaluate_calendar_string(
  'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=7,15',
  l_start_date, l_return_date, l_next_date
  );
  dbms_output.put_line('Next Run on: ' ||
  to_char(l_next_date,'mm/dd/yyyy hh24:mi:ss')
  );
  l_return_date := l_next_date;
  end loop;
  end;
  /
  shu chu jie guo ru xia :
  Next Run on: 03/22/2004 07:00:00
  Next Run on: 03/22/2004 15:00:00
  Next Run on: 03/23/2004 07:00:00
  Next Run on: 03/23/2004 15:00:00
  Next Run on: 03/24/2004 07:00:00
  Next Run on: 03/24/2004 15:00:00
  Next Run on: 03/25/2004 07:00:00
  Next Run on: 03/25/2004 15:00:00
  Next Run on: 03/26/2004 07:00:00
  Next Run on: 03/26/2004 15:00:00【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
zhe pian lun tan wen zhang ( sai di wang ji shu she qu ) zhen dui DBMS_SCHEDULER de shi yong fang fa jin xing le xiang jin de jie shao , geng duo nei rong qing shen kao xia wen : DBMS_SCHEDULER shi Oracle 10G zhong xin zeng de yi ge bao , yu lao ban ben de dbms_job bao xiang bi ,dbms_scheduler you hen duo xin te xing , wo jiang tong guo yi xi lie de wen zhang lai jie shao yi xia ru he shi yong zhe ge bao . 1. chuang jian job job shi shen me ne ? jian dan de shuo jiu shi ji hua (schedule) jia shang ren wu shuo ming . ling wai huan you yi xie bi xu de shen shu . zhe li ti dao de " ren wu " ke yi shi shu ju ku nei bu de cun chu guo cheng , ni ming de PL/SQL kuai , ye ke yi shi cao zuo xi tong ji bie de jiao ben . ke yi you liang zhong fang shi lai ding yi " ji hua ": 1) shi yong DBMS_SCHDULER.CREATE_SCHEDULE ding yi yi ge ji hua ; 2) tiao yong DBMS_SCHDULER.CREATE_JOBE guo cheng zhi jie zhi ding ( xia mian hui xiang xi shuo ming ) zai chuang jian yi ge ji hua shi , ni zhi shao xu yao zhi ding xia mian de shu xing , ta men shi job yun xing suo bi xu de : kai shi shi jian (start_time); chong fu pin lv (repeat_interval); jie shu shi jian (end_time) ling wai , dui yu yi ge job er yan , huan you hen duo de fu jia shen shu : job_class job_priority auto_drop restartable max_runs max_failures schedule_limit logging_level xia mian , wo yi wen da de xing shi lai ju ti jie shi . Q1: zen me cong shu ju ku zhong cha xun job de shu xing ? A1: you liang zhong fang fa : 1) cha xun (DBA|ALL|USER)_SCHEDULER_JOBS shi tu ( ti shi : gen ju yong hu quan xian de bu tong , xuan ze xing de cha xun DBA|ALL|USER shi tu ) 2) tiao yong DBMS_SCHEDULER bao zhong de GET_ATTRIBUTE guo cheng Q2: zen me she zhi zhe xie shu xing ne ? A2: ye shi you liang zhong fang fa 1) zai chuang jian job shi zhi jie zhi ding 2) tiao yong DBMS_SCHEDULER bao zhong de SET_ATTRIBUTE guo cheng Q3: " wo xu yao shen me quan xian cai neng chuang jian job" ? ta ke yi chuang jian shu zhu wei ren he yong hu (SYS yong hu chu wai ) de job. que sheng qing kuang xia ,job hui bei chuang jian zai dang qian de schema xia , bing qie shi mei you ji huo de ; ru guo yao shi job yi chuang jian jiu zi dong ji huo , xu yao xian shi de she zhi enabled shu xing wei true, lai kan yi ge li zi : begin dbms_scheduler.create_job ( job_name => 'ARC_MOVE', schedule_name => 'EVERY_60_MINS', job_type => 'EXECUTABLE', job_action => '/home/dbtools/move_arcs.sh', enabled => true, comments => 'Move Archived Logs to a Different Directory' ); end; / Q4: neng bu neng xiang xi di jiang shu yi xia shang mian zhe ge guo cheng yong dao de ge ge shen shu ? A4: job_name: gu ming si yi , mei ge job dou bi xu you yi ge de ming cheng schedule_name: ru guo ding yi le ji hua , zai zhe li zhi ding ji hua de ming cheng job_type: mu qian zhi chi san zhong lei xing : PL/SQL kuai : PLSQL_BLOCK, cun chu guo cheng : STORED_PROCEDURE wai bu cheng xu : EXECUTABLE ( wai bu cheng xu ke yi shi yi ge shell jiao ben , ye ke yi shi cao zuo xi tong ji bie de zhi ling ). job_action: gen ju job_type de bu tong ,job_action you bu tong de han yi . ru guo job_type zhi ding de shi cun chu guo cheng , jiu xu yao zhi ding cun chu guo cheng de ming zi ; ru guo job_type zhi ding de shi PL/SQL kuai , jiu xu yao shu ru wan zheng de PL/SQL dai ma ; ru guo job_type zhi ding de wai bu cheng xu , jiu xu yao shu ru script de ming cheng huo zhe cao zuo xi tong de zhi ling ming enabled: shang mian yi jing shuo guo le , zhi ding job chuang jian wan bi shi fou zi dong ji huo comments: dui yu job de jian dan shuo ming 2. zhi ding job de zhi xing pin lv ru guo wo men chuang jian le yi ge job, bing qie xi wang ta an zhao wo men zhi ding de ri qi he shi jian lai yun xing , jiu xu yao ding yi job de chong fu pin du le . li ru mei tian yun xing , mei zhou ri de 22:00 yun xing , mei zhou yi , san , wu yun xing , mei nian de zui hou yi ge xing qi tian yun xing deng deng . ( shuo ming :10G yi qian de ban ben , yu cao zuo xi tong de jiao hu fang mian , shi xian de bu shi hen hao 。 li ru yao shi xian yi ge ding qi de rman bei fen ren wu , jiu xu yao jie he OS de ming ling lai shi xian , zai UNIX xia ke yi yong crontab shi xian , zai windows xia yong AT ming ling lai shi xian ) 10G zai zhe fang mian you le hen da de zeng qiang , yin wei chuang jian job shi ke yi zhi jie zhi ding cao zuo xi tong de ming ling huo zhe jiao ben , zai he li de ding yi job de zhi xing pin lv , ke yi hen qing song di wan cheng fu duo de tiao du ren wu . 10G zhi chi liang zhong mo shi de repeat_interval, yi zhong shi PL/SQL biao da shi , zhe ye shi dbms_job bao zhong suo shi yong de , li ru SYSDATE+1, SYSDATE + 30/24*60; ling yi zhong jiu shi ri li biao da shi 。 li ru MON biao shi xing qi yi ,SUN biao shi xing qi tian ,DAY biao shi mei tian ,WEEK biao shi mei zhou deng deng . xia mian lai kan ji ge shi yong ri li biao da shi de li zi : repeat_interval => 'FREQ=HOURLY; INTERVAL=2' mei ge 2 xiao shi yun xing yi ci job repeat_interval => 'FREQ=DAILY' mei tian yun xing yi ci job repeat_interval => 'FREQ=WEEKLY; BYDAY=MON,WED,FRI" mei zhou de 1,3,5 yun xing job repeat_interval => 'FREQ=YEARLY; BYMONTH=MAR,JUN,SEP,DEC; BYMONTHDAY=30' mei nian de 3,6,9,12 yue de 30 hao yun xing job yong guo crontab de ren ying gai dou you zhong si zeng xiang shi de gan jiao ba , he he xia mian zai shuo shuo shi yong ri li biao da shi de gui ze : ri li biao da shi ji ben fen wei san bu fen : di yi bu fen shi pin lv , ye jiu shi "FREQ" zhe ge guan jian zi , ta shi bi xu zhi ding de ; di er bu fen shi shi jian jian ge , ye jiu shi "INTERVAL" zhe ge guan jian zi , qu zhi fan wei shi 1-999. ta shi ke xuan de shen shu ; zui hou yi bu fen shi fu jia de shen shu , ke yong yu jing que di zhi ding ri qi he shi jian , ta ye shi ke xuan de shen shu , li ru xia mian zhe xie zhi dou shi he fa de : BYMONTH,BYWEEKNO,BYYEARDAY,BYMONTHDAY,BYDAY BYHOUR,BYMINUTE,BYSECOND xiang xi de shen shu shuo ming qing shen kao dbms_scheduler de shi yong shuo ming . ji ran shuo dao le repeat_interval, ni ke neng yao wen :" you mei you yi zhong jian bian de fang fa lai de chu , huo zhe shuo shi ping gu chu job de mei ci yun xing shi jian , yi ji xia yi ci de yun xing shi jian ne ?" dbms_scheduler bao ti gong le yi ge guo cheng evaluate_calendar_string, ke yi hen fang bian di wan cheng zhe ge xu qiu . lai kan xia mian de li zi : SQL> set serveroutput on size 999999 SQL> declare L_start_date TIMESTAMP; l_next_date TIMESTAMP; l_return_date TIMESTAMP; begin l_start_date := trunc(SYSTIMESTAMP); l_return_date := l_start_date; for ctr in 1..10 loop dbms_scheduler.evaluate_calendar_string( 'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=7,15', l_start_date, l_return_date, l_next_date ); dbms_output.put_line('Next Run on: ' || to_char(l_next_date,'mm/dd/yyyy hh24:mi:ss') ); l_return_date := l_next_date; end loop; end; / shu chu jie guo ru xia : Next Run on: 03/22/2004 07:00:00 Next Run on: 03/22/2004 15:00:00 Next Run on: 03/23/2004 07:00:00 Next Run on: 03/23/2004 15:00:00 Next Run on: 03/24/2004 07:00:00 Next Run on: 03/24/2004 15:00:00 Next Run on: 03/25/2004 07:00:00 Next Run on: 03/25/2004 15:00:00 Next Run on: 03/26/2004 07:00:00 Next Run on: 03/26/2004 15:00:00
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚性感的燕子(3)
时尚性感的燕子(2)
纯美的女生生活写真(14)
纯美的女生生活写真(13)
来自束河[]
恰巧-巧家~~
高尔夫
行摄匆匆天子山
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有