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

Oracle·ÖÎö±íºÍË÷Òý(analyze)

analyze table tablename compute statistics;
analyze index indexname compute statistics;
¶ÔÓÚʹÓÃCBOºÜÓкô¦£¬¿ÉÒÔʹÓøü¿É¿¿µÄtableÐÅÏ¢£¬´Ó¶øÖ´Ðмƻ®Ò²¿ÉÒÔ¸ü׼ȷһЩ£¬ÔÚ10g»á×Ô¶¯analyze£¬Ö®Ç°µÄ°æ±¾ÐèÒªÊÖ¶¯¶¨ÆÚ
Éú³Éͳ¼ÆÐÅÏ¢,,Ñ¡ÔñºÏÀíµÄÖ´Ðмƻ®..
OracleµÄonline documentÕâÑùÃèÊöanalyzeµÄ×÷Óãº
Use the ANALYZE statement to collect non-optimizer statistics, for example, to:
1¡¢Collect or delete statistics about an index or index partition, table or table partition, index-organized table, cluster, or scalar object attribute.
2¡¢Validate the structure of an index or index partition, table or table partition, index-organized table, cluster, or object reference (REF).
3¡¢Identify migrated and chained rows of a table or cluster.
¶ÔÓÚÊÕ¼¯Í³¼ÆÐÅÏ¢Õâ¿é£¬ÎÒÒ»°ãʹÓÃdbms_statsÕâ¸öpackage£¬ÊÕ¼¯Í³¼ÆÐÅÏ¢µÄ×öÓÃʹCBO·½Ê½µÄÓÅ»¯Ñ¡ÔñÖ´Ðмƻ®¸ü׼ȷ¡£
ͳ¼ÆÐÅÏ¢×îºÃ¶¨ÆÚÊÕ¼¯£¬ÒÔÒµÎñµÄ²»Í¬È·¶¨²»Í¬µÄÊÕ¼¯ÖÜÆÚ¡£


Ïà¹ØÎĵµ£º

Oracle¸üжàÐÐ

¸üжàÐеIJ½Ö裺
²½Öè¶à£¬µ«Ð§ÂʱȽϸߣº
1¡¢create table ÁÙʱ±í value (select a.id,a.name,b.name,... from table1 a,table2 b where a.id=b.id)
2¡¢É¾³ýtable1ÖеļǼ£¬²»Òªdrop
3¡¢insert into table1 select ÄãÐèÒªµÄ×Ö¶Î from ÁÙʱ±í¡£
select * from tb_ai03
create table tb_ai031 as select * from tb ......

ÌáÈ¡Oracleµ±Ç°Óû§Ãû£¬»úÆ÷Ãû£¬IPµÄ·½·¨

select sysdate  µ±Ç°Ê±¼ä,
       sys.login_user  Êý¾Ý¿âÓû§,
       machine   µÇ¼»úÆ÷Ãû,
       SYS_CONTEXT('USERENV', 'IP_ADDRESS')   µÇ¼IP,
     &n ......

Oracle LongÐÍ

Oracle LongÐÍ
 
1¡¢LONG Êý¾ÝÀàÐÍÖд洢µÄÊǿɱ䳤×Ö·û´®£¬×î´ó³¤¶ÈÏÞÖÆÊÇ2GB¡£
2¡¢¶ÔÓÚ³¬³öÒ»¶¨³¤¶ÈµÄÎı¾£¬»ù±¾Ö»ÄÜÓÃLONGÀàÐÍÀ´´æ´¢£¬Êý¾Ý×ÖµäÖкܶà¶ÔÏóµÄ¶¨Òå¾ÍÊÇÓÃLONGÀ´´æ´¢µÄ¡£
3¡¢LONGÀàÐÍÖ÷ÒªÓÃÓÚ²»ÐèÒª×÷×Ö·û´®ËÑË÷µÄ³¤´®Êý¾Ý£¬Èç¹ûÒª½øÐÐ×Ö·ûËÑË÷¾ÍÒªÓÃvarchar2ÀàÐÍ¡£
4¡¢ºÜ¶à¹¤¾ß£¬°üÀ¨SQL*Plus£¬´ ......

Oracle´æ´¢¹ý³Ì×ܽá(Ò»¡¢»ù±¾Ó¦ÓÃ)

1¡¢´´½¨´æ´¢¹ý³Ì
create or replace procedure test(var_name_1 in type,var_name_2 out type) as
--ÉùÃ÷±äÁ¿(±äÁ¿Ãû ±äÁ¿ÀàÐÍ)
begin
--´æ´¢¹ý³ÌµÄÖ´ÐÐÌå
end test;
´òÓ¡³öÊäÈëµÄʱ¼äÐÅÏ¢
E.g:
create or replace procedure test(workDate in Date) is
begin
dbms_output.putline('The input date is: ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ