Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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µ±Ç°Óû§Ãû£¬»úÆ÷Ãû£¬IPµÄ·½·¨

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

oracleÓû§½âËø

OracleÓû§½âËø
¡¡¡¡Ã¿µ±ÎÒÃÇа²×°ÁËoracleºó,µÚÒ»´ÎÔËÐж¼»á³öÏÖÒ»¸öÓû§±»ËøµÄ´íÎóÌáʾ,´ËʱÐèÒªÎÒÃÇÊÖ¶¯½øÐÐÓû§½âËø,ÏÂÃæÒÔ½âËøscottÓû§ÎªÀý: Ê×ÏÈÔÚÃüÁîÐд°¿ÚÖÐÊäÈë sqlplus sys/sys as sysdba ÕâÀïµÄsysÊÇϵͳÕ˺Å,oracle×Ô´øµÄ,ºóÃæµÄsysÊÇÃÜÂë,Õâ¸öÃÜÂëÔÚÄ㰲װʱÉèÖúõÄ. as sysdba Òâ˼¾ÍÊÇÒÔÕâ¸öÓû§×öΪÊý ......

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: ......

OracleÖеÄnull

²éѯijÁÐֵΪnullµÄ¼Ç¼£º
select *
from    tablename
where col is null;
²éѯijÁÐÖµ²»ÎªnullµÄ¼Ç¼£º
select *
from   tablename
where col is not null;
Õë¶ÔnullµÄ+-*/=!=µÈ²Ù×÷¶¼ÊÇnull£º
null±íʾ²»È·¶¨µÄÖµ£¬Á½¸önull±íʾÁ½¸ö²»È·¶¨µÄÖµ¡¢Î´ÖªµÄÖµ£¬Òò´Ë²»´æÔÚÁ½¸önullµÄÏàµÈ£¬Í ......

MS SQL Server ¡¢Sybase¡¢ OracleÖ§³ÖËø¶¨·½°¸µÄ²»Í¬

»¹ÊǼ¸Î»¶ÁÎÒµÄÊé (¡¶Oracle´óÐÍÊý¾Ý¿âϵͳÔÚAIX UNIXÉϵÄʵսÏê½â¡·) µÄ¶ÁÕßÀ´Óʼþ×ÉѯÎÊÌ⣬ºÜ±§Ç¸ÎÒ²»ÄÜÖðλ»Ø¸´Óʼþ£¬µÚÒ»ÎÒÕæµÄͦ棬µÚ¶þÕâЩÎÊÌâÆÄÓй²ÐÔ¡£ÎÒÀ´½èÖúÕâ¸öµØ·½£¬Í³Ò»µØºÍÖîλ̽ÌÖ£¬ºÜ¶àÎÊÌâÎÒÒ²ÊÇÔÚÃþË÷ÖУ¬²»ÄÜÖ±½Ó¸ø´ó¼Ò´ð°¸£¬ºÇºÇ£¬´ó¼Ò¼ûÁ°¡!

˵˵ËøÎÊÌâ¡£ MS SQLÖ§³ÖµÄËøÀàÐͺÍOracle²îÒìÊǺ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ