¡¡¡¡ÎïÀíÉÏ´æ·ÅÓÚÍøÂçµÄ¶à¸öORACLEÊý¾Ý¿â£¬Âß¼ÉÏ¿ÉÒÔ¿´³ÉÒ»¸öµ¥¸öµÄ´óÊý¾Ý¿â¡£Óû§¿ÉÒÔͨ¹ýÍøÂç¶ÔÒìµØÊý¾Ý¿âÖеÄÊý¾Ýͬʱ½øÐдæÈ¡£¬¶ø·þÎñÆ÷Ö®¼äµÄÐͬ´¦Àí¶ÔÓÚ¹¤×÷Õ¾Óû§¼°Ó¦ÓóÌÐò¶øÑÔÊÇÍêȫ͸Ã÷µÄ£º¿ª·¢ÈËÔ±ÎÞÐè¹ØÐÄÍøÂçµÄÁ´½Óϸ½Ú¡¢ÎÞÐè¹ØÐÄÊý¾ÝÔÚÍøÂç½ÓµãÖеľßÌå·Ö²¼Çé¿ö¡¢Ò²ÎÞÐè¹ØÐÄ·þÎñÆ÷Ö®¼äµÄе÷¹¤×÷¹ý³Ì¡£
¡¡¡¡Êý¾Ý¿âÖ®¼äµÄÁ´½Ó½¨Á¢ÔÚDATABASE LINKÉÏ¡£Òª´´½¨Ò»¸öDB LINK£¬±ØÐëÏÈÔÚÿ¸öÊý¾Ý¿â·þÎñÆ÷ÉÏÉèÖÃÁ´½Ó×Ö·û´®¡£
¡¡¡¡ ÀýÈ磬ÉîÛÚSUNƽ̨ORACLEÊý¾Ý¿â£¬ÔÚ/var/opt/oracle/tnsnames.oraÖÐÓÐÒÔÏÂ
¡¡¡¡Ò»ÌõºÍ±±¾©µÄÊý¾Ý¿âÁ´½Ótobeijing£¬¸ñʽÈçÏ£º
Á´½Ó×Ö·û´®µÄÉèÖà ¡¡¡¡ ˵ ¡¡¡¡¡¡Ã÷
tobeijing=(description= database linkÃû³Æ£ºtobeijing
(address=(protocol=tcp) ²ÉÓÃtcp/ipÐÒé
(host=www.bj.col.com.cn) ÓûÁ´½ÓÖ÷»úÃû³Æ»òIPµØÖ·
(port=1521)) ÍøÂç¶Ë¿Ú1521
(connect_data=(sid=oracle7))) °²×°ORACLE²ÉÓõÄsid
¡¡¡¡È»ºó½øÈëϵͳ¹ÜÀíÔ±SQL>²Ù×÷·ûÏ£¬ÔËÐÐÃüÁ
¡¡¡¡SQL>create public database link beijing connect to scott identified by tiger
¡¡¡¡using 'tobeijing';
¡¡¡¡Ôò´´½¨ÁËÒ»¸öÒÔscottÓû§ºÍ±±¾©Êý¾Ý¿âµÄÁ´½Óbeijing£¬ÎÒÃDzéѯ±±¾©µÄscottÊý¾Ý:
¡¡¡¡SQL>select * from emp@beijing;
¡¡¡¡ÕâÑù¾Í¿ÉÒÔ°ÑÉîÛںͱ±¾©scottÓû§µÄÊý¾Ý×ö³ÉÒ»¸öÕûÌåÀ´´¦Àí¡£
¡¡¡¡ÎªÁËʹÓйطֲ¼Ê½²Ù×÷¸ü͸Ã÷£¬ORACLEÊý¾Ý¿âÀïÓÐͬÒå´ÊµÄ¶ÔÏósynonym
¡¡¡¡SQL>create synonym bjscottemp for emp@beijing;
¡¡¡¡ÓÚÊǾͿÉÒÔÓÃbjscottempÀ´Ìæ´ú´ø@·ûºÅµÄ·Ö²¼Ê½Á´½Ó²Ù×÷emp@beijing¡£
¡¡¡¡²é¿´ËùÓеÄÊý¾Ý¿âÁ´½Ó£¬½øÈëϵͳ¹ÜÀíÔ±SQL>²Ù×÷·ûÏ£¬ÔËÐÐÃüÁ
¡¡¡¡SQL>select owner,object_name from dba_objects where object_type='DATABASE LINK';
¡¡¡¡½¨ORACLE¿ìÕÕÈÕÖ¾£º
¡¡¡¡SQL>create snapshot log on table3 with primary key;
¡¡¡¡½¨¿ìÕÕ£º
¡¡¡¡SQL>create snapshot table3beijing¡¡refresh force start with sysdate
¡¡¡¡next sysdate+1/24 with primary key as select * from table3@beijing;
¡¡¡¡ORACLEµÄ¿ìÕÕˢз½Ê½refreshÓÐÈýÖÖ:
fast ¿ìËÙˢУ¬ÓÃsnapshot log£¬Ö»¸üÐÂʱ¼ä¶Î±ä¶¯²¿·Ö
complete ÍêȫˢУ¬ÔËÐÐSQLÓï¾ä
force ×Ô¶¯ÅжÏˢУ¬½éÓÚfastºÍcompleteÖ®¼ä