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

OracleÖеÄdecodeÓ÷¨

OracleÖеÄdecodeÓ÷¨
Decode(Ìõ¼þ£¬Öµ1£¬ÏÔʾֵ1£¬Öµ2£¬ÏÔʾֵ2£¬…… Öµn£¬ÏÔʾֵn)
Ó¦ÓþÙÀý£º
select t.res_id,
       t.res_size || '(kb)' as res_size,
       decode(t.res_type,1,'Ä£°åÇø','0','ÎĵµÇø') res_type,
       t.res_address,
       t.createtime,
       t.createuser
  from t_cms_d_resource t


Ïà¹ØÎĵµ£º

²é¿´OracleÖ´Ðмƻ®µÄ¼¸ÖÖ·½·¨

²é¿´OracleÖ´Ðмƻ®µÄ¼¸ÖÖ·½·¨
Ò»¡¢Í¨¹ýPL/SQL Dev¹¤¾ß
    1¡¢Ö±½ÓFile->New->Explain Plan Window£¬ÔÚ´°¿ÚÖÐÖ´ÐÐsql¿ÉÒԲ鿴¼Æ»®½á¹û¡£ÆäÖУ¬Cost±íʾcpuµÄÏûºÄ£¬µ¥Î»Îªn%£¬Cardinality±íʾִÐеÄÐÐÊý£¬µÈ¼ÛRows¡£
    2¡¢ÏÈÖ´ÐÐ EXPLAIN PLAN FOR   select * from tab ......

oracleɾ³ýËø±í

ÒÔdbaµÇ½
1.²é¿´Äĸö±í±»Ëø:
  select b.owner,b.object_name,l.session_id,l.locked_mode
  from v$locked_object l, dba_objects b
  where b.object_id=l.object_id;
2.²é¿´±»Ëø±íµÄsid ºÍserial# :
  select t2.username,t2.sid,t2.serial#,t2.logon_time
  from v$locked_object t1 ......

Ïê½âLinuxÏÂOracleµÄ¾²Ä¬°²×°


ÔÚijЩÌØÊâµÄÇé¿öÏ£¬ÈçÒòΪÍøÂç»òÕßXÅäÖõĹØϵÎÞ·¨Á¬½Óµ½X server»òÕßÖ÷»úÉÏûÓÐX£¬¾Í¿ÉÒÔʹÓþ²Ä¬°²×°µÄ·½Ê½°²×°Êý¾Ý¿â£¬Í¬ÑùÈç¹ûÐèÒª´ó¹æÄ£²¿Êð£¬Ôò¾²Ä¬°²×°½«»á´ó´ó¼õÇáDBAµÄÖظ´ÀͶ¯Á¦£¬¶øÇÒ¾²Ä¬°²×°²»ÐèÒªX£¬´Ó°²×°Ð§ÂÊ  
ÔÚijЩÌØÊâµÄÇé¿öÏ£¬ÈçÒòΪÍøÂç»òÕßXÅäÖõĹØϵÎÞ·¨Á¬½Óµ½X server»òÕßÖ÷»úÉÏûÓÐX£ ......

oracle distinct

oracle distinct
¹Ø¼ü×Ö: distinctµÄһЩÔÓ̸
distinctÕâ¸ö¹Ø¼ü×ÖÀ´¹ýÂ˵ô¶àÓàµÄÖظ´¼Ç¼ֻ±£ÁôÒ»Ìõ£¬µ«ÍùÍùÖ»Óà ËüÀ´·µ»Ø²»Öظ´¼Ç¼µÄÌõÊý£¬¶ø²»ÊÇÓÃËüÀ´·µ»Ø²»ÖؼǼµÄËùÓÐÖµ¡£ÆäÔ­ÒòÊÇdistinctÖ»ÓÐÓöþÖØÑ­»·²éѯÀ´½â¾ö£¬¶øÕâÑù¶ÔÓÚÒ»¸öÊý¾ÝÁ¿·Ç³£´óµÄÕ¾À´Ëµ£¬ÎÞÒÉÊÇ»áÖ±½ÓÓ°Ï쵽ЧÂʵġ£
ÏÂÃæÏÈÀ´¿´¿´Àý×Ó£º
table ......

ORACLEµÄALL_VIEWSÊý¾Ý×Öµätext×Ö¶ÎlongÀàÐÍÎÊÌâ

½ñÌìͬÊÂraiseÒ»¸öСÎÊÌ⣬ÔõôÔÚALL_VIEWSÊý¾Ý×Öµätext×ֶβéÕÒlrf×Ö·û´®£º
etl@DWTEST> select owner,view_name from all_views where instr(text,'lrf') > 0;
select owner,view_name from all_views where instr(text,'lrf') > 0
             ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ