|
¿ì¼± A, B ÀÌ µÎ °³ÀÇ DB¼¹ö´Â ¼·Î ¿¬°áµÇ¾î ÀÖ°í AA¶ó´Â Å×À̺íÀº µÎ °³ÀÇ DB¼¹ö¿¡ ¸ðµÎ Á¸ÀçÇÑ´Ù´Â °¡Á¤ÇÏ¿¡¼ ¸»¾¸µå¸®°Ú½À´Ï´Ù.
¿¬°áÀÌ ¾ÈµÇ¾î ÀÖ´Ù¸é export/import¸¦ ÀÌ¿ëÇÏ´Â °Íµµ ÇϳªÀÇ ¹æ¹ýÀÌ µÉ ¼ö ÀÖ½À´Ï´Ù.
±× ¿Ü¿¡´Â database link¸¦ ÀÌ¿ëÇÏ´Â ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù.
Database link¸¦ »ç¿ëÇÏ´Â ¹æ¹ýÀº, ¿ì¼± A¼¹ö¿¡¼ B¼¹ö·Î Á¢¼ÓÇÒ ¼ö ÀÖµµ·Ï A¼¹öÀÇ tnsnames.ora¿¡ connection stringÀ» Ãß°¡ÇØ¾ß ÇÕ´Ï´Ù. (¹°·Ð B¼¹öÀÇ listener°¡ ±âµ¿ÁßÀ̾î¾ß ÇÕ´Ï´Ù)
Ãß°¡µÈ connection stringÀÌ to_b_server¶ó°í Çϸé, ¾Æ·¡ÀÇ sql¹®À» »ç¿ëÇÏ¿© database link¸¦ ¸¸µé ¼ö ÀÖ½À´Ï´Ù
(CREATE PUBLIC DATABASE LINK link_to_b_server CONNECT TO <username> IDENTIFIED BY <password> USING ¡®to_b_server¡¯;)
ÁÖÀÇÇÒ Á¡Àº, À§ÀÇ database link¸¦ ¸¸µé±â À§Çؼ´Â ÇØ´ç user°¡ ±×¿¡ »óÀÀÇÑ privilege(CREATE DATABASE LINK)¸¦ °¡Á®¾ß ÇÕ´Ï´Ù.
Database linkÀÇ ÀÛ¼ºÀÌ ³¡³µ´Ù¸é, ±× ÀÌÈÄ¿¡´Â ÀÌ link¸¦ ÀÌ¿ëÇؼ B¼¹öÀÇ AAÅ×ÀÌºí¿¡ µé¾îÀÖ´Â µ¥ÀÌŸ¸¦ ´ÙÀ½°ú °°Àº ¹æ¹ýÀ¸·Î A¼¹öÀÇ AAÅ×ÀÌºí¿¡ ³ÖÀ» ¼ö ÀÖ½À´Ï´Ù.
(INSERT INTO AA SELECT * FROM AA@link_to_b_server)
|