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

¹ØÓÚoracleµÄС֪ʶ

select trunc(sysdate ,'yyyy') from dual   --±¾Äê¶ÈµÚÒ»Ìì
              
select trunc(sysdate ,'mm') from dual     --±¾ÔµÚÒ»Ìì
              
select trunc(sysdate ,'dd') from dual       --µ±Ç°ÈÕÆÚ
dbms_output.put_line( to_char (  ((sysdate)+  ( 10 / ( 24*60*60 ))    )  , 'yyyy-mm-dd hh24:mi:ss'  ) ) ;--µ±Ç°Ê±¼ä+10s 
dbms_output.put_line( to_char (  trunc(sysdate)+(  1 +  1/24   ) , 'yyyy-mm-dd hh24:mi:ss'  ) ) ;       --µ±Ç°  µÚ2Ìì 1µã
dbms_output.put_line( to_char (  trunc(sysdate)+(  1 +  9/24   ) , 'yyyy-mm-dd hh24:mi:ss'  ) ) ;       --µ±Ç°  µÚ2Ìì 9µã
 create table tb_old as select * from tb_new where  to_date(ci_week,'yyyy-mm-dd')<to_date('2010-02-22','yyyy-mm-dd')
£¨1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£ºORACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔÉϵıíÁ¬½Ó²éѯ, ÄǾÍÐèҪѡÔñ½»²æ±í(intersection table)×÷Ϊ»ù´¡±í, ½»²æ±íÊÇÖ¸ÄǸö±»ÆäËû±íËùÒýÓõıí.¡¡¡¡¡¡¡¡¡¡¡¡
£¨2£© WHERE×Ó¾äÖеÄÁ¬½Ó˳Ðò£®£ºORACLE²ÉÓÃ×Ô϶øÉϵÄ˳Ðò½âÎöWHERE×Ó¾ä,¸ù¾ÝÕâ¸öÔ­Àí,±íÖ®¼äµÄÁ¬½Ó±ØÐëдÔÚÆäËûWHEREÌõ¼þ֮ǰ, ÄÇЩ¿ÉÒÔ¹ýÂ˵ô×î´óÊýÁ¿¼Ç¼µÄÌõ¼þ±ØÐëдÔÚWHERE×Ó¾äµÄĩβ.¡¡
¡¡£¨3£© SELECT×Ó¾äÖбÜÃâʹÓà ‘ * ‘£ºORACLEÔÚ½âÎöµÄ¹ý³ÌÖÐ, »á½«’*’ ÒÀ´Îת»»³ÉËùÓеÄÁÐÃû, Õâ¸ö¹¤×÷ÊÇͨ¹ý²éѯÊý¾Ý×ÖµäÍê³ÉµÄ, ÕâÒâζ׎«ºÄ·Ñ¸ü¶àµÄʱ¼ä¡¡¡¡¡¡¡¡¡¡¡¡
£¨4£© ¼õÉÙ·ÃÎÊÊý¾Ý¿âµÄ´ÎÊý£ºORACLEÔÚÄÚ²¿Ö´ÐÐÁËÐí¶à¹¤×÷: ½âÎöSQLÓï¾ä, ¹ÀËãË÷ÒýµÄÀûÓÃÂÊ, °ó¶¨±äÁ¿ , ¶ÁÊý¾Ý¿éµÈ£»¡¡¡¡¡¡¡¡¡¡¡¡
£¨5£© ÔÚSQL*Plus , SQL*FormsºÍPro*CÖÐÖØÐÂÉèÖÃARRAYSIZE²ÎÊý, ¿ÉÒ


Ïà¹ØÎĵµ£º

Sun & Oracle£¬ÑϾþµÄÌôÕ½£¨¶þ£©

      СÐÍ»ú·Ïߣ¬¼¸ºõÒѱ»·âËÀ¡£ÎÞ·¨Ê¹ÓÃSun£¬ËüÒѺÍOracle½ôÃܰ󶨣¬Èô»¹Ê¹ÓÃÉÏÊöÉè¼Æ£¬»áºÜÄÑ˵·þÊÛÇ°½«Ð¡ÐÍ»ú¡¢´æ´¢¡¢Êý¾Ý¿â·Ö±ð´Ó²»Í¬³§É̲ɹº£»ÁíÍ⣬ÒàÎÞ·¨Ê¹ÓÃIBM£¬¾Ý˵FLYµÄij¸öÀϰ岻ϲ»¶¡£       ´óÁ¦ÍƽøÊý¾Ý¿âϵͳPC»¯£¬ÕâËƺõÊÇ×î¼Ñ²ßÂÔ¡£FLYÓ¦ÓöÔÊý¾Ý ......

oracle ÅäÖø߼¶¸´ÖÆ»·¾³Óöµ½µÄÎÊÌâ

1¡¢ÔÚ±¾»ú69ÉÏ´´½¨Êý¾Ý¿âorcl £¬global_name=orcl£¬Ê¹ÓÃÓï¾ä
alter database rename global_name to orcl.us.oracle.com ÐÞ¸ÄÊý¾Ý¿âµÄÈ«¾ÖÊý¾Ý¿âÃûΪorcl.us.oracle.com
2¡¢ÔÚÐé»ú188ÉÏ´´½¨Êý¾Ý¿âviotest£¬global_name=viotest£¬Ê¹ÓÃÓï¾ä
alter database rename global_name to viotest.us.oracle.com ÐÞ¸ÄÊý¾Ý¿âµÄÈ«¾ÖÊ ......

oracle²éѯÁ´½ÓÊý sqlÃüÁî

select t.OSUSER,t.STATUS,t.LOGON_TIME from v$session t
select t.OSUSER,t.STATUS,t.LOGON_TIME from v$session t where t.OSUSER='admin'
select t.OSUSER,t.STATUS,t.LOGON_TIME from v$session t where t.OSUSER='liuzhaoqing'
select t.OSUSER,t.STATUS,t.LOGON_TIME from v$session t where t.OSUSER='ymx'
sel ......

Éî¶È¶Ô±ÈOracleÓëSQL Server

Ò»°ãµÄ¹«Ë¾Í¨³£»áÔÚËûÃǵÄÐÅϢϵͳ¼Ü¹¹ÖÐÒýÈë¶àÖÖÊý¾Ý¿âƽ̨£¬Í¬Ê±ÒýÈëÈýµ½ËÄÖÖ²»Í¬µÄRDBMS½â¾ö·½°¸µÄÖдóÐ͹«Ë¾Ò²²¢²»ÉÙ¼û£¬µ±È»ÕâЩ¹«Ë¾ÀïÃæµÄDBAÃÇͨ³£Ò²ÐèҪͬʱӵÓйÜÀí¶àÖÖ²»Í¬Æ½Ì¨µÄ¼¼ÄÜÁË¡£
Ö»ÔÚÒ»ÖÖƽ̨ÉÏÕ¹¿ª¹¤×÷µÄÊý¾Ý¿âר¼ÒÃÇҲͨ³£»áÆÚ´ý×ÅÔÚËûÃǵÄÏÂÒ»·Ý¹¤×÷ÖÐÄÜѧµ½µã²»Ò»ÑùµÄ¶«Î÷£¬ÄÇЩÓÐÓÂÆøµÄÈËÃÇÔòÔ¸Òâ ......

oracleɾ³ýËÀËøµÄsession

²é¿´Ëø±í½ø³ÌSQLÓï¾ä1£º
select sess.sid,
    sess.serial#,
    lo.oracle_username,
    lo.os_user_name,
    ao.object_name,
    lo.locked_mode
    from v$locked_object lo,
    dba_objects ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ