OracleÎﻯÊÓͼ
OracleµÄÎﻯÊÓͼÌṩÁËÇ¿´óµÄ¹¦ÄÜ£¬¿ÉÒÔÓÃÓÚÔ¤ÏȼÆËã²¢±£´æ±íÁ¬½Ó»ò¾Û¼¯µÈºÄʱ½Ï¶àµÄ²Ù×÷µÄ½á¹û£¬ÕâÑù£¬ÔÚÖ´Ðвéѯʱ£¬¾Í¿ÉÒÔ±ÜÃâ½øÐÐÕâЩºÄʱµÄ²Ù×÷£¬¶ø´Ó¿ìËٵĵõ½½á¹û¡£ÎﻯÊÓͼÓкܶ෽ÃæºÍË÷ÒýºÜÏàËÆ£ºÊ¹ÓÃÎﻯÊÓͼµÄÄ¿µÄÊÇΪÁËÌá¸ß²éѯÐÔÄÜ£»ÎﻯÊÓͼ¶ÔÓ¦ÓÃ͸Ã÷£¬Ôö¼ÓºÍɾ³ýÎﻯÊÓͼ²»»áÓ°ÏìÓ¦ÓóÌÐòÖÐSQLÓï¾äµÄÕýÈ·ÐÔºÍÓÐЧÐÔ£»ÎﻯÊÓͼÐèÒªÕ¼Óô洢¿Õ¼ä£»µ±»ù±í·¢Éú±ä»¯Ê±£¬ÎﻯÊÓͼҲӦµ±Ë¢Ð¡£
¡¡¡¡ÎﻯÊÓͼ¿ÉÒÔ·ÖΪÒÔÏÂÈýÖÖÀàÐÍ£º°üº¬¾Û¼¯µÄÎﻯÊÓͼ£»Ö»°üº¬Á¬½ÓµÄÎﻯÊÓͼ£»Ç¶Ì×ÎﻯÊÓͼ¡£ÈýÖÖÎﻯÊÓͼµÄ¿ìËÙˢеÄÏÞÖÆÌõ¼þÓкܴóÇø±ð£¬¶ø¶ÔÓÚÆäËû·½ÃæÔòÇø±ð²»´ó¡£´´½¨ÎﻯÊÓͼʱ¿ÉÒÔÖ¸¶¨¶àÖÖÑ¡ÏÏÂÃæ¶Ô¼¸ÖÖÖ÷ÒªµÄÑ¡Ôñ½øÐмòµ¥ËµÃ÷£º
¡¡¡¡´´½¨·½Ê½£¨Build Methods£©£º°üÀ¨BUILD IMMEDIATEºÍBUILD DEFERREDÁ½ÖÖ¡£BUILD IMMEDIATEÊÇÔÚ´´½¨ÎﻯÊÓͼµÄʱºò¾ÍÉú³ÉÊý¾Ý£¬¶øBUILD DEFERREDÔòÔÚ´´½¨Ê±²»Éú³ÉÊý¾Ý£¬ÒÔºó¸ù¾ÝÐèÒªÔÚÉú³ÉÊý¾Ý¡£Ä¬ÈÏΪBUILD IMMEDIATE¡£
¡¡¡¡²éѯÖØд£¨Query Rewrite£©£º°üÀ¨ENABLE QUERY REWRITEºÍDISABLE QUERY REWRITEÁ½ÖÖ¡£·Ö±ðÖ¸³ö´´½¨µÄÎﻯÊÓͼÊÇ·ñÖ§³Ö²éѯÖØд¡£²éѯÖØдÊÇÖ¸µ±¶ÔÎﻯÊÓͼµÄ»ù±í½øÐвéѯʱ£¬Oracle»á×Ô¶¯ÅжÏÄÜ·ñͨ¹ý²éѯÎﻯÊÓͼÀ´µÃµ½½á¹û£¬Èç¹û¿ÉÒÔ£¬Ôò±ÜÃâÁ˾ۼ¯»òÁ¬½Ó²Ù×÷£¬¶øÖ±½Ó´ÓÒѾ¼ÆËãºÃµÄÎﻯÊÓͼÖжÁÈ¡Êý¾Ý¡£Ä¬ÈÏΪDISABLE QUERY REWRITE¡£
¡¡¡¡Ë¢Ð£¨Refresh£©£ºÖ¸µ±»ù±í·¢ÉúÁËDML²Ù×÷ºó£¬ÎﻯÊÓͼºÎʱ²ÉÓÃÄÄÖÖ·½Ê½ºÍ»ù±í½øÐÐͬ²½¡£Ë¢ÐµÄģʽÓÐÁ½ÖÖ£ºON DEMANDºÍON COMMIT¡£ON DEMANDÖ¸ÎﻯÊÓͼÔÚÓû§ÐèÒªµÄʱºò½øÐÐˢУ¬¿ÉÒÔÊÖ¹¤Í¨¹ýDBMS_MVIEW.REFRESHµÈ·½·¨À´½øÐÐˢУ¬Ò²¿ÉÒÔͨ¹ýJOB¶¨Ê±½øÐÐˢС£ON COMMITÖ¸³öÎﻯÊÓͼÔÚ¶Ô»ù±íµÄDML²Ù×÷Ìá½»µÄͬʱ½øÐÐˢС£Ë¢Ðµķ½·¨ÓÐËÄÖÖ£ºFAST¡¢COMPLETE¡¢FORCEºÍNEVER¡£FASTˢвÉÓÃÔöÁ¿Ë¢Ð£¬Ö»Ë¢ÐÂ×ÔÉÏ´ÎË¢ÐÂÒÔºó½øÐеÄÐ޸ġ£COMPLETEˢжÔÕû¸öÎﻯÊÓͼ½øÐÐÍêÈ«µÄˢС£Èç¹ûÑ¡ÔñFORCE·½Ê½£¬ÔòOracleÔÚË¢ÐÂʱ»áÈ¥ÅжÏÊÇ·ñ¿ÉÒÔ½øÐпìËÙˢУ¬Èç¹û¿ÉÒÔÔò²ÉÓÃFAST·½Ê½£¬·ñÔò²ÉÓÃCOMPLETEµÄ·½Ê½¡£NEVERÖ¸ÎﻯÊÓͼ²»½øÐÐÈκÎˢС£Ä¬ÈÏÖµÊÇFORCE ON DEMAND¡£
¡¡¡¡ÔÚ½¨Á¢ÎﻯÊÓͼµÄʱºò¿ÉÒÔÖ¸¶¨ORDER BYÓï¾ä£¬Ê¹Éú³ÉµÄÊý¾Ý°´ÕÕÒ»¶¨µÄ˳Ðò½øÐб£´æ¡£²»¹ýÕâ¸öÓï¾ä²»»áдÈëÎﻯÊÓͼµÄ¶¨ÒåÖУ¬¶øÇÒ¶ÔÒÔºóµÄË¢ÐÂÒ²ÎÞЧ¡£
¡¡¡¡ÎﻯÊÓͼÈÕÖ¾£ºÈç¹ûÐèÒª½øÐпìËÙˢУ¬ÔòÐèÒª½¨Á¢ÎﻯÊÓͼÈÕÖ¾¡£ÎﻯÊÓͼÈÕÖ¾¸ù¾Ý²»Í¬ÎﻯÊÓͼµÄ¿ìËÙË¢Ð
Ïà¹ØÎĵµ£º
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii(’A’) A,ascii(’a’) a,ascii(’0’) zero,ascii(’ ’) space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
2.CHR
¸ø³öÕûÊý,·µ»Ø¶ÔÓ¦µÄ× ......
sysdate+(5/24/60/60) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ãë
sysdate+5/24/60 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5·ÖÖÓ
sysdate+5/24 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Сʱ
sysdate+5 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ìì
add_months(sysdate,-5) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5ÔÂ
add_months(sysdate,-5*12) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Äê
ÉÏÔÂÄ©µÄÈÕÆÚ£ºselect last_day(add_mon ......
Ëæ×Ų»Í¬Ó¦ÓÃÄ£¿é¼äµÄÏûÏ¢½»»¥ºÍͨÐųÉΪһ¸ö¹Ø¼üµÄ¹¦ÄÜ£¬²¢ÇÒ±äµÃÔ½À´Ô½ÖØÒª¡£OracleÒýÈëÁËÒ»ÖÖÇ¿´óµÄ¶ÓÁлúÖÆ£¬Í¨¹ýËü³ÌÐò¼ä¿ÉÒÔʵÏÖÐÅÏ¢µÄ½»»¥£¬oracle°ÑËü³Æ×÷ΪAQ - Advanced Queuing. ʹÓÃOracle AQ£¬ÎÒÃDz»ÐèÒª°²×°¶îÍâµÄÖмä¼þ£¬ËüÊÇOracleÊý¾Ý¿âµÄÒ»¸ö¹¦ÄÜ×é¼þ£¬Ö»ÒªÄã°²×°ÁËOracle Êý¾Ý¿â¾Í¿ÉÒÔʹÓÃAQÁË¡£½ ......
Ò»:oracle°æ±¾½éÉÜ:
oracle8
oracle8i ±íʾ´Ëʱoracle¹«Ë¾½ø¾ü»¥ÁªÍø,i´ú±íInternet
oracle9iºÍoracle8iÀàËÆ
oracle10g°üÀ¨ÏÖÔÚµÄ11gʹÓÃÁËÍø¸ñ¼ÆËã,g´ú±ígrid.
¶þ:oracle10g·þÎñ½éÉÜ:
OracleDBConsoleorcl Õâ¸öÊDzÉÓÃä¯ÀÀÆ÷ʹÓõÄoracleÆóÒµ¹ÜÀíÆ÷ (Ò²¾ÍÊÇÄã°²×°µ¯³öµÄÄǸöÍøÒ³)
OracleOraDb10g_home1iSQ ......