v$sql,v$sqlarea,v$sqltextÓÐʲôÇø±ð
http://inthirties.com:90/thread-1202-1-1.html
v$sqltext
´æ´¢µÄÊÇÍêÕûµÄSQL,SQL±»·Ö¸î
SQL> desc v$sqltext
Name Null? Type
----------------------------------------- -------- ----------------------------
ADDRESS RAW(4) ---------
HASH_VALUE NUMBER --------- ºÍ address Ò»ÆðΨһ±êÖ¾Ò»Ìõsql
COMMAND_TYPE NUMBER
PIECE NUMBER ---------- ·ÖƬ֮ºóµÄ˳Ðò±àºÅ
SQL_TEXT VARCHAR2(64) -------------- ×¢Òⳤ¶È
v$sqlarea --------- ´æ´¢µÄSQL ºÍһЩÏà¹ØµÄÐÅÏ¢£¬±ÈÈçÀۼƵÄÖ´ÐдÎÊý£¬Âß¼¶Á£¬ÎïÀí¶ÁµÈͳ¼ÆÐÅÏ¢
SQL> desc v$sqlarea
Name Null? Type
----------------------------------------- -------- ----------------------------
SQL_TEXT VARCHAR2(1000)
SHARABLE_MEM NUMBER
PERSISTENT_MEM NUMBER
RUNTIME_MEM NUMBER
SORTS NUMBER
VERSION_COUNT NUMBER
LOADED_VERSIONS NUMBER
OPEN_VERSIONS NUMBER
USERS_OPENING NUMBER
FETCHES NUMBER
EXECUTIONS NUMBER
USERS_EXECUTING NUMBER
LOADS NUMBER
FIRST_LOAD_TIME VARCHAR2(38)
INVALIDATIONS NUMBER
PARSE_CALLS NUMBER
DISK_READS NUMBER
BUFFER_GETS NUMBER
Ïà¹ØÎĵµ£º
ºØÖÝÊм²²¡Ô¤·À¿ØÖÆÖÐÐÄËùÓõÄZmSoft´ÓÒµÌå¼ìÐÅÏ¢ÍøÂçϵͳV2010.1.26 Õýʽ°æ²ÉÓÃSQL SERVER2000ƽ̨,²»Ã÷ÔÒò,Êý¾Ý¿â"ÖÃÒÉ“,¿Í»§ÊÔ¹ýËùÓÐÍøÉÏ·½·¨,δÄܽâ¾ö.ÉòÑô¿ÎÄÊý¾Ý»Ö¸´ÖÐÐÄSQLÊý¾Ý¿â¹¤³Ìʦ³É¹¦½«Æä½â¾ö.
ÉòÑô¿ÎÄÊý¾Ý»Ö¸´ÖÐÐÄMS SQL SERVERÑз¢Ð¡×éÖÂÁ¦ÓÚMsSqlÊý¾Ý¿â¼¼ÊõµÄÑо¿¡£¾¹ý¶àÄêÑо¿ÍêÈ«ÕÆÎÕÁËS ......
JOINÓÅ»¯
MySQLÖÐjoinµÄʵÏÖ²ÉÓõÄÊÇNested Loop JoinËã·¨¡£Í¨¹ýÇý¶¯±íµÄ½á¹û¼¯×÷Ϊѻ·»ù´¡Êý¾Ý£¬È»ºó½«¸Ã½á¹û¼¯ÖеÄÊý¾Ý×÷Ϊ¹ýÂË
Ìõ¼þÒ»ÌõÌõµÄµ½ÏÂÒ»¸ö±íÖвéѯÊý¾Ý£¬×îºóºÏ²¢½á¹û£¬Èç¹û´æÔÚºóÐø±í£¬¹ý³ÌÒ²Èç´Ë¡£
¾¡Á¿¼õÉÙjoinÓï¾äÖÐnested loopÑ»·µÄ´ÎÊý¡£×îÓÐЧµÄ·½·¨ÊÇÈÃÇý¶¯±íµÄ½á¹û¼¯¾¡¿ÉÄܵÄС
ÓÅÏÈÓÅ»¯nested ......
½«Ä³ÖÖÊý¾ÝÀàÐ͵ıí´ïʽÏÔʽת»»ÎªÁíÒ»ÖÖÊý¾ÝÀàÐÍ¡£CAST ºÍ CONVERT ÌṩÏàËƵŦÄÜ¡£
Óï·¨
ʹÓà CAST£º
CAST ( expression AS data_type )
ʹÓà CONVERT£º
CONVERT (data_type[(length)], expression [, style])
²ÎÊý
expression
ÊÇÈκÎÓÐЧµÄ Microsoft® SQL Server™ ±í´ïʽ¡£Óйظü¶àÐÅÏ¢£¬Çë² ......
Ó¦Ò»¸öÅóÓѵÄÒªÇó£¬ÌùÉÏÊղصÄSQL³£Ó÷ÖÒ³µÄ°ì·¨¡«¡«
±íÖÐÖ÷¼ü±ØÐëΪ±êʶÁУ¬[ID] int IDENTITY (1,1)
1.·ÖÒ³·½°¸Ò»£º(ÀûÓÃNot InºÍSELECT TOP·ÖÒ³)
Óï¾äÐÎʽ£º
SELECT TOP Ò³¼Ç¼ÊýÁ¿ *
from ±íÃû
WHERE (ID NOT IN
(SELECT TOP (ÿҳÐÐÊý*(Ò³Êý-1)) ID
from ±íÃû
ORDER BY ID))
O ......
ʹÓÃPowerDesignerÉú³ÉÊý¾Ý¿â
½¨±íSQL
½Å
±¾Ê±£¬ÓÈÆäÊÇOracleÊý¾Ý¿âʱ£¬±íÃûÒ»°ã»á´øÒýºÅ¡£Æäʵ¼ÓÒýºÅÊÇPL/SQLµÄ¹æ·¶£¬Êý¾Ý¿â»áÑϸñ°´ÕÕ“”ÖеÄÃû³Æ½¨±í£¬Èç¹ûûÓГ”£¬»á°´ÕÕ
ORACLEĬÈϵÄÉèÖý¨±í£¨DBA
STUDIOÀïÃ棩£¬Ä¬ÈÏÊÇÈ«²¿´óд£¬ÕâÑù£¬ÔÚORACLEÊý¾Ý¿âÀïµÄ×ֶξÍÈç“Column_1&rdqu ......