È«ÃæѧϰORACLE SchedulerÌØÐÔ(1)´´½¨jobs
Ëùν³öÓÚjob¶øʤÓÚjob£¬ËµµÄ¾ÍÊÇOracle 10gºóµÄÐÂÌØÐÔSchedulerÀ²¡£ÔÚ10g»·¾³ÖУ¬ORACLE½¨ÒéʹÓÃSchedulerÌæ»»ÆÕͨµÄjob£¬À´¹ÜÀíÈÎÎñµÄÖ´ÐС£Æäʵ£¬½«SchedulerÃèÊö³É¹ÜÀíjobµÄ¹¤¾ßÒѾ̫¹ýƬÃæÁË£¬10G°æ±¾ÖÐÐÂÔöµÄScheduler¾ø²»½ö½öÊÇ´´½¨ÈÎÎñÕâô¼òµ¥¡£¡£¡£¡£
Ìáʾ£ºORACLEÖйÜÀíSchedulerÊÇͨ¹ýDBMS_SCHEDULER°ü£¬±¾ÕÂÒ²ÒÔ´ËΪÇÐÈëµã£¬Í¨¹ýÏêϸ½éÉÜDBMS_SCHEDULER°üµÄʹÓã¬À´ÑÝʾÈçºÎʹÓÃScheduler¡£Ëƺõ±¾Ä©µ¹ÖÃÁË£¬Ã»¹Øϵ£¬"Èý˼±Ê¼Ç"£¬°³µÄµØÅÌ°³×öÖ÷¡£
Ò»¡¢Ê¹ÓÃJobs
¡¡¡¡ËùνJOBS£¬Æäʵ¾ÍÊÇScheduler¹ÜÀíµÄÒ»¸ö(»ò¶à¸ö)ÈÎÎñµÄÖ´Ðе÷¶È¡£
1.1 ´´½¨Jobs
¡¡¡¡Í¨¹ýDBMS_SCHEDULER°üÀ´´´½¨Jobs£¬ÊÇʹÓÃÆäCREATE_JOB¹ý³Ì¡£ÔÚ´´½¨Jobʱ£¬Óû§¿ÉÒÔÖ¸¶¨ÒªÖ´ÐеÄÈÎÎñ£¬µ÷¶ÈÐÅÏ¢(ɶʱºòÖ´ÐУ¬Ö´ÐÐÖÜÆÚ£¬ÖÕÖ¹ÈÕÆÚµÈ)ÒÔ¼°ÆäËüһЩÈÎÎñÏà¹ØµÄÊôÐÔ¡£CREATE_JOB¹ý³Ìµ÷Óû¹ÊDZȽϼòµ¥µÄ£¬ÀýÈ磺
SQL> BEGIN
2 DBMS_SCHEDULER.CREATE_JOB (
3 job_name => 'INSERT_TEST_TBL',
4 job_type => 'STORED_PROCEDURE',
5 job_action => ' P_ INSERT INTOTEST ',
6 start_date => sysdate,
7 repeat_interval => 'FREQ=DAILY;INTERVAL=1');
8 END;
9 /
PL/SQL ¹ý³ÌÒѳɹ¦Íê³É¡£
¡¡¡¡ÊÂʵÉÏ£¬ÓÐȨÏ޵Ļ°£¬Óû§Ò²¿ÉÒÔ´´½¨ÆäËüSCHEMAϵÄJOB£¬Ö»ÐèÒªÔÚÖ¸¶¨JOB_NAMEʱ£¬°´ÕÕschema.job_nameµÄ¸ñʽ¼´¿É¡£×¢ÒâÓ´£¬ÕâÖÖÇé¿öÏ´´½¨µÄJOB£¬ÆäCREATEDÓëOWNERÓпÉÄܲ¢²»ÏàͬµÄÓ´¡£
¡¡¡¡µ±Ê¹ÓÃCREATE_JOB¹ý³Ì´´½¨JOBʱ£¬¿ÉÖ¸¶¨µÄ²ÎÊýÖµºÜ¶à£¬Ö»²»¹ý¶àÊýÇé¿öÏÂÓû§½öÖ¸¶¨²¿·Ö²ÎÊý¼´¿ÉÂú×ãÐèÇó¡£
¡¡¡¡ÆäÖУ¬ÉÏÀýÖÐÖ¸¶¨µÄ²ÎÊý£¬·Ö±ð´ú±íµÄº¬ÒåÈçÏ£º
JOB_NAME £ºÖ¸¶¨ÈÎÎñµÄÃû³Æ£¬±ØÑ¡Ö
Ïà¹ØÎĵµ£º
1¡¢Ð½¨PDM.ÓÒ»÷Workspace->New->Free Model->Physical Data Model
2¡¢Model nameÈÎÒâ, DBMS=>ORACLE Version 9i2->È·¶¨
3¡¢ÅäÖÃODBC
¿ØÖÆÃæ°å->¹ÜÀí¹¤¾ß->Êý¾ÝÔ´(ODBC)->ϵͳDSN->Ìí¼Ó,Èç¹ûÓÐ×°ÍêÕûµÄOracle¿Í»§¶Ë»á³öÏÖרÃŵÄÇý¶¯,ÎÒµÄÊǼò°æµÄ¾ÍÑ¡
"Microsoft ODBC for Oracl ......
ʹÓÃsys£¬ÒÔsysdbaȨÏ޵ǼOracle:
(ÆÕͨȨÏÞ£¬D:\sqlplus tss/tss123456@buaa)
D:\sqlplus sys/penghj@buaa as sysdba
SQL> show parameter processes;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 1
db_writer_processes integ ......
ÀûÓÃTOADʵÏÖEXCELÊý¾ÝÔÚoracleµÄµ¼Èëµ¼³ö
1.´ÓORACLEÊý¾Ý¿âµ¼³ö³ÉΪEXCELÎļþ
ÀûÓÃTOADÁ¬½ÓÉÏÊý¾Ý¿â£¬·ÃÎÊij¸ö±í£¬ÎÒ±¾»úÊÇÑ¡Öбí“OA_USER”
ÓÒ¼ü“Save as...”
ΪÁ˽â¾öÖÐÎÄÂÒÂëÎÊÌ⣬ËùÒÔÑ¡ÔñÀàÐÍΪ"XLS Instance"£¬Èç¹û´æÔÚ³¤Êý×ÖÐÍ×Ö·û´®±»¸Ä±äµÄÎÊÌ⣬
ÇëÑ¡ÖГString Fields as S ......
OracleÈÕÆÚº¯Êý¼¯½õ(Ò»)
Ò»¡¢ ³£ÓÃÈÕÆÚÊý¾Ý¸ñʽ
1.Y»òYY»òYYY ÄêµÄ×îºóһ룬Á½Î»»òÈýλ
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_ch ......
DATEÊý¾ÝÀàÐÍ
¡¡¡¡Õâ¸öÊý¾ÝÀàÐÍÎÒÃÇʵÔÚÊÇÌ«ÊìϤÁË£¬µ±ÎÒÃÇÐèÒª±íʾÈÕÆÚºÍʱ¼äµÄ»°¶¼»áÏëµ½dateÀàÐÍ¡£Ëü¿ÉÒÔ´æ´¢Ô£¬Ä꣬ÈÕ£¬ÊÀ¼Í£¬Ê±£¬·ÖºÍÃë¡£ËüµäÐ͵ØÓÃÀ´±íʾʲ ôʱºòÊÂÇéÒѾ·¢Éú»ò½«Òª·¢Éú¡£DATEÊý¾ÝÀàÐ͵ÄÎÊÌâÔÚÓÚËü±íʾÁ½¸öʼþ·¢Éúʱ¼ä¼ä¸ôµÄ¶ÈÁ¿Á£¶ÈÊÇÃë¡£Õâ¸öÎÊÌ⽫ÔÚÎÄÕÂÉÔºóÌÖÂÛtimestampµÄʱ ºò±»½â¾ö¡£¿ÉÒ ......