Oracle job ʹÓÃ
²½Ö裺
(1) ´´½¨×÷Òµ
(2) ´´½¨job
dbms_job.submit();
submit ( jobno¡¡OUT binary_ineger,
¡¡¡¡¡¡¡¡¡¡¡¡¡¡What¡¡¡¡¡¡IN¡¡varchar2,
¡¡¡¡¡¡¡¡¡¡¡¡¡¡next_date IN¡¡date,
¡¡¡¡¡¡¡¡¡¡¡¡¡¡interval¡¡IN¡¡varchar2,
¡¡¡¡¡¡¡¡¡¡¡¡ no_parse¡¡IN¡¡booean:=FALSE)
¡¡¡¡
¡¡¡¡jobno²ÎÊýÊÇÓÉSubmit()¹ý³Ì·µ»ØµÄbinary_ineger¡£Õâ¸öÖµÓÃÀ´Î¨Ò»±êʶһ¸ö¹¤×÷¡£
¡¡¡¡what²ÎÊýÊǽ«±»Ö´ÐеÄPL/SQL´úÂë¿é Ò²¾ÍÊÇtask¡£
¡¡¡¡next_date²ÎÊýָʶºÎʱ½«ÔËÐÐÕâ¸ö¹¤×÷¡£
¡¡¡¡interval²ÎÊýºÎʱÕâ¸ö¹¤×÷½«±»ÖØÖ´ÐС£
¡¡¡¡no_parse²ÎÊýָʾ´Ë¹¤×÷ÔÚÌύʱ»òÖ´ÐÐʱÊÇ·ñÓ¦½øÐÐÓï·¨·ÖÎö——TRUEָʾ´ËPL/SQL´úÂëÔÚËüµÚÒ»´ÎÖ´ÐÐʱӦ½øÐÐÓï·¨·ÖÎö£¬¶ø FALSEָʾ±¾PL/SQL´úÂëÓ¦Á¢¼´½øÐÐÓï·¨·ÖÎö¡£
(3) ÔËÐÐ
dbms_job.run(jobno);
(4) ɾ³ý
dbms_job.remove(jobno)
--ÔÝÍ£Ò»¸öjob
exec dbms_job.broken(jobno,true)
commit //±ØÐëÌá½»·ñÔòÎÞЧ
Æô¶¯Ò»¸öjob
exec dbms_job.broken(jobno,false)
/*********************************************************************************/
eg: ͨ¹ýjob ÿ¹ýÒ»·ÖÖÓÏòÒ»ÕűíÀïÃæ²åÈëÒ»ÌõÊý¾Ý
create or replace package body test is
--´´½¨±í
procedure createTable is
num number;
begin
--²é¿´ÏµÍ³±íÀïÊÇ·ñÒѾ´æÔÚ£¬Ã»Óд´½¨
select count(*) into num from user_tables where table_name= 'TEMP_JOB';
if (num>0) then
--ɾ³ý±í
execute immediate 'drop table temp_job';
commit;
end if;
--´´½¨±í
execute immediate 'create table temp_job(
address varchar2(200),
&
Ïà¹ØÎĵµ£º
1.SQL> select * from v$nls_parameters;
PARAMETER VALUE
----------------------------------- ------------------------------------
---------- ......
ÔÚÃüÁî¸ñʽÏ£¬½øÈësqlplusµÄ±à¼×´Ì¬ÖÐ
£¨1£©²é¿´¿ØÖÆÎļþµÄÄÚÈÝ£º
SQL> DESC v$controlfile
Ãû³Æ &n ......
OracleÖв»ÏñÆäËûÈçmysqlµÈÊý¾Ý¿âµÄÓÐ×ÔÔö×ֶΣ¬Èç¹ûÐèÒªÔòÐèÒª½èÖúÐòÁкʹ¥·¢Æ÷
Ê×ÏȽ¨±í
½¨Á¢ÐòÁÐ
½¨´¥·¢Æ÷
For example£º
create table SYS_MESSAGE
(
ID NUMBER not null PRIMARY KEY,
M_TYPE VARCHAR2(10) not null,
TITLE VARCHAR2(200),
CONTENT LONG,
M_TIME VARCHAR2(50),
A ......
¡öÀÖÖª
“ËÊÇ˵ÄË”£¬ÕâÊÇΨÃÀÖÐ͸×ÅÓÄÔ¹µÄÒ»Ê׸裬µ«È´»áĪÃûµØµçµ½ÐÄÖеÄÀÛ¡£Ñ§Ï°Ì«ÀÛ£¬¹¤×÷Ì«ÀÛ£¬Éú»îÌ«ÀÛ£¬Á¬¸èÃûÌý×Ŷ¼ÄÇôÀÛ¡£
²ß»®µÄµÚÒ»±¾Ê顶´óÏó——Thinking in UML¡·£¬´ÓÔË×÷£¬µ½ÉÏÊУ¬µ½³©Ïú£¬µ½¾µä£¬µ½¹úÄÚUMLµÚÒ»Ê飬һÄêÖ®ÄÚʵÏÖÁËÒ»¸ö¸öûÓÐÃιýµÄÃÎÏë¡£ÕýÈçÕâÊ׸èÖеÄÒ ......