Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ORACLEÎﻯÊÓͼ Query RewriteµÄÒ»°ãÀí½âÖ®Ò»

http://www.anysql.net/oracle/query_rewrite_01.html
  Query Rewrite ÔÚÊý¾Ý²Ö¿âÊÇÊÇÒ»¸ö·Ç³£ÓÐÓõļ¼Êõ, TomÔÚ<<Effective Oracle by Design>>Ò»ÊéÖн«ÊµÌ廯ÊÓͼ(MView)³ÆÎªÊÇÊý¾Ý²Ö¿âµÄË÷Òý, ÕâÊÇÔÙÌùÇв»¹ýµÄÁË, ÔÚOLTPÖе±SELECTÓï¾äµÄËùÓеÄ×ֶζ¼ÔÚË÷ÒýÖÐʱ, Oracle¿ÉÒÔ²»´Ó±í¶ÁÊý¾Ý, ¶øÖ±½Ó´ÓË÷ÒýÖлñµÃÈ«²¿ÐÅÏ¢, ¶øQuery RewriteÔòÊÇͨ¹ý´´½¨Öмä±í, ÈÃOracle×Ô¶¯´Ó´´½¨µÄÖмä±í¶ÁÈ¡Êý¾Ý, ¶ø²»ÐèÒª´ÓÔ­±í¶ÁÈ¡ÁË, Õâ¸öÖмä±í¿ÉÒÔÊÇÔ¤ÏÈjoinºÃµÄ»òÔ¤ÏȼÆËãºÃµÄÖмä½á¹û. ËûµÄʹÓþͺÍÒ»°ãµÄË÷ÒýͬÀíÁË, ËäÈ»ÄãÖ¸¶¨µÄ»¹ÊÇÄǸö´ó±í, µ«oracle¿ÉÒÔΪÄã×Ô¶¯Ê¶±ð¿ÉÒÔ´ÓÄǸö"Êý¾Ý²Ö¿âË÷Òý"ÖжÁÈ¡Êý¾Ý. ÏÂÃæÎÒÃÇ¿ÉÒÔÀ´¿´Ò»ÏÂ×î¼òµ¥µÄÀý×Ó:
SQL> CREATE TABLE DETAIL_TABLE                                     
  2  AS SELECT OWNER,OBJECT_NAME from sys.dba_objects; 
Table created.
SQL> DESC DETAIL_TABLE
 Name                               Null?    Type 
 ---------------------------------- -------- --------------
 OWNER                                       VARCHAR2(30)
 OBJECT_NAME                                 VARCHAR2(128)
SQL> CREATE MATERIALIZED VIEW MID_TABLE ENABLE QUERY REWRITE
  2  AS
  3  SELECT OWNER,COUNT(*) TABCNT from DETAIL_TABLE GROUP BY OWNER;
Materialized view created.
SQL> DESC MID_TABLE
 Name  


Ïà¹ØÎĵµ£º

OracleËæ»úº¯Êý—dbms_random

1.»ù´¡ÈÏʶ   
  
DBMS_RANDOM°üµÄÏêϸÐÅÏ¢£º   
     select text   from all_source    
      where name = 'DBMS_RANDOM'    
    ......

ϸ̸OracleµÄȨÏÞ

ÎÒÃǾ­³£Ì¸¼°OracleµÄȨÏÞ£¬±ÈÈçConnect£¬DBA£¬resource£¬ sysdba, select any
table,
select_catelog_roleÕâÑùһЩȨÏÞ£¬ÈÃÎÒÃÇÑÛ»¨çÔÂҵģ¬ÄÇôÈçºÎÀ´Çø·ÖÕâЩÖÖÀà·±¶àµÄprivilegeÖв»ÖÁÓÚÑÛÃÔÀëÄØ£¬Õâ¸öÎÄÕ½«
»á¶ÔÄãÔÚÕâ·½ÃæµÄÁ˽âÆðµ½°ïÖú¡£
    
 ÒÔÉÏÎÒÃÇ¿´µ½µÄÕâЩȨÏÞ£¬¶¼ÊÇ¿ÉÒÔͨ¹ýg ......

oracleÊÂÎñ

1£©ÊÂÎñÓëËø
    µ±Ö´ÐÐÊÂÎñ²Ù×÷£¬±ÈÈç¶àÓû§Í¬Ê±½øÐвåÈë²Ù×÷ʱ£¬oracle»á¸øËùÓÐÕâЩ²åÈë²Ù×÷¼ÓÈë¶ÓÁУ¬ÏȽøÈë¶ÓÁеÄÏȽøÐвÙ×÷Ȩ£¬±ÈÈçÏÖÔÚAÓû§µÄ²Ù×÷ÊǵÚÒ»¸ö½øÈë¶ÓÁеģ¬ÄÇô´Ëʱ´Ë²Ù×÷¾Í»áÅжϲÙ×÷±íÉϵÄËøÊÇ·ñ´ò¿ª£¬Èç¹ûÊǹرյľÍ˵Ã÷ÓÐÆäËû²Ù×÷ÔÚÖ´ÐбØÐëµÈ´ýÆäÍê³É£¬Èç¹û´ò¿ªÁË£¬ÄǾͿÉÒÔÖ´Ðд˴ ......

ORACLEÎﻯÊÓͼ ÎﻯÊÓͼÈÕÖ¾½á¹¹

http://space.itpub.net/4227/viewspace-68592
ÎﻯÊÓͼµÄ¿ìËÙË¢ÐÂÒªÇó»ù±¾±ØÐ뽨Á¢ÎﻯÊÓͼÈÕÖ¾£¬ÕâÆªÎÄÕ¼òµ¥ÃèÊöÒ»ÏÂÎﻯÊÓͼÈÕÖ¾Öи÷¸ö×ֶεĺ¬ÒåºÍÓÃ;¡£
 
ÎﻯÊÓͼÈÕÖ¾µÄÃû³ÆÎªMLOG$_ºóÃæ¸ú»ù±íµÄÃû³Æ£¬Èç¹û±íÃûµÄ³¤¶È³¬¹ý20룬Ôòֻȡǰ20룬µ±½Ø¶Ìºó³öÏÖÃû³ÆÖظ´Ê±£¬Oracle»á×Ô¶¯ÔÚÎﻯÊÓͼÈÕÖ¾Ãû³ÆºóÃæ¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ