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

ÀûÓÃoracle¿ìÕÕdblink½â¾öÊý¾Ý¿â±íͬ²½ÎÊÌâ

±¾ÊµÀýÒÑÍêȫͨ¹ý²âÊÔ,µ¥Ïò,ÓÖÏòͬ²½¶¼¿ÉʹÓÃ.
--Ãû´Ê˵Ã÷£ºÔ´——±»Í¬²½µÄÊý¾Ý¿â
            Ä¿µÄ——Ҫͬ²½µ½µÄÊý¾Ý¿â
Ç°6²½±ØÐëÖ´ÐÐ,µÚ6ÒÔºóÊÇһЩ¸¨ÖúÐÅÏ¢.
--1¡¢ÔÚÄ¿µÄÊý¾Ý¿âÉÏ£¬´´½¨dblink
drop public database link dblink_orc92_182;
Create public DATABASE LINK dblink_orc92_182 CONNECT TO bst114 IDENTIFIED BY password USING 'orc92_192.168.254.111';
--dblink_orc92_182 ÊÇdblink_name
--bst114 ÊÇ username
--password ÊÇ password
--'orc92_192.168.254.111' ÊÇÔ¶³ÌÊý¾Ý¿âÃû
--2¡¢ÔÚÔ´ºÍÄ¿µÄÊý¾Ý¿âÉÏ´´½¨ÒªÍ¬²½µÄ±í(×îºÃÓÐÖ÷¼üÔ¼Êø,¿ìÕղſÉÒÔ¿ìËÙË¢ÐÂ)
drop table test_user;
create table test_user(id number(10) primary key,name varchar2(12),age number(3));
--3¡¢ÔÚÄ¿µÄÊý¾Ý¿âÉÏ£¬²âÊÔdblink
select * from test_user@dblink_orc92_182;    //²éѯµÄÊÇÔ´Êý¾Ý¿âµÄ±í
select * from test_user;
--4¡¢ÔÚÔ´Êý¾Ý¿âÉÏ£¬´´½¨ÒªÍ¬²½±íµÄ¿ìÕÕÈÕÖ¾
Create snapshot log on test_user;
--5¡¢´´½¨¿ìÕÕ£¬ÔÚÄ¿µÄÊý¾Ý¿âÉÏ´´½¨¿ìÕÕ
Create snapshot sn_test_user as select * from test_user@dblink_orc92_182;
--6¡¢ÉèÖÿìÕÕË¢ÐÂʱ¼ä(Ö»ÄÜÑ¡ÔñÒ»ÖÖˢз½Ê½,ÍƼöʹÓÿìËÙË¢ÐÂ,ÕâÑù²Å¿ÉÒÔÓô¥·¢Æ÷Ë«Ïòͬ²½)
¿ìËÙË¢ÐÂ
Alter snapshot sn_test_user refresh fast Start with sysdate next sysdate with primary key;
--oracleÂíÉÏ×Ô¶¯¿ìËÙˢУ¬ÒÔºó²»Í£µÄË¢ÐÂ,Ö»ÄÜÔÚ²âÊÔʱʹÓÃ.ÕæʵÏîÄ¿ÒªÕýȷȨºâË¢ÐÂʱ¼ä.
ÍêÈ«Ë¢ÐÂ
Alter snapshot sn_test_user refresh complete Start with sysdate+30/24*60*60 next sysdate+30/24*60*60;
--oracle×Ô¶¯ÔÚ30Ãëºó½øÐеÚÒ»´ÎÍêȫˢУ¬ÒÔºóÿ¸ô30ÃëÍêÈ«Ë¢ÐÂÒ»´Î
--7¡¢ÊÖ¶¯Ë¢Ð¿ìÕÕ,ÔÚûÓÐ×Ô¶¯Ë¢ÐµÄÇé¿öÏÂ,¿ÉÒÔÊÖ¶¯Ë¢Ð¿ìÕÕ.
ÊÖ¶¯Ë¢Ð·½Ê½1
begin
dbms_refresh.refresh('sn_test_user');
end;
ÊÖ¶¯Ë¢Ð·½Ê½2
EXEC DBMS_SNAPSHOT.REFRESH('sn_test_user','F');  //µÚÒ»¸ö²ÎÊýÊÇ¿ìÕÕÃû,µÚ¶þ¸ö²ÎÊý F ÊÇ¿ìËÙˢРC ÊÇÍêÈ«Ë¢ÐÂ.
--8.Ð޸ĻỰʱ¼ä¸ñʽ
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';
--9.²é¿´¿ìÕÕ×îºóÒ»´ÎË¢ÐÂʱ¼ä
SELECT NAME,LAST_REFRESH from ALL_SNAPSHOT_REFRESH_TIMES;
--10.²é¿´¿ìÕÕÏ´ÎÖ´ÐÐʱ¼ä
select last_date,next_d


Ïà¹ØÎĵµ£º

oracle Óαê

oracle Óαê
¹Ø¼ü×Ö: oracle Óαê
1.       Óαê: ÈÝÆ÷£¬´æ´¢SQLÓï¾äÓ°ÏìÐÐÊý¡£
2.       ÓαêÀàÐÍ: ÒþʽÓα꣬ÏÔʾÓα꣬REFÓαꡣÆäÖУ¬ÒþʽÓαêºÍÏÔʾÓαêÊôÓÚ¾²Ì¬Óα꣨ÔËÐÐÇ°½«ÓαêÓëSQLÓï¾ä¹ØÁª£©,REFÓαêÊôÓÚ¶¯Ì¬Óαê(ÔËÐÐʱ½«ÓαêÓëSQLÓï¾ä¹ØÁª)¡ ......

oracleÖеIJ»¿É¼û×Ö·û

½ñÌì×öͳ¼ÆµÄʱºò·¢ÏÖÒ»¸öÊý¾Ý±íÃæÉÏ¿´À´ÊÇ‘920 ’µ«È¥¿Õ¸ñÎÞÂÒÈçºÎ¶¼È¥²»µô£¬×îºó·¢ÏÖÊDz»¿É¼û×Ö·û¡£¡£¡£
ÓÚÊÇÔÚÍøÉÏËѵ½Ò»ÆªÎÄÕ£¬ÈçºÎÀ´ÅжÏÕâ¸ö²»¿É¼û×Ö·ûµÄÎÊÌâ~
°´ÏÂÃæµÄ·½·¨Åжϳö²»¿É¼û×Ö·ûµÄascIIÂëÊÇ10£¬ÓÚÊÇÓÃrtrim('Ô­×Ö·û','chr(10)')À´È¥µôÕâ¸ö²»¿É¼û×Ö·û¡£
½ñÌìÓöµ½Ò»Ôò°¸Àý£¬ÎÊÌâÊÇÊý¾Ý¿âÖп ......

Oracle×Ö·û´®´¦Àíº¯Êý


Oracle×Ö·û´®´¦Àíº¯Êý
2008Äê10ÔÂ18ÈÕ ÐÇÆÚÁù 23:45
ÏîÄ¿ÖÐÓÐÉæ¼°´æ´¢¹ý³Ì¶Ô×Ö·û´®µÄ´¦Àí£¬ËùÒԾͽ«ÔÚÍøÉϲéÕÒµ½µÄ×ÊÁÏ»ã×Ü£¬×öÒ»¸öÐÅϢƴ½ÓʽµÄ×ܽᡣ
ÒÔÏÂÐÅÏ¢¾ùÀ´×Ô»¥ÁªÍø£¬Ìù³öÀ´Ò»Ôò×Ô¼º±£´æÒÔ´ýÒÔºóʹÓã¬Ò»Ôò¹©´ó¼Ò·ÖÏí¡£
×Ö·ûº¯Êý——·µ»Ø×Ö·ûÖµ
ÕâЩº¯ÊýÈ«¶¼½ÓÊÕµÄÊÇ×Ö·û×åÀàÐ͵IJÎÊý(CHR³ýÍâ)²¢ ......

ʹÓÃOracleÍⲿ±íµÄÎå¸öÏÞÖÆ

Íⲿ±íÊÇÖ¸²»ÔÚÊý¾Ý¿âÖÐµÄ±í£¬Èç²Ù×÷ϵͳÉϵÄÒ»¸ö°´Ò»¶¨¸ñʽ·Ö¸îµÄÎı¾Îļþ»òÕßÆäËûÀàÐÍµÄ±í¡£Õâ¸öÍⲿ±í¶ÔÓÚOracleÊý¾Ý¿âÀ´Ëµ£¬¾ÍºÃÏñÊÇÒ»ÕÅÊÓͼ£¬ÔÚÊý¾Ý¿âÖпÉÒÔÏñÊÔͼһÑù½øÐвéѯµÈ²Ù×÷¡£Õâ¸öÊÔͼÔÊÐíÓû§ÔÚÍⲿÊý¾ÝÉÏÔËÐÐÈκεÄSQLÓï¾ä£¬¶ø²»ÐèÒªÏȽ«Íⲿ±íÖеÄÊý¾Ý×°ÔؽøÊý¾Ý¿âÖС£²»¹ýÐèҪעÒâÊÇ£¬ÍⲿÊý¾Ý±í¶¼ÊÇÖ»¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ