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

SQLÓï¾äÓÅ»¯Êµ¼ùÖ®Ò»SQL_TRACE

SQLÓï¾äÓÅ»¯Êµ¼ùÖ®Ò»SQL_TRACE
 
»·¾³£ºÔÚPL/sqlÉϵ÷ÊÔÊý¾Ý
Pl/sql developer¹¤¾ßÁ¬½ÓʵÀýºó¼´×÷Ϊһ¸öÓû§½ø³ÌÕ¼ÓÃÒ»¸ösession£»
 
select * from  v$session t  where t.PROGRAM='plsqldev.exe' and  t.USERNAME='DZJC'
²éѯ½á¹ûÏÔʾÁ˼¸¸ö¹Ø¼üµÄ×Ö¶Î
SADDR   RAW(4)  Session address ÄÚ´æµØÖ·
SID  NUMBER  Session identifier  Ψһ±êʶ
SERIAL#  NUMBER 
Session serial number. Used to identify uniquely a session's objects. Guarantees that session-level commands are applied to the correct session objects if the session ends and another session begins with the same session ID 
STATUS  VARCHAR2(8) 
Status of the session: ACTIVE (currently executing SQL), INACTIVE, KILLED (marked to be killed), CACHED (temporarily cached for use by Oracle*XA), SNIPED (session inactive, waiting on the client) µ±ÆÚ״̬
MACHINE  VARCHAR2(64)  Operating system machine name 
PROGRAM  VARCHAR2(48)  Operating system program name Ó¦ÓóÌÐòÃû³Æ¡£
´ò¿ª´°¿ÚÒÀ´ÎÖ´ÐÐÈçÏÂÃüÁ
Æô¶¯µ±ÆÚsesison¼¶±ð ¸ú×Ù
Æô¶¯SQL¸ú×Ù
ʵÀý¼¶±ð
Alter system set sql_trace=true  scope=both;
µ±ÆÚsession¼¶±ð
Alter session set sql_trace=true;
»ò
Execute dbms_session.set_sql_trace(true);
EXECUTE dbms_system.set_sql_trace_in_session
(session_id, serial_id, true);
 
 
 
 
 
 
 
 
 
Alter  session  set sql_trace=true;
Ö´Ðдýµ÷ÊÔµÄÓï¾ä
select c.code, nvl(b.con, 0)
  from t_sys_codemap c,
       (select COUNT(1) con, m.bljg
          from V_JC_XZXK_BUSI_TIMELIMIT t, V_JC_XZXK_BUSIINDEX m
         where t.busiindexid = m.ywlsh
           and t.LIMITTYPE = 1
           and trunc(m.tjsj) >= trunc(SYSDATE, 'year')
&nb


Ïà¹ØÎĵµ£º

Sql server ʱ¼ä¶Î²éѯ µÄÏà¹Ø·Ñ½âÎÊÌâ

sql server ʱ¼ä¶Î²éѯ¡£
==========================================
select g.borrowTime  from t_apartment_goodsborrow g
where g.borrowTime >= '2010-03-11 9:50:43'
2010-03-11 9:52:54
----------------------------------------------------------------------------
select g.borrowTime  ......

ÁíÀà¼òµ¥µÄSQLÊý¾Ý¿â¸ÄÃû·½·¨

°ÑOldÊý¾Ý¿â¸ÄΪNewÊý¾Ý¿â
1.´ò¿ª“ÆóÒµ¹ÜÀíÆ÷”ÕÒµ½ OldÊý¾Ý¿â£­£­¡·ÓÒ¼ü£­£­¡·ËùÓÐÈÎÎñ£­£­¡··ÖÀëÊý¾Ý¿â
2.µ½C:\Program Files\Microsoft SQL Server\MSSQL\DataÏÂÕÒµ½Old_Data.mdfºÍOld_log.ldf°ÑOld_Data»»³ÉÄãÏëÒªµÄÃû×ÖÀýÈçNew.mdf¡¢New.ldf
3.µ½ÆóÒµ¹ÜÀíÆ÷£¬ÕÒµ½ Êý¾Ý¿â £­£­¡·ÓÒ¼ü£­£­¡·ËùÓÐÈÎÎñ£­£­¡ ......

½«Ò»¸öSQLÊý¾Ý¿âÖÐµÄ±íµ¼Èëµ½±ðÒ»¸öÊý¾Ý¿âÖÐ

µ¼ÈëµÄÏêϸÁ÷³Ì
1¡¢Ð½¨Ò»¸öÊý¾Ý¿â
2¡¢ÔÚеÄÊý¾Ý¿âÉϵãÓÒ¼ü-¡·“ËùÓÐÈÎÎñ”-¡·“µ¼ÈëÊý¾Ý¿â”£¬µãÏÂÒ»²½
3¡¢Ê²Ã´¶¼²»Òª¸Ä£¬ÔÚÊý¾Ý¿âÖÐÑ¡ÔñÄǸö¾ÉµÄÊý¾Ý¿â£¬µãÏÂÒ»²½
4¡¢ÔÚÕâ¸ö½çÃæµÄÊý¾Ý¿âÖÐÑ¡ÔñÄãн¨µÄÊý¾Ý¿â£¬µãÏÂÒ»²½
5¡¢Ñ¡Ôñ“ÔÚSQL SERVERÊý¾Ý¿âÖ®¼ä¸´ÖƶÔÏóºÍÊý¾Ý”£¬µãÏÂÒ»²½ ......

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü
ÉÏһƪ / ÏÂһƪ  2008-09-04 11:25:01
²é¿´( 1991 ) / ÆÀÂÛ( 0 ) / ÆÀ·Ö( 0 / 0 )
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_ ......

SQLÓÅ»¯34Ìõ


£¨1£©      Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLE µÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔÉϵıíÁ¬½Ó²éѯ, ÄǾÍÐèÒª ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ