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

Oracle SQL Óï¾ä¶Ôʱ¼ä²Ù×÷µÄ×ܽá

ÔÚSQLÓï¾äÖУ¬³£³£Óûá¶Ôʱ¼ä£¨»òÈÕÆÚ£©½øÐÐһЩ´¦Àí£¬ÏÂÃæÊDZȽÏͨÓõÄһЩÓï¾ä£º
ÑÓ³Ù£º
sysdate+(5/24/60/60)          ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ãë
sysdate+5/24/60               ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5·ÖÖÓ
sysdate+5/24                  ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Сʱ
sysdate+5                     ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ìì
add_months(sysdate,-5)        ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5ÔÂ
add_months(sysdate,-5*12)     ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Äê
ÉÏÔÂÄ©µÄÈÕÆÚ£º
select last_day(add_months(sysdate, -1)) from dual;
±¾ÔµÄ×îºóÒ»Ã룺
select trunc(add_months(sysdate,1),'MM') - 1/24/60/60 from dual
±¾ÖÜÐÇÆÚÒ»µÄÈÕÆÚ£º
select trunc(sysdate,'day')+1 from dual
Äê³õÖÁ½ñµÄÌìÊý£º
select ceil(sysdate - trunc(sysdate, 'year')) from dual;
½ñÌìÊǽñÄêµÄµÚ¼¸ÖÜ :
select to_char(sysdate,'fmww') from dual
½ñÌìÊDZ¾Ôµĵڼ¸ÖÜ:
SELECT TO_CHAR(SYSDATE,'WW') - TO_CHAR(TRUNC(SYSDATE,'MM'),'WW') + 1 AS "weekOfMon" from dual
±¾ÔµÄÌìÊý
SELECT to_char(last_day(SYSDATE),'dd') days from dual
½ñÄêµÄÌìÊý
select add_months(trunc(sysdate,'year'), 12) - trunc(sysdate,'year') from dual
ϸöÐÇÆÚÒ»µÄÈÕÆÚ
SELECT Next_day(trunc(SYSDATE),'monday') from dual
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
¼ÆË㹤×÷ÈÕ·½·¨
create table t(s date,e date);
alter session set nls_date_format = 'yyyy-mm-dd';
insert into t values('2003-03-01','2003-03-03');
insert into t values('2003-03-02','2003-03-03');
insert into t values('2003-03-07','2003-03-08');
insert into t values('2003-03-07','2003-03-09');
insert into t values('2003-03-05','2003-03-07');
insert into t values('2003-02-01','2003-03-31');
-- ÕâÀï¼Ù¶¨ÈÕÆÚ¶¼ÊDz»´øʱ¼äµÄ£¬·ñÔòÔÚËùÓÐÈÕÆÚÇ°¼Ótrunc¼´¿É¡£


Ïà¹ØÎĵµ£º

¡¾×ª¡¿oracle ȨÏÞ¹ÜÀíÏà¹ØÃüÁî

Ò»¡¢ÏµÍ³µÄĬÈÏÓû§
Java´úÂë
sys;//ϵͳ¹ÜÀíÔ±£¬ÓµÓÐ×î¸ßȨÏÞ     
system;//±¾µØ¹ÜÀíÔ±£¬´Î¸ßȨÏÞ     
scott;//ÆÕͨÓû§£¬ÃÜÂëĬÈÏΪtiger,ĬÈÏδ½âËø  
¶þ¡¢µÇ½
Java´úÂë
sqlplus conn / as sysdba;//µÇ½sysÕÊ»§     ......

OracleÓû§¹ÜÀí

 Ò»£¬OracleÊý¾Ý¿âÓû§¼ò½é
 ÔÚOracleÊý¾Ý¿âÖÐÈκζÔÏó¶¼ÊôÓÚÒ»¸öÌض¨Óû§£¬»òÕß˵һ¸öÓû§ÓëͬÃûµÄģʽÏà¹ØÁª¡£
 ÒªÁ¬½Óµ½OracleÊý¾Ý¿âÐèÒªÒ»¸öÓû§ÕÊ»§£¬¸ù¾ÝÐèÒªÊÚÓèµÄ²Ù×÷ȨÏÞ¡£
 1£¬Ä¬ÈÏÊý¾Ý¿âÓû§Ä£Ê½£º
  Sys:Êý¾Ý¿â×ֵ䣨´æ´¢±»¹ÜÀí¶ÔÏóËùÓÐÐÅÏ¢£©ºÍÊÓͼ´æ´¢ÔÚ¸ÃģʽÖС£ÏµÍ³¼¶Óû§¡£ ......

Oracle ±í¿Õ¼ä»ù±¾²Ù×÷

 
1. ²éѯÊý¾Ý¿âÏÖÔڵıí¿Õ¼ä
select tablespace_name, file_name, sum(bytes)/1024/1024 table_size from dba_data_files group by tablespace_name,file_name;
 
2. ½¨Á¢±í¿Õ¼ä
CREATE TABLESPACE data01 DATAFILE '/oracle/ ......

OracleµÄOpenWorld:ÁªÊÖSun¶ÔÕ½IBM

 ½ñÄêµÄOracleÈ«Çò´ó»áÓÚ10ÔÂ11ÈÕ£­15ÈÕÔÚÃÀ¹ú¾É½ðɽµÄMosconeÖÐÐÄÒѾ­À­¿ªÐòÄ»ÁË¡£
¡¡¡¡ Oracle¶ÔSun¹«Ë¾µÄ³¤Æڼƻ®ÎÞÒÉÊDZ¾´ÎOOW´ó»áµÄ½¹µã¡£µ«ÔÚ̸ÂÛÕâ¸ö»°Ìâ֮ǰ£¬ÎÒÃÇ×¼±¸ÁËÒ»×é´ó»áµÄÓÐȤÊý¾Ý£¬ÏÈÈôó¼Ò¶Ô±¾´Î´ó»áÓиöÕûÌåµÄÓ¡Ïó¡£
¡¡¡¡ÓйØÕû¸ö´ó»áµÄÊý×Ö£º
¡¡¡¡· ½ü4.3ÍòÈ˵½»á
¡¡¡¡· ΪÃÀ¹ ......

oracle 10 em

Ò»¡¢Enterprise Manager 10g
ĬÈÏÇé¿öÏ£¬°²×°Oracleʱ£¬»á°²×°EM¡£ËüÊÇλÓÚÊý¾Ý¿â·þÎñÆ÷ÉϵÄHTTP·þÎñÆ÷¡£
£¨1£©Æô¶¯EM
Ҫȷ±£OracleDBConsole<SID>·þÎñÒѾ­Æô¶¯¡£
Æô¶¯·þÎñ£ºemctl start dbconsole
¹Ø±Õ·þÎñ£ºemctl stop dbconsole
·ÃÎÊEM£ºhttp://·þÎñÆ÷Ãû³Æ£º¶Ë¿ÚºÅ/em
¶Ë¿ÚºÅ¿ÉÔÚ$ORACLE_HOME/install/pro ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ