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

[ת]Oracle Ëæ»ú»ñÈ¡NÌõÊý¾Ý


µ±ÎÒÃÇ»ñÈ¡Êý¾Ýʱ,¿ÉÄÜ»áÓÐÕâÑùµÄÐèÇó,¼´Ã¿´Î´Ó±íÖлñÈ¡Êý¾Ýʱ,ÊÇËæ»ú»ñÈ¡Ò»¶¨µÄ¼Ç¼,¶ø²»ÊÇÿ´Î¶¼»ñÈ¡Ò»ÑùµÄÊý¾Ý,ÕâʱÎÒÃÇ¿ÉÒÔ²ÉÈ¡OracleÄÚ²¿Ò»Ð©º¯Êý,À´´ïµ½ÕâÑùµÄÄ¿µÄ.   
  
   1) select * from (select * from tablename order by sys_guid()) where rownum < N;    
   2) select * from (select * from tablename order by dbms_random.value) where rownum< N;    
   3) select *  from (select * from table_name sample(10)   order by trunc(dbms_random.value(0, 1000)))  where rownum < N;   
   ËµÃ÷: sample(10)º¬ÒåΪ¼ìË÷±íÖеÄ10%Êý¾Ý,sampleÖµÓ¦¸ÃÔÚ[0.000001,99.999999]Ö®¼ä.   
  
   ÆäÖРsys_guid() ºÍ dbms_random.value¶¼ÊÇÄÚ²¿º¯Êý,ͨ¹ýÕâÑùµÄ·½·¨,¾Í¿ÉÒÔʵÏÖÎÒÃǵÄÐèÇóÁË.   
  
   ×¢:   
        ÔÚʹ1)·½·¨Ê±,¼´Ê¹ÓÃsys_guid() ÕâÖÖ·½·¨Ê±,ÓÐʱ»á»ñÈ¡µ½ÏàͬµÄ¼Ç¼,¼´ºÍÇ°Ò»´Î²éѯµÄ½á¹û¼¯ÊÇÒ»ÑùµÄ,ÎÒ²éÕÒÁËÏà¹Ø×ÊÁÏ,ÓÐЩ˵ÊǺͲÙ×÷ϵͳÓйØ,ÔÚwindowsƽ̨ÏÂÕý³£,»ñÈ¡µ½µÄÊý¾ÝÊÇËæ»úµÄ,¶øÔÚlinuxµÈƽ̨ÏÂʼÖÕÊÇÏàͬ²»±äµÄÊý¾Ý¼¯,ÓÐЩ˵ÊÇÒòΪsys_guid()º¯Êý±¾ÉíµÄÎÊÌâ,¼´sys_guid()»áÔÚ²éѯÉÏÉú³ÉÒ»¸ö16×Ö½ÚµÄÈ«¾ÖΨһ±êʶ·û,Õâ¸ö±êʶ·ûÔÚ¾ø´ó²¿·Öƽ̨ÉÏÓÉÒ»¸öËÞÖ÷±êʶ·ûºÍ½ø³Ì»ò½ø³ÌµÄÏ̱߳êʶ·û×é³É,Õâ¾ÍÊÇ˵,ËüºÜ¿ÉÄÜÊÇËæ»úµÄ,µ«ÊDz¢²»±íʾһ¶¨ÊÇ°Ù·ÖÖ®°ÙµÄÕâÑù.   
         
       ËùÒÔ,Ϊȷ±£ÔÚ²»Í¬µÄƽ̨ÿ´Î¶ÁÈ¡µÄÊý¾Ý¶¼ÊÇËæ»úµÄ,ÎÒÃÇ´ó¶à²ÉÓÃ2)ºÍ3)Á½ÖÖ·½°¸,ÆäÖÐ2)·½°¸¸ü³£ÓÃ.3)·½°¸ËõСÁ˲éѯµÄ·¶Î§,ÔÚ²éѯ´ó±í,ÇÒÒªÌáÈ¡Êý¾Ý²»ÊǺܲ»¶àµÄÇé¿öÏÂ,»á¶Ô²éѯËÙ¶ÈÉÏÓÐÒ»¶¨µÄÌá¸ß,   
  
   Áí:ÔÚOracleÖÐÒ»°ã»ñÈ¡Ëæ»úÊ


Ïà¹ØÎĵµ£º

WindowsÏÂORACLE 10g°²×°Óë²Ù×÷ͼ½â

      ¸Õ¸Õ½Ó´¥ORACLEµÄÈËÀ´Ëµ,´ÓÄÇÀïѧ,ÈçºÎѧ,ÓÐÄÇЩ¹¤¾ß¿ÉÒÔʹÓÃ,Ó¦¸ÃÖ´ÐÐʲô²Ù×÷,Ò»¶¨»Ø¸Ðµ½ÎÞÖú¡£ËùÒÔÔÚѧϰʹÓÃORACLE֮ǰ£¬Ê×ÏÈÀ´°²×°Ò»ÏÂORACLE 10g£¬ÔÚÀ´ÕÆÎÕÆä»ù±¾¹¤¾ß¡£Ë×»°ËµµÄºÃ£º¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆäÆ÷¡£ÎÒÃÇ¿ªÊ¼°É£¡
     Ê×ÏȽ«ORACLE 10gµÄ°²×°¹âÅÌ ......

OracleÖ´ÐÐÍⲿÎļþ£º

OracleÖ´ÐÐÍⲿÎļþ£º
c:>sqlplus user/pwd@db
sql>@new.sql
Ö´Ðжà¸ösqlÎļþ:
1.°ÑËùÓеÄÎļþ¶¼·ÅÔÚͬһ¸öĿ¼Ï£¬È»ºóÔÚÃüÁîÐÐÀïÖ´ÐÐÃüÁ
         c:>dir/b > d:\1.sql
   »á°ÑËùÓеÄsqlÎļþÃû¶¼Êä³öµ½Ò»¸ösqlÎļþÖС£
2.ÓÃUltraEdit´ò¿ªÉú³ÉµÄ ......

´óÐÍÊý¾Ý¿âÓÅ»¯Éè¼Ædz̸(ORACLE) £¨Ò»£©

  
   ¶ÔÓÚORACLEÊý¾Ý¿âµÄÊý¾Ý´æÈ¡£¬Ö÷ÒªÓÐËĸö²»Í¬µÄµ÷Õû¼¶±ð£¬µÚÒ»¼¶µ÷ÕûÊDzÙ×÷ϵͳ¼¶°üÀ¨Ó²¼þƽ̨,µÚ¶þ¼¶µ÷ÕûÊÇORACLE RDBMS¼¶µÄµ÷Õû,µÚÈý¼¶ÊÇÊý¾Ý¿âÉè¼Æ¼¶µÄµ÷Õû,×îºóÒ»¸öµ÷Õû¼¶ÊÇSQL¼¶¡£Í¨³£ÒÀ´ËËļ¶µ÷Õû¼¶±ð¶ÔÊý¾Ý¿â½øÐе÷Õû¡¢ÓÅ»¯£¬Êý¾Ý¿âµÄÕûÌåÐÔÄÜ»áµÃµ½ºÜ´óµÄ¸ÄÉÆ¡£ÏÂÃæ´Ó¼¸¸ö²»Í¬·½Ã ......

ÓÃsqlplusΪoracle´´½¨Óû§ºÍ±í¿Õ¼ä


 ÓÃOracle9i×Ô´øµÄÆóÒµ¹ÜÀíÆ÷»òPL/SQLͼÐλ¯µÄ·½·¨´´½¨±í¿Õ¼äºÍÓû§ÒÔ¼°·ÖÅäȨÏÞÊÇÏà¶Ô±È½Ï¼òµ¥µÄ£¬±¾ÎÄÒª½éÉܵÄÊÇÁíÒ»ÖÖ·½·¨£¬Ê¹ÓÃOracle 9iËù´øµÄÃüÁîÐй¤¾ß£ºSQLPLUSÀ´´´½¨±í¿Õ¼ä£¬Õâ¸ö·½·¨ÓÃÆðÀ´¸ü¼Ó¼òÃ÷¿ì½Ý¡£
       
        ¼ÙÉè ......

¸ü»»ORACLE±í¶ÔÏóËùÊôÓû§

 ÒÔÇ°ÓиöÏîÄ¿½«Óû§±í½¨Á¢ÔÚÁËsystemÓû§ËùÊôÏ£¬ºóÀ´·¢¾õΣº¦Ï൱´ó£¬×¼±¸½«±í¶ÔÏóתÒƵ½Ð½¨Á¢µÄLANDÓû§Ï£¬Ã»ÕÒµ½Ö±½ÓµÄ°ì·¨£¬ÓÃÒÔÏ°취µÃÒÔʵÏÖ£º
1¡¢½¨Á¢ÐµÄLANDÓû§£¬ÔÚ·þÎñÆ÷µÄOracle Enterprise ManagerÀï·ÖÅä ¶ÔÏóȨÏÞ £¬Ìí¼Ó¶ÔsystemÖÐÊý¾Ý±í¶ÔÏóµÄ select  È¨ÏÞ¡£
2¡¢ÒÔ LAND Óû§µÇ¼£¬Ê¹ÓÃÃüÁ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ