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

¹ØÓÚORACLEʱÇøÎÊÌâ

 ÎÒÃǵijɹ¦×ÜÊÇÕ¾ÔÚ¾ÞÈ˵ļç°òÉÏÎÒ£¬ÏÈתÁ˱ðÈ˾­Ñ飬×îºóÔÙ×ܽá×Ô¼ºµÄʵÑé½á¹û£¬Ñ§Ï°²ÅÄÜÓнø²½£¡
OracleµÄʱÇøÎÊÌâ
Oracle 9i ¿ªÊ¼¶àÁË 3 ¸ö¹ØÓÚʱ¼äµÄÊý¾ÝÀàÐÍ£ºTIMESTAMP [(precision)] TIMESTAMP [(precision)] WITH TIME ZONE TIMESTAMP [(precision)] WITH LOCAL TIME ZONE£¬ÆäÖÐ TIMESTAMP [(precision)] WITH TIME ZONE ±£´æÁËʱÇøÐÅÏ¢¡£
1. Oracle µÄʱÇøÉèÖÃ
 
    Oracle µÄʱÇø¿ÉÒÔ·ÖΪÁ½ÖÖ£¬Ò»ÖÖÊÇÊý¾Ý¿âµÄʱÇø£¬Ò»ÖÖÊÇ session ʱÇø£¬Ò²¾ÍÊÇ¿Í»§¶ËÁ¬½ÓʱµÄʱÇø£¨¾­¹ýʵÑ飬Á¬½ÓÒÔºóÔÙÐ޸Ŀͻ§¶ËµÄʱÇø£¬session µÄʱÇø²»»á¸ü¸Ä£©¡£
 
    Êý¾Ý¿âµÄʱÇøÔÚ´´½¨Êý¾Ý¿âʱ¿ÉÒÔͨ¹ýÔÚ create database Óï¾äÖмÓÉÏ SET TIME_ZONE = ' { { + | - } hh : mi | time_zone_region } ' À´Ö¸¶¨£¬Èç¹û£¬²»Ö¸¶¨£¬Ä¬ÈÏÊÇ°´ÕÕÊý¾Ý¿âËùÔڵIJÙ×÷ϵͳʱÇøÀ´É趨µÄ¡£´´½¨Ö®ºó£¬¿ÉÒÔͨ¹ý alter database À´Ð޸ġ£ÆäÖÐ time_zone_region ²ÎÊý¿ÉÒÔͨ¹ý²éѯ V$TIMEZONE_NAMES ¶¯Ì¬ÊÓͼÀ´»ñµÃËùÓÐÖ§³ÖµÄÖµ¡£ÐÞ¸ÄÖ®ºó£¬ÐèÒªÖØÆôÊý¾Ý¿â²ÅÄÜÉúЧ¡£¾­³£ÓÐÈË»áÅöµ½ÎÞ·¨Ð޸ĵÄÇé¿ö£º
 
SQL> alter database set time_zone='+06:00';
alter database set time_zone='+06:00'
*
ERROR at line 1:
ORA-02231: missing or invalid option to ALTER DATABASE
 
    TOM ¶Ô´ËÎÊÌâÓйý½âÊÍ£¬TIME_ZONE µÄÉ趨Ö÷ÒªÊÇΪÁË WITH LOCAL TIME ZONE£¬µ± session µÄʱÇøºÍÊý¾Ý¿âµÄʱÇø²»Í¬Ê±£¬oracle ¸ù¾ÝʱÇøµÄ²î¾àת»»µ½Êý¾Ý¿âµÄʱ¼ä£¬ÔÙ±£´æµ½Êý¾Ý¿âµÄ WITH LOCAL TIME ZONE ÀàÐÍÖУ¬ËûÊDz»±£´æʱÇøµÄ£¬ËùÒÔÐèÒª TIME_ZONE À´½øÐи÷ÖÖʱÇøÖ®¼äʱ¼äµÄת»»£¨WITH TIME ZONE ÀàÐͱ£´æÁËԭʼµÄʱÇø£¬ËùÒÔ²»ÐèÒª TIME_ZONE µÄÉèÖÃÒ²¿ÉÒÔ½øÐи÷ÖÖʱÇøÖ®¼äµÄת»»£©¡£µ«Êý¾Ý¿âÖÐÒ»µ©ÓÐÁ˸ÃÀàÐÍ£¬¾Í²»ÄÜͨ¹ý alter database ÐÞ¸ÄʱÇøÁË£¬»áµÃµ½ÉÏÃæµÄ´íÎ󣬿ÉÒÔͨ¹ýÏÂÃæµÄÓï¾ä»ñµÃËùÓаüº¬¸ÃÀàÐÍµÄ±í£¬½«ËûÃÇɾ³ýÖ®ºó£¬ÔÙÐ޸ġ£
 
select u.name || '.' || o.name || '.' || c.name TSLTZcolumn
  from sys.obj$ o, sys.col$ c, sys.user$ u
where c.type# = 231
   and o.obj# = c.obj#
   and u.user# = o.owner#;
(Ò»°ã²éѯºóµÄ½á¹ûΪ£ºOE.ORDERS.ORDER_DATE£¬Ö¸µÄÊÇOEÓû§ÏµÄORDERS±íµÄORDER_DATE×Ö¶ÎʹÓÃÁËʱÇøµÄÐÅÏ¢£ºWITH LOCAL TIME ZONE£¬½«


Ïà¹ØÎĵµ£º

oracle ÐÐתÁеÄͨÓùý³Ì

 Ô­ÎÄ´«ËÍÃÅ£ºhttp://topic.csdn.net/u/20091019/11/67cd55a3-3f42-4db7-a3f8-91dd52a913cd.html?24122
¾­³£Óöµ½·¢ÌûÇóÐÐÁÐת»»µÄ´úÂ룬ÓÃmax(decode(..))»Ø¸´ºó£¬Ê®Óа˾ŻáÔÙÎÊÒ»¾ä£ºÈç¹ûÁÐÃû²»¹Ì¶¨£¬»òÕßÁÐÊý²»¹Ì¶¨Ôõô°ì¡£¾ÍÒªÓô洢¹ý³ÌÀ´Ð´£¬ÕâЩ´æ´¢¹ý³ÌµÄ´úÂ붼´óͬСÒ죬ÎÒ¾ÍÏëÄܲ»ÄÜд¸öͨÓõãµÄ¹ý³Ì
ÊÔÁ ......

Oracle¿ØÖÆÎļþ³£ÓòÙ×÷

ÏÞÖÆ¿ØÖÆÎļþµÄ´óС
a.)²éѯ¿É¸´Óò¿·ÖµÄ±£´æÌìÊý(²»ÄÜÖ±½Ó¿ØÖÆ´óС,±£´æÌìÊýÔ½´óÊý¾ÝÔ½¶à)
SELECT name,value from v$parameter WHERE name = 'control_file_record_keep_time';

b.)ÉèÖÿɸ´Óò¿·Ö±£´æʱ¼ä
ALTER SYSTEM SET CONTROL_FILE_RECORD_KEEP_TIME = 14;
......

ORACLE 10g Öлָ´ÒÑɾ³ýµÄ±í_flashback


-- ±Ê¼ÇÖв¿·ÖÄÚÈÝ
SQL> create table tt2 as select * from employee;
Table created.
SQL> drop table tt2;
Table dropped.
SQL> select * from tt2;
select * from tt2
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> flashback table tt2 to before drop;
Flashback comp ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ