ÀûÓÃ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,ne
Ïà¹ØÎĵµ£º
1¡¢ÔÚ±¾»ú69ÉÏ´´½¨Êý¾Ý¿âorcl £¬global_name=orcl£¬Ê¹ÓÃÓï¾ä
alter database rename global_name to orcl.us.oracle.com ÐÞ¸ÄÊý¾Ý¿âµÄÈ«¾ÖÊý¾Ý¿âÃûΪorcl.us.oracle.com
2¡¢ÔÚÐé»ú188ÉÏ´´½¨Êý¾Ý¿âviotest£¬global_name=viotest£¬Ê¹ÓÃÓï¾ä
alter database rename global_name to viotest.us.oracle.com ÐÞ¸ÄÊý¾Ý¿âµÄÈ«¾ÖÊ ......
¾ßÌå²½Öè¾Í²»¶à˵ÁË £¬Òªµ¼³öµÄSQLSERVER±í½Ð LDJCUS£¬Ö÷¼ü Uid (int ×Ô¶¯Ôö³¤ÁÐ)£¬µ¼Èëµ½Oracle×ܱ¨´í£º¶ÔÏóÃûÎÞЧ £¬È¥µôÖ÷¼üÁоͿÉÒÔ£¬²»ÖªµÀΪʲô£¿ÄѵÀ×Ô¶¯Ôö³¤µÄÖ÷¼üÁоͲ»Äܵ¼Èëµ½OracleÖУ¿£¿£¿Òɻ󡣡£¡£¡£ ......
¡¡1. /*+ALL_ROWS*/
¡¡¡¡±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯.
¡¡¡¡ÀýÈç:
¡¡¡¡SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO='SCOTT';
¡¡¡¡2. /*+FIRST_ROWS*/
¡¡¡¡±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÏìӦʱ¼ä,ʹ×ÊÔ´ÏûºÄ×îС»¯.
¡¡¡¡ÀýÈç ......
Oracle ·þÎñ½ø³Ì-¼òµ¥½éÉÜ
ÒÔOrcale10gµÄ°æ±¾ÎªÀý£¬¼òµ¥½éÉÜÏÂOracleµÄ·þÎñ½ø³Ì£¨Windows°æ±¾£© -ganlan¡£
1¡¢OracleCSService
½ø³Ì£ºocssd.exe
½éÉÜ£ºCluster Synchronization Services (CSS)—Manages the cluster configuration by controlling which nodes are members of the cluster an ......
OracleʵÏÖ×ÔÔöÖ÷¼ü
oracleûÓÐORACLE×ÔÔö×Ö¶ÎÕâÑùµÄ¹¦ÄÜ£¬µ«ÊÇͨ¹ý´¥·¢Æ÷(trigger)ºÍÐòÁÐ(sequence)¿ÉÒÔʵÏÖ¡£
create table t_client (id number(4) primary key,
pid number(4) not null,
name varchar2(30) not null,
client_id varchar2(10),
client_level char(3),
bank_acct_no varchar2(30),
contact_tel&n ......