sqlÓÅ»¯É¨Ã¤
1.oracleɨÃèµÄ˳ÐòΪ´Óϵ½ÉÏ£¬´ÓÓÒµ½×ó
ËùÒÔÎÒÃÇÒª¾¡¿ÉÄܵİÑÊý¾ÝÉٵıí·ÅÔÚºóÃ棬½»²æ±í·ÅÔÚºóÃ棬×îÄܹýÂ˵ÄÌõ¼þ·ÅÔÚºóÃæ
2.²»ÒªÔÚË÷ÒýÉÏʹÓüÆËãºÍnot²Ù×÷·û
Ë÷ÒýÒ»µ©²ÎÓë¼ÆËã»òʹÓÃÁËnot²Ù×÷·û£¬oracle½«»áºöÂÔÕâ¸öË÷Òý
3.¾¡Á¿Ê¹ÓÃinºÍand£¬¾¡Á¿±ÜÃâʹÓÃor£¬or»á²úÉú´óÁ¿µÄ¹ýÂË £¬Ö±½Óµ¼ÖÂÂß¼¶Á´óÁ¿Ôö¼Ó
4.±ØҪʱʹÓÃautotrace(sqlplusÖÐÓÐЧ£¬PL/SQLÖÐÎÞЧ)
ÃüÁset autotrace on;
¹æÔò£º¾¡Á¿¼õÉÙÂß¼¶Á£¬Ó¦¸Ã±ÜÃâÎïÀí¶Á£¬Ìá¸ß»º³åÇøÃüÖÐÂÊ £¬×îºÃ±£³ÖÔÚ95%ÒÔÉÏ¡£
recursive calls µÝ¹éµ÷ÓÃ
db block gets Êý¾Ý¿é¶ÁÈ¡
consistent gets Ò»ÖÂÐÔ¶ÁÈ¡
physical reads ÎïÀí¶ÁÈ¡
redo size ²úÉúµÄÖØ×öÈÕÖ¾´óС
Âß¼¶Á=consistent gets + db block gets
»º³åÇøÃüÖÐÂÊ=(Âß¼¶Á-ÎïÀí¶Á)/Âß¼¶Á
Ò»¸ö½ø³Ì¿ÉÄܶÔÒÔºóÄܹ»Êý¾Ý¿éÖжà¸ösession¡£
sqlÓÅ»¯×îÖس£ÓõÄÊÇ°ì·¨ÊÇ£ºÉóÊÓsqlÓï¾ä
Ò²¿ÉÒÔÖ´ÐÐÕâÌõsqlÀ´²éÕҷdz£ºÄ·Ñ¿Õ¼äµÄsql£º
select sql_text ,sharable_mem from v$sql where sharable_mem > '100000' order by sharable_mem ;
Ïà¹ØÎĵµ£º
´Ó²»Í¬µÄ½Ç¶È£¬ÎÒÃÇ¿ÉÒÔ°ÑSQL ServerÊý¾Ýƽ̨»®·ÖΪ¶à¸ö×é¼þ¡£ÎÒÃÇÏÂÃæ°´ÕÕSQL Server Internal Teamͨ³£µÄ»®·ÖÔÔò£¬°ÑSQL ServerÊý¾Ýƽ̨»®·ÖΪÈçÏ£º
SSAS: SQL Server Analysis Service¡£Ö÷ÒªÓÃÀ´×ö·ÖÎöÓ㬱ÈÈçCube£¬¿ÉÒÔ´Ó²»Í¬µÄ½Ç¶ÈÉóÊÓÊý¾Ý¡£
SSIS: SQL Server Integration Servi ......
Äܼà¿ØSQL ServerÊý¾Ý¿âÔËÐеÄÇé¿ö£¬¶Ô·þÎñÆ÷À´Ëµ¶¼ÊÇÒ»¼þ·Ç³£ÖØÒªµÄÊ£¬ÏÂÃ濪ʼ½éÉÜ¡£
Microsoft SQL Server 2005 ÌṩÁËһЩ¹¤¾ßÀ´¼à¿ØÊý¾Ý¿â¡£·½·¨Ö®Ò»ÊǶ¯Ì¬¹ÜÀíÊÓͼ¡£¶¯Ì¬¹ÜÀíÊÓͼ (DMV) ºÍ¶¯Ì¬¹ÜÀíº¯Êý (DMF) ·µ»ØµÄ·þÎñÆ÷״̬ÐÅÏ¢¿ÉÓÃÓÚ¼à¿Ø·þÎñÆ÷ʵÀýµÄÔËÐÐ×´¿ö¡¢Õï¶ÏÎÊÌâºÍÓÅ»¯ÐÔÄÜ¡£
³£¹æ·þÎñÆ÷¶¯Ì¬¹ÜÀí¶ÔÏó°ü ......
ÒªÇ󣺲éѯÿ¸öÀÏʦËù´ø±ÏÒµÉè¼ÆµÄ»ã×ÜÇé¿ö£¬±ÏÒµÉè¼ÆѧÉú·Ö±¾¿Æ¡¢×¨¿Æ£¬ÔºÍâ¡¢ÔºÄÚ£¬ÒªÇóµÃµ½µÄ½á¹ûÐÎʽÈçÏ£º
½ÌʦÃû ÔºÄÚ±¾¿Æ Ô°ÄÚר¿Æ ÔºÍâ±¾¿Æ ÔºÍâר¿Æ ºÏ¼Æ
Ïà¹ØµÄ±íÓУºÑ§Éú±í£¨°üº¬Ñ§Éú²ã´Î£©¡¢½Ìʦ±í£¨½ÌʦÃû£©¡¢Ñ§Éú¿ÎÌâ±í£¨Ñ§Éú½Ìʦ¶ÔÓ¦¹ØϵÒÔ¼°ÔºÄÚÔºÍâÐÅÏ¢£©¡£
SQLÓï¾äÈçÏ£º
select
  ......
³£ÓÃSQLÓï¾äÊéд¼¼ÇÉ
×÷Õߣº À´Ô´£ºjavaeye²©¿Í ·¢²¼Õߣºadmin
ʱ¼ä£º2009-05-11 10:07:41 µã»÷£º2010
SQL½á¹¹»¯²éѯ×Ö·û´®µÄ¸Äд£¬ÊÇʵÏÖÊý¾Ý¿â²éѯÐÔÄÜÌáÉýµÄ×îÏÖʵ¡¢×îÓÐЧµÄÊֶΣ¬ÓÐʱÉõÖÁÊÇΨһµÄÊֶΣ¬±ÈÈçÔÚ²»ÔÊÐí´ó·ù¶ÈÐÞ¸ÄÏÖÓÐÊý¾Ý¿â½á¹¹µÄÇé¿öÏ¡£
ͨ¹ ......
ÎÊÌâÃèÊö£ºÓÐÒÔÏÂ2ÕÅ±í£¬
±íA
& ......