DB2 תOracle
DB2 תOracle
ijÌìÊÇÐÇÆÚ¼¸µÄº¯Êý
DB2:
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and a.ksdm=10000 order by abs( a.daynum -DAYOFWEEK(current date)+1) desc,a.daynum,a.zblb
sql.executeQuery:ORA-00936: ȱʧ±í´ïʽ
Oracle :
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and a.ksdm=10000 order by abs( a.daynum -to_char(sysdate,'D')+1) desc,a.daynum,a.zblb
to_char ºÍto_dateµÄÓ÷¨
DB2:
select count(*) as yyrs from zy_zzd where zblb=2 and zzys=10000 and zzrq >='2009-08-21 00:00:00' and zzrq <='2009-08-21 23:59:59' and -DAYOFWEEK(current date)-1=2
Oracle :
select count(*) as yyrs from zy_zzd where zblb=2 and zzys=10000 and zzrq >=to_date('2009-08-21 00:00:00','yyyy-mm-dd hh24:mi:ss') and zzrq <=to_date('2009-08-21 23:59:59','yyyy-mm-dd hh24:mi:ss') and to_char(zzrq,'D')-1=2
ZCJGMC£¬ZRJGMC£¬SHYSMC£¬ZRKSMC£¬CARDID£¬ZCKSMC
Ïà¹ØÎĵµ£º
Ò». ¸ÅÊö
¡¡¡¡Oracle´æ´¢¹ý³Ì¿ª·¢µÄÒªµãÊÇ£º
¡¡¡¡• ʹÓÃNotepadÎı¾±à¼Æ÷£¬ÓÃOracle PL/SQL±à³ÌÓïÑÔдһ¸ö´æ´¢¹ý³Ì;
¡¡¡¡• ÔÚOracleÊý¾Ý¿âÖд´½¨Ò»¸ö´æ´¢¹ý³Ì;
¡¡¡¡• ÔÚOracleÊý¾Ý¿âÖÐʹÓÃSQL*Plus¹¤¾ßÔËÐд洢¹ý³Ì;
¡¡¡¡• ÔÚOracleÊý¾Ý¿âÖÐÐ޸Ĵ洢¹ý³Ì;
¡¡¡¡• ͨ¹ý±àÒë´íÎóµ÷ÊÔ´æ´ ......
ÔÚSQLÓï¾äÓÅ»¯¹ý³ÌÖУ¬ÎÒÃǾ³£»áÓõ½hint,ÏÖ×ܽáÒ»ÏÂÔÚSQLÓÅ»¯¹ý³ÌÖг£¼ûOracle HINTµÄÓ÷¨£º
1. /*+ALL_ROWS*/
±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯.
ÀýÈç:
SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO=’SCOTT’;
2. /*+FIRST_ROWS*/
±í ......
http://tianzt.blog.51cto.com/459544/171759
´ËÎÄ´ÓÒÔϼ¸¸ö·½ÃæÀ´ÕûÀí¹ØÓÚ·ÖÇø±íµÄ¸ÅÄî¼°²Ù×÷:
1.±í¿Õ¼ä¼°·ÖÇø±íµÄ¸ÅÄî
2.±í·ÖÇøµÄ¾ßÌå×÷ÓÃ
3.±í·ÖÇøµÄÓÅȱµã
&nbs ......
http://www.ej38.com/showinfo/Oracle-108709.html
Oracle 10g statisticÊý¾Ýͳ¼Æ,Oracle»á¸ù¾ÝÕâЩͳ¼ÆÐÅÏ¢À´¾ö¶¨ÊÇ×ßRBO(Rule-BasedOptimization)£¬»¹ÊÇ×ßCBO(Cost-BasedOptimization)£¬»áȥѡÔñÄÄÖÖÖ´Ðмƻ®¸ü»®Ëã,Ó°ÏìÊÇ·ñ×ßÏà¹ØµÄË÷ÒýµÈ.Èç¹ûÊÇCBOµÄ»°£¬ËüÒÀ¿¿×¼È·µÄ£¨»òÕß˵±È½Ï׼ȷµÄ£©Í³¼ÆÐÅÏ¢À´²úÉúÓÅ»¯µÄÖ ......
http://episode.javaeye.com/blog/183016
±í¿Õ¼ä£º
OracleµÄUNDOTBS01.DBFÎļþÌ«´óµÄ½â¾ö°ì·¨
1¡¢.½ûÖ¹undo tablespace×Ô¶¯Ôö³¤
alter database datafile 'full_path\undotbs01.dbf' autoextend off;
2.-- ´´½¨Ò»¸öеÄС ......