|
DataBase Link
»ç¿ë ÀÌÀ¯
. ºÐ»êDB¹× »õ·Î¿î DB µµÀԽà ±âÁ¸ system°ú ÇÕÄ¥떄»ç¿ëÇÑ´Ù.
DB¸µÅ© »çÀüÁغñ
.Oracle Instance 2°³ÀÌ»ó
.°¢±â´Ù¸¥ Platform¿¡¼ ¿î¿ë
.Host Name¹× Oracle SID´Â ´Ù¸£°í *NLS_Character SETÀº µ¿ÀÏ ¼³Á¤µÇ¾î¾ßÇÑ´Ù..
(NLS_¡¦¼³Á¤ÀÌ ´Ù¸£°Ô µÇ¾îÀÖÀ»½Ã µ¥ÀÌÅÍ Ãâ·Â½Ã ¡®?¡¯ ÀÌ·±°ÍÀ¸·Î Ãâ·ÂµÈ´Ù..
ex)
server a ¿¡¼ server b ¿¡ ÀÖ´Â DATA¸¦ DBLink·Î select ¹× viewÀÛ¼º¹ý
Server a server b
Hostname SERA SERB
Oracle_SID SIDA SIDB
1) Server A -> Server b ·Î DBLINK»ý¼º
SYSTEM»ç¿ëÀÚ·Î ·Î±ä
(SQL*NetÀÌ V1À» Áö¿øÇÏ´Â °æ¿ì)
SQL> create public database link A_TO_B using 't:SERB:SIDB'
ÀÌ·¸°Ô »ý¼ºµÈ dblink´Â °¢ user°¡ »ç¿ëÇÏ´Â ½ÃÁ¡¿¡ ÇØ´ç username, password¸¦ °¡Áö°í
remote database¿¡ Á¢¼ÓÀ» ½ÃµµÇÏ°Ô µË´Ï´Ù.
¸¸¾à ƯÁ¤ ID·Î Á¢¼Ó½ÃµµÇϱâ À§Çؼ±..
SQL> create public database link A_TO_B connect to °èÁ¤ID identified by ¾ÏÈ£ using 't:SERB:SIDB';
(*¸¸¾àQL*Net V2¸¦ »ç¿ëÇÑ´Ù¸é CONNECT STRING(*t:SERB:SIDB*)¿¡ TNSNAMES.ORAÀÇ SERVICE¸íÀ» ¹Ù·Î »ç¿ëÇÕ´Ï´Ù.(Oracle¹öÁ¯ 7.3ºÎÅÍ´Â SQL*NetÀÌ V2¸¸ Áö¿ø ÇϹǷΠSERVICE¸íÀ» ÀÌ¿ëÇؼ¸¸ ¸¸µé¾î¾ß ÇÕ´Ï´Ù.))
2) Server B¿¡ ÀÖ´Â TableÀÇ Select ¹× viewÀÛ¼º
. SQL> create view emp_view as select * from emp@A_TO_B XXX
where XXX.deptno = 10;
¿©±â¼ XXX ´Â ALIAS ÀÔ´Ï´Ù
3) SERVER-A ¿¡¼ µ¿ÀǾ »ý¼ºÇÏ¿© »ç¿ë ÇÏ´Â °æ¿ì
SQL> create synonym emp for emp@A_TO_B;
SQL> select * from emp; ·Î ÇÑ´Ù¸é °£´ÜÈ÷ ºÐ»ê DBÀÇ È¯°æ¿¡¼ »ç¿ëÇÒ¼ö ÀÖ½À´Ï´Ù.
(´Ü SERVER TO SERVER·Î NETWORK ȯ°æÀÌ ±¸ÃàµÇ¾î ÀÖ¾î¾ß ÇÕ´Ï´Ù.)
*NLS_CHARACTER_SET˼?
µ¥ÀÌÅͺ£À̽ºÀÇ ¹®ÀÚ¼ÂÀ̹«¾ùÀÎÁö¸¦³ªÅ¸³À´Ï´Ù. NLS_CHARACTER_SET¿¡´Â WE8MSWIN1252, KO16LOS5601, USASCII µîµîÀÌ ÀÖ½À´Ï´Ù. ÇÑ±Û À©µµ¿ì¿¡¼ ¿À¶óŬÀ» µðÆúÆ®·Î ¼³Ä¡Çϸé KO16MSWIN949 À̶ó´Â ¹®ÀÚ¼ÂÀ¸·Î ¼³Ä¡ µË´Ï´Ù.
¹®ÀÚ¼Â(CHARACTER SET) º¯°æ
¿À¶óŬ µ¥ÀÌÅͺ£À̽º °ü¸®ÀÚ·Î Á¢¼ÓÇÏ¿© NLS_CHARACTERSET, NCHARÀÇ CHARACTERSET¿¡ Çѱ¹¾î¸¦ Áö¿øÇϵµ·Ï ÆĶó¹ÌÅÍÀÇ ¼Ó¼º°ªÀ» KO16KSC5601·Î º¯°æÇÑ´Ù.
¾ð¾î¼Â(LANGUAGE SET) º¯°æ
¹®Àڼ°ú ¸¶Âù°¡Áö·Î ¿À¶óŬ µ¥ÀÌÅͺ£À̽º °ü¸®ÀÚ·Î Á¢¼ÓÇÏ¿© NLS_LANGUAGE ÆĶó¹ÌÅÍÀÇ ¼Ó¼º°ªÀ» AMERICAN_AMERICA.KO16KSC5601·Î º¯°æÇÑ´Ù
|