Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÈÕÆÚÄ£ºý²éѯ SQLʱ¼äת»»¸ñʽ

Select * from t_user_profile where convert ( varchar ( 21 ),regDate, 120 ) like ' 2008-05-07% ' ±íÃû³Æ£ºt_user_profile ÈÕÆÚ×Ö¶ÎÃû³Æ£ºregDate
Select   *   from t_user_profile  where  convert(varchar(21),regDate,120) like '2008-05-07%'< ......

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.µ½ÆóÒµ¹ÜÀíÆ÷£¬ÕÒµ½ Êý¾Ý¿â £­£­¡·ÓÒ¼ü£­£­¡·ËùÓÐÈÎÎñ£­£­¡ ......

PL/SQLѧϰ±Ê¼ÇÁù


1.´´½¨¹ý³Ì
create or replace procedure ¹ý³ÌÃû as
   ÉùÃ÷Óï¾ä¶Î;
begin
   Ö´ÐÐÓï¾ä¶Î;
exception
   Òì³£´¦ÀíÓï¾ä¶Î;
end;
2. ´ø²ÎÊýµÄ¹ý³Ì
²ÎÊýÀàÐÍ3ÖÖ
in²ÎÊý£º¶ÁÈë²ÎÊý£¬Ö÷³ÌÐòÏò¹ý³Ì´«µÝ²ÎÊýÖµ
out²ÎÊý£ºÊä³ö²ÎÊý£¬¹ý³ÌÏòÖ÷³ÌÐò´«µÝ²ÎÊýÖµ
in out²ÎÊý£ºË«Ïò²ÎÊý
¶¨Òå ......

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_ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ