PL/SQLʵÏÖOracleÊý¾Ý¿âÈÎÎñµ÷¶È
Ñ¡Ôñ×Ô softj µÄ Blog
¹Ø¼ü×Ö
PL/SQLʵÏÖOracleÊý¾Ý¿âÈÎÎñµ÷¶È
³ö´¦
PL/SQLʵÏÖOracleÊý¾Ý¿âÈÎÎñµ÷¶È
¡¡¡¡¹Ø¼ü´Ê£ºÊý¾Ý»Ö¸´£¬ÈÎÎñµ÷¶È£¬ORACLE£¬PL/SQL
¡¡¡¡ÔÚÊý¾Ý¿â²Ù×÷ÖÐʱ³£»áÓÐÕâÑùµÄÇé¿ö·¢Éú£¬ÓÉÓÚһʱµÄÊèºö¶øÎóɾ»òÎó¸ÄÁËһЩÖØÒªµÄÊý¾Ý£¬ÁíÍ⻹ÓÐһЩÖØÒªµÄÈÎÎñÐèÒªÖÜÆÚÐÔµØÔËÐС£ÏÔÈ»£¬Ç°Ò»ÀàÎÊÌâÖ÷ÒªÊÇÊý¾Ý±¸·ÝÓë»Ö¸´·½ÃæµÄ£¬¶øºóÒ»ÀàÔòÖ÷ÒªÊÇϵͳµÄÈÎÎñµ÷¶È¡£±¾ÎĽ«Õë¶ÔÕâÁ½ÀàÎÊÌ⣬´ÓÓ¦ÓóÌÐò¿ª·¢½Ç¶È¸ø³öÒ»¸ö½â¾ö·½·¨¡£
¡¡¡¡Ò»£®¼¼Êõ»ù´¡
¡¡¡¡ÓÉÓÚ±¾ÎÄÊÇʹÓÃPL/SQL×÷Ϊ¿ª·¢Æ½Ì¨À´Ìṩ½â¾ö·½°¸£¬ËùÒÔÊ×ÏÈÁ˽âÏà¹ØµÄ±³¾°ÖªÊ¶¡£
¡¡¡¡PL/SQL±¾ÉíÖ»ÊÇ×÷ΪSQLÓï¾äµÄÒ»¸ö²¹³ä£¬Í¨¹ýÒýÈë¹ý³Ì»¯µÄ¸ÅÄîÀ´ÔöÇ¿Êý¾Ý¿â´¦ÀíÄÜÁ¦¡£È»¶ø£¬Ïà¶ÔÓÚC,C++,JAVAµÈ¹ý³Ì»¯ÓïÑÔÀ´Ëµ£¬PL/SQLµÄ´¦Àí¹¦ÄÜÒÀÈ»²»¹»Ç¿´ó¡£Îª´Ë£¬OracleÊý¾Ý¿âÌṩÁË´óÁ¿µÄÓ¦ÓóÌÐò¿ª·¢°ü£¬À´ÔöÇ¿Ó¦ÓóÌÐò¿ª·¢ÄÜÁ¦¡£¸ù¾Ý±¾ÎĵÄÖ÷Ì⣬½éÉÜÈçÏÂÁ½¸ö¿ª·¢°ü£ºDBMS_FLASHBACKºÍDBMS_JOB¡£
¡¡¡¡1£® DBMS_FLASHBACK°üÖ÷ÒªÊÇÓÃÀ´½øÐе¹Ðð²éѯʹÓõģ¬¼´Í¨¹ýÉèÖòéѯʱ¼äÀ´È·¶¨¸Ãʱ¿ÌϵIJéѯ½á¹û¡£Ò»°ãÇé¿öÏ£¬ÎÒÃÇƽʱʹÓõIJéѯÊDzéѯµ±Ç°Ê±¼ä£¨sysdate£©ÏµÄÊý¾Ý¡£Ê¹ÓÃDBMS_FLASHBACK°ü¾Í¿ÉÒÔ²éѯÒÔÇ°Êý¾ÝµÄ״̬£¬ÕâÒ»¹¦ÄܶÔÓÚÎó´¦ÀíµÄÇéÐζøÑÔ¾ÍÏԵü«ÎªÖØÒª¡£ÏÂÃæÊǸðüÖеÄÁ½¸öÖ÷Òªº¯Êý½éÉÜ£º
¡¡¡¡·EnableÓëdisable£º·Ö±ðÊÇÆô¶¯ºÍ¹Ø±Õµ¹Ðð²éѯ¹¦ÄÜ¡£Ó¦¸Ã×¢ÒâµÄÊÇ£¬Ã¿´ÎÆô¶¯µ¹Ðð²éѯ֮ǰӦÊ×Ïȹرյ¹Ððģʽ¡£
¡¡¡¡·Enable_at_time£ºÉèÖòéѯµÄʱ¼äµã£¬ËüÊÇÒÔµ±Ç°Ê±¼äΪÆðµã½øÐÐÉèÖõġ£
¡¡¡¡2£® DBMS_JOB°üÊÇÓÃÀ´¶ÔPL/SQL¿é½øÐе÷¶ÈµÄʵÓðü£¬ËüÔÊÐíPL/SQL¿éÔÚÖ¸¶¨µÄʱ¼äÄÚ×Ô¶¯ÔËÐУ¬ÀàËÆÓÚVCÖеÄSettimerÕâÑùµÄ¶¨Ê±Æ÷¡£Îª±ãÓڸðüµÄÔËÐУ¬ÐèÒªÊ×ÏÈÉèÖÃÁ½¸öinit.ora²ÎÊý£º
¡¡¡¡·JOB_QUEUE_PROCESSÖ¸¶¨Æô¶¯µÄºǫ́´¦ÀíÊý¡£Èç¹ûËüÊÇ0»òûÓб»ÉèÖ㬽«Ã»Óкǫ́´¦Àí½øÈë×÷Òµ£¬ËüÃÇÒ²¾Í²»»áÔËÐС£
¡¡¡¡·JOB_QUEUE_INTERVALÒÔÃëΪµ¥Î»£¬Ö¸¶¨Ã¿Ò»¸ö¹ý³ÌÔÚ¼ì²éеÄ×÷ҵǰµÈ´ýµÄʱ¼ä¡£ÔÚJOB_QUEUE_INTERVAËùÖ¸¶¨µÄʱ¼äÄÚ£¬Ò»¸ö×÷Òµ×î¶àÖ»ÄÜÔËÐÐÒ»´Î¡£
¡¡¡¡ÉèÖúÃÕâÁ½¸ö²ÎÊýºó£¬¾Í¿É¶Ô³ÌÐò½øÐе÷¶ÈÁË£¬¸Ã°üÖ÷ҪʹÓÃSUBMITº¯Êý½øÐе÷¶È£¬¸Ãº¯ÊýµÄÔÐÍΪ£º
submit(·µ»ØµÄ×÷ÒµºÅ,³ÌÐò¹ý³ÌÃû,sysdate,Ï´ÎÔËÐеÄʱ¼ä)£»
¡¡¡¡¶þ£®Êý¾Ý»Ö¸´
¡¡¡¡Êý¾Ý»Ö¸´ÊÇÊý¾Ý¿â±¾ÉíÒ»¸ö¼«ÆäÖØÒªµÄ¹¦ÄÜ£¬Í¨³£ÖØÒ
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
http://hi.baidu.com/fyears/blog/item/5ef68ac3feb9a45db219a836.html
select object_id,session_id,locked_mode from v$locked_object;
¡¡¡¡select t2.username,t2.sid,t2.serial#,t2.logon_time
¡¡¡¡from v$locked_object t1,v$session t2
¡¡¡¡where t1.session_id=t2.sid order by t2.logon_time;
alter system ki ......
oracle±äÁ¿ÀàÐÍ
±êÁ¿ÀàÐÍ
varchar2(n) ÓÃÓÚ¶¨Òå¿É±ä³¤¶ÈµÄ×Ö·û´® nÓÃÓÚÖ¸¶¨×Ö·û´®µÄ×î´ó³¤¶È Æä×î´óֵΪ32767×Ö½Ú ±ØÐëÖ¸¶¨n
char(n) ÓÃÓÚ¶¨Òå¹Ì¶¨³¤¶ÈµÄ×Ö·û´® ÆäÖÐnÓÃÓÚÖ¸¶¨×Ö·û´®µÄ×î´ó³¤¶È£¬Æä×î´óֵΪ32767 Èç¹û²»Ö¸¶¨n ĬÈÏÊÇ1
number(p,s)¸ÃÊý¾ÝÀàÐÍÓÃÓÚ¶¨Òå¹Ì¶¨³¤¶ÈµÄÕûÊýºÍ¸¡µã ......
PB×Ô´øµÄREPLACEÓï¾äÓÃ×Å×ÜÓÐЩ²»Ï°¹ß¡£½ñÌìͬÊÂÔÚ×öÊý¾ÝǨÒÆÖУ¬Óõ½Ìæ»»¹¦ÄÜ£¬¸ù¾Ý²»Í¬µÄµÇ¼Óû§£¬Ñ¡Ôñ¸ÃÓû§ÏÂµÄ±í¡£ËùÒÔ£¬ÎÒ¾ÍÓÃORACLEµÄº¯ÊýÀ´ÊµÏÖËü¡£Æäʵͦ¼òµ¥µÄ£¬¾ÍÊÇÒ»¸öPB¶¯Ì¬SQLÓï¾äµÄÀý×Ó¶øÒÑ¡£ÏÂÃæÊǸöÀý×Ó£¬SQLÓï¾ä×ÔÒÑÆ´×°ºÃ¡£×¢ÒâÆ´×°µÄSQLÓï¾äĩβ²»ÒªÏ°¹ßµÄ¼Ó“£» ......
½ñÌì¿´µ½Ò»Æª¹ØÓÚORA_ROWSCNµÄÎÄÕ£¬ËäÈ»¼ò¶Ì£¬Ã»ÓÐʲôʵÀý£¬µ«ÊÇÒѾ°ÑORA_ROWSCN´ó¸ÅÊÇÔõô»ØʽéÉÜÇå³þÁË¡£¼Ç¼һÏ¡£
=================================================================================
ĬÈϵÄÇé¿öÏ£¬Ã¿¸ö¿éÖÐËùÓеļǼµÄORA_ROWSCN¶¼ÊÇÏàͬµÄ£¬µ±¿éÖÐÈÎÒâÒ»Ìõ¼Ç¼·¢Éú¸Ä±äµÄÇé¿öÏ£¬¿éÖÐËùÓм ......