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,Ï´ÎÔËÐеÄʱ¼ä)£»
¡¡¡¡¶þ£®Êý¾Ý»Ö¸´
¡¡¡¡Êý¾Ý»Ö¸´ÊÇÊý¾Ý¿â±¾ÉíÒ»¸ö¼«ÆäÖØÒªµÄ¹¦ÄÜ£¬Í¨³£ÖØÒ
Ïà¹ØÎĵµ£º
¶ÔÎÊÌâµÄÀí½âÊǽâ¾öÎÊÌâµÄÇ°Ìᣬ½ñÌìÓöµ½Ò»¸öÏîÄ¿ÖеÄÎÊÌâÈÃÎÒÉî¿ÌµÄÌå»áµ½ÕâÒ»µã¡£
Á½¸ö±í£º
T1
Term Domain WithAncestor
car x.com ?
bike y.com ?
car a.x.com ?
T2
Parent Domain
x.com ......
ÔÚÕâÒ»Ò³ÖУ¬ÎÒÃÇÁгöËùÓÐÔÚÕâ¸öÍøÕ¾ÓÐÁгö SQL Ö¸ÁîµÄÓï·¨¡£ÈôÒª¸üÏ꾡µÄ˵Ã÷£¬ÇëµãÑ¡Ö¸ÁîÃû³Æ¡£
ÕâÒ»Ò³µÄÄ¿µÄÊÇÌṩһ¸ö¼ò½àµÄ SQL Óï·¨×öΪ¶ÁÕ߲ο¼Ö®Óá£ÎÒÃǽ¨ÒéÄúÏÖÔھͰ´ Control-D ½«±¾Ò³¼ÓÈëÄúµÄ¡ºÎÒµÄ×î°®¡»¡£
Select
SELECT "À¸Î»" from "±í¸ñÃû"
Distinct
SELECT DISTINCT "À¸Î»"
from "±í¸ñÃû"
Where
......
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 ......
SELECT a.ADDRESS,
sql_text,
executions,
rows_processed,
cpu_time,
a.DISK_READS,
  ......
Oracle 10G Êý¾Ý¿âÎļþĿ¼½á¹¹
ÔÚOracle Database 10gÖÐ,OracleµÄĿ¼½á¹¹ÊÇÓÉOracle_Base¼°Æä×ÓĿ¼Oracle_Home¡¢admin¡¢flash_recovery_areaºÍoradataĿ¼¹¹³ÉµÄ¡£Îª·½±ãÌÖÂÛ£¬ÓÃOracle_Base´ú±íOracleĿ¼Ê÷µÄ¸ù£¬ÓÃOracle_Home±íʾ¸ùĿ¼ÏµÄÖ÷Ŀ¼¡£
1.Oracle_BaseĿ¼
Oracle_Base´ú±íOracleĿ¼Ê÷µÄ¸ù¡£ ......