Oracle ¿ìÕÕ¼° dblinkʹÓà £¨Á½Ì¨·þÎñÆ÷Êý¾Ýͬ²½£©
--Ãû´Ê˵Ã÷£ºÔ´——±»Í¬²½µÄÊý¾Ý¿â
-- Ä¿µÄ——Ҫͬ²½µ½µÄÊý¾Ý¿â
/*Ò»¡¢´´½¨dblink£º*/
--1¡¢ÔÚÄ¿µÄÊý¾Ý¿âÉÏ£¬´´½¨dblin
drop database link dblink_anson;
Create public
database link dblink_anson
Connect to lg identified by lg using 'SDLGDB';
--Ô´Êý¾Ý¿âµÄÓû§Ãû¡¢ÃÜÂë¡¢·þÎñÆ÷Ãûk
/*¶þ¡¢´´½¨¿ìÕÕ£º*/
--1¡¢ÔÚÔ´ºÍÄ¿µÄÊý¾Ý¿âÉÏͬʱִÐÐÒ»ÏÂÓï¾ä£¬´´½¨Òª±»Í¬²½µÄ±í
drop table tb_anson;
create table tb_anson(c1 varchar2(12));
alter table tb_anson add constraint pk_anson primary key (C1);
--2¡¢ÔÚÄ¿µÄÊý¾Ý¿âÉÏ£¬²âÊÔdblink
select * from tb_anson@dblink_anson;
select * from tb_anson;
--3¡¢ÔÚÄ¿µÄÊý¾Ý¿âÉÏ£¬´´½¨ÒªÍ¬²½±íµÄ¿ìÕÕÈÕÖ¾
Create snapshot log on tb_anson;
--4¡¢´´½¨¿ìÕÕ£¬¿ìÕÕ(±»Í¬²½£¨Ô´£©Êý¾Ý¿â·þÎñ±ØÐëÆô¶¯)
Create snapshot sn_anson as select * from tb_anson@dblink_anson;
--5¡¢ÉèÖÿìÕÕË¢ÐÂʱ¼ä
Alter snapshot anson refresh fast Start with sysdate+1/24*60 next sysdate+10/24*60;
--oracle×Ô¶¯ÔÚ1·ÖÖÓºó½øÐеÚÒ»´Î¿ìËÙˢУ¬ÒÔºóÿ¸ô10·ÖÖÓ¿ìËÙË¢ÐÂÒ»´Î
Alter snapshot anson refresh complete Start with sysdate+30/24*60*60 next sysdate+1;
--oracle×Ô¶¯ÔÚ30³®ºó½øÐеÚÒ»´ÎÍêȫˢУ¬ÒÔºóÿ¸ô1ÌìÍêȫˢÐÂÒ»´Î
--6¡¢ÊÖ¶¯Ë¢Ð¿ìÕÕ
begin
dbms_refresh.refresh('"CS"."SN_ANSON"');
end;
Ïà¹ØÎĵµ£º
Create directoryÈÃÎÒÃÇ¿ÉÒÔÔÚOracleÊý¾Ý¿âÖÐÁé»îµÄ¶ÔÎļþ½øÐжÁд²Ù×÷£¬¼«´óµÄÌá¸ßÁËOracleµÄÒ×ÓÃÐԺͿÉÀ©Õ¹ÐÔ¡£
ÆäÓ﷨Ϊ:
create or replace directory exp_dir as '/tmp';
Ŀ¼´´½¨ÒԺ󣬾ͿÉÒ԰ѶÁдȨÏÞÊÚÓèÌØ¶¨Óû§£¬ÀýÈç:
grant read, write on directory exp_dir to eygle;
´ËʱÓû§eygle¾ÍÓµÓÐÁ˶ԸÃĿ¼µÄ¶ ......
Íⲿ±í×÷ÓÃ:¼ÓÔØºÍÐ¶ÔØÊý¾Ý
Íⲿ±í¶¼ÊÇÖ»¶Á±í,²»ÄܽøÐÐupdate,insert,delete²Ù×÷.
Oracle ÌṩÁ½ÖÖ·ÃÎÊÇý¶¯: ORACLE_LOADER, ORACLE_DATAPUMP(oracle 10.2ºóÐÂÔöµÄÇý¶¯)
ORACLE_LOADER: ËüÀûÓÃoracle loader¼¼Êõ´ÓÍⲿ±í¶ÁÈ¡Êý¾Ý. Ëü»¹¾ßÓÐÀàËÆSQL*Loader¹¤¾ß¿ØÖÆÎļþÓï·¨µÄÊý¾ÝÓ³ÉäÄÜÁ¦.
ORACLE_DAT ......
ɾ³ýÊý¾Ý¿â£º
1¡¢Í£Ö¹Êý¾Ý¿â·þÎñ
2¡¢É¾³ýʵÀý oradim –delete –sid liluf
3¡¢É¾³ýÊý¾Ý¿âÎļþ
ÐÂÔöÊý¾Ý¿â£º
1¡¢ ½¨Á¢Êý¾Ý¿â¡¢ÅäÖüàÌý¡¢½¨Á¢Óû§
2¡¢ ÓÃÃüÁîÆô¶¯Êý¾Ý¿â
×¢:×¢²á±íregedit HKEY_LOCAL_MACHINE&sh ......
oracleȨÏÞÌåϵÖÐÓиödefault role£¬±È½ÏÄÑÒÔÀí½â¡£ÏÂÃæÓÃʵÀý˵Ã÷Ò»ÏÂ×÷Óá£
ÎÒÃÇ¿ÉÒÔ¸øÄ³¸öÓû§·ÖÅäһЩ½ÇÉ«£¬±ÈÈçrole r1,r2,r3,r4£¬¶øÆäÖпÉÒÔ½«Ä³Ð©½ÇÉ«±ÈÈçr1ÉèÖÃΪdefault role£¬ÆäËûµÄ²»ÉèÖóÉdefault role£¬ÕâÑù£¬µ±¸ÃÓû§µÇ¼ʱ£¬×Ô¶¯¾ßÓÐdefault roleÖÐËù°üº¬µÄȨÏÞ£¬ÆäËûµÄ½ÇÉ«Ëù¾ßÓеÄȨÏÞҪͨ¹ýset role ½ÇÉ ......