ORACLE jobʹÓ÷½·¨
EXP/IMP×¢Ò⣺´ÓÈ«¿âÂß¼±¸·Ý°´Óû§µ¼Èëʱ£¬OracleûÓе¼ÈëJOB£¬²»ÖªµÀÕâ¸öÊÇOracleµÄbug£¬»¹ÊǹÊÒâÕâÑùʵÏֵġ£Õâ¸öÎÊÌâÔÚµ¼ÈëµÄÓû§ÃûºÍµ¼³öµÄÓû§Ãû²»Í¬Ê±³öÏÖ£¬Èç¹ûµ¼ÈëµÄÓû§ÃûºÍµ¼³öµÄÓû§ÃûÒ»Ö£¬Ôò²»»á³öÏÖÕâ¸öÎÊÌâ¡£»³ÒÉÊÇOracleµ÷ÓÃDBMS_IJOB°üʱ³öÏÖµÄÎÊÌâ¡£
×ÜÖ®£¬EXP/IMPµÄʱºòÐèÒª¿¼ÂÇJOB£¬²¢ÔÚ²Ù×÷½áÊøºó¼ì²éJOBÐÅÏ¢ÊÇ·ñÒѾÕýÈ·µÄµ¼Èë¡£
±¾Îĸø´ó¼Ò½éÉÜÒ»ÏÂORACLE jobµÄʹÓ÷½·¨£º
Õâ¸öjob Ö´ÐеŦÄÜ: ÏòijÕűíÖж¨Ê±²åÈëÒ»Ìõ¼Ç¼(±ÈÈçÒ»·ÖÖÓ²åÈëÒ»Ìõ)
step 1: Ê×ÏÈ´´½¨Ò»Õűí a,
create table a(a date);
step 2: ´´½¨Ò»¸öproc test ,Õâ¸ö test ¾ÍÊÇÈ¡³öϵͳµÄµ±Ç°Ê±¼äÖµ,È»ºó²åÈëµ½ a ±íÖÐ
SQL> create or replace procedure test as
begin
insert into a values(sysdate);
end;
/
step 3: ´´½¨Ò»¸öjob,Õâ¸öjobÉèÖÃΪÿ·ÖÖÓÔËÐÐÒ»´Î,Ò²¾ÍÊÇÿ·ÖÖÓµ÷ÓÃÒ»ÏÂÉÏÃæµÄ test,Õâ¸ö proc
SQL> variable job1 number;
SQL>
SQL> begin
dbms_job.submit(:job1,'test;',sysdate,'sysdate+1/1440');¡¡¡¡--ÿÌì1440·ÖÖÓ£¬¼´Ò»·ÖÖÓÔËÐÐtest¹ý³ÌÒ»´Î
end;
/
step 4:È¥ÔËÐÐÉÏÃæ´´½¨ºÃµÄ job
SQL> begin
dbms_job.run(:job1);
end;
/
[×¢]:¹ý¼¸·ÖÖÓºó Óà select to_char(a,'yyyy/mm/dd hh24:mi:ss')from a; È¥²é¿´ a ±í,·¢ÏÖ¶àÁ˼¸Ìõ¼þ¼Ç¼,Õâ¾Í˵Ã÷ÁË job Õý³£¹¤×÷ÁË
Èç¹ûҪɾ³ýÕâ¸ö job ¿ÉÒÔÓÃ:
SQL> begin
dbms_job.remove(:job1);
end;
/
×¢£ºÓÃdeclareÉùÃ÷²»ÓüÓðºÅ job ²»ÐèÒªÔÚÃüÁîÐÐÀïÃæÖ´ÐÐ
Ïà¹ØÎĵµ£º
ÄãÊÇ·ñΪµÈ´ýÄãµÄ²éѯ·µ»Ø½á¹û¶ø¸Ðµ½Æ£±¹£¿ÄãÊÇ·ñÒѾΪÔöÇ¿Ë÷ÒýºÍµ÷ÓÅSQL¶ø¸Ðµ½Æ£±¹£¬µ«ÈÔÈ»²»ÄÜÌá¸ß²éѯÐÔÄÜ£¿ÄÇô£¬ÄãÊÇ·ñÒѾ¿¼ÂÇ´´½¨ÎﻯÊÓͼ£¿ÓÐÁËÎﻯÊÓͼ£¬ÄÇЩ¹ýÈ¥ÐèÒªÊýСʱÔËÐеı¨¸æ¿ÉÒÔÔÚ¼¸·ÖÖÓÄÚÍê³É¡£ÎﻯÊÓͼ¿ÉÒÔ°üÀ¨Áª½Ó£¨join£©ºÍ¼¯ºÏ£¨aggregate£©
ÄãÊÇ·ñΪµÈ´ýÄãµÄ²éѯ·µ»Ø½á¹û¶ø¸Ðµ½Æ£±¹£¿ÄãÊÇ·ñÒÑ ......
Checkpoint
ºÜ¶àÈ˶¼°ÑcheckpointµÄ¸ÅÄî¸ø¸´ÔÓ»¯ÁË£¬ÆäʵcheckpointÕâ¸öÊý¾Ý¿â¸ÅÄîÒýÈëµÄÕæÕýÒâÒå¾ÍÊÇÓÃÀ´¼õÉÙÔÚÊý¾Ý¿â
»Ö¸´¹ý³ÌÖÐËù»¨µÄʱ¼ä(instance recovery),ÄÇôcheckpointÊÇÓÉËÀ´×öµÄÄØ?ÎÒÃǶ¼ÖªµÀÊý¾Ý¿âÖÐÓиöCKPT½ø³Ì£¬ÕâÊǸö
¿ÉÑ¡½ø³Ì£¬µ«ÊÇÕæÕýÖ´Ðмì²éµãµÄÈÎÎ ......
Èç¹ûÊý¾ÝÎļþË𻵣¬»áÓöµ½1157 ºÍ 1110µÄ´íÎó¡£ÕâʱºòÐèÒª½éÖʻָ´Êý¾Ý¿â¡£
»Ö¸´Êý¾Ý¿âÐèÒªÓÐÏàÓ¦µÄ±¸·ÝºÍ±¸·ÝÒÔÀ´²úÉúµÄËùÓеĹ鵵ÈÕÖ¾ÎļþºÍÁª»úÈÕÖ¾Îļþ¡£
Èç¹ûÔÚmountµ½openµÄʱºò·¢ÏÖÆÕͨµÄÊý¾ÝÎļþË𻵣¬Êý¾Ý¿â»áÍ£ÁôÔÚmount״̬Ï£¬Õâʱºò¿ÉÒÔÖ´ÐÐalter database datafile x offline drop ºÍalter database open à ......
ÏîÄ¿´ÓmysqlǨÒƵ½ORACLEÖÐÓöµ½ÒÆÖ²ÎÊÌ⣬mysqlÖÐÖ§³Ölimit ¶øORACLE say no .
½â¾ö·½·¨ ÀûÓÃORACLEµÄαÁÐ rownumÀ´¿ØÖÆ¡£¡£
Mysql : select * from table limit 10
equl
ORACLE£º select * from table where rownum <= 10
ORACLE αÁнéÉÜ£º
ËæÊý¾Ý×ÖµäÒ»Æð×Ô¶¯´´½¨µÄÒ»¸ö±í,ÊôÓÚsysģʽ,ÈκÎÓû§¶¼¿ÉÒÔ·ÃÎÊ,&nbs ......
--½¨Á¢²âÊÔÊý¾Ý
create table a(id number);
create table b(id number);
insert into a values(1);
insert into a values(2);
insert into a values(3);
insert into b values(1);
insert into b values(2);
insert into b values(4);
commit;
--×ó:
--Ö÷Á÷Êý¾Ý¿âͨÓõķ½·¨
select * from a left ......