Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle dblink µÄÓ¦ÓÃ

oracle dblink µÄÓ¦ÓÃ
url:http://blog.chinaunix.net/u/19820/showart_334013.html
1¡¢ÓÃdblinkÁ´½Óoracle
£¨1£©ÓëÆ½Ì¨Î޹صÄд·¨£º
create public database
link cdt connect to apps
identified by apps using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.205.100)(PORT = 1541))
)
(CONNECT_DATA =
(SERVICE_NAME = CDT)
)
)'
£¨2£©¿ÉÒÔ½«µ¥ÒýºÅÄÚµÄÄÚÈÝÓÃÒ»¸ö·þÎñÃû´úÌæ¡£¶ø½«ÆäÄÚÈÝдÔÚtnsname.oraÖУ¬ÕâÖÖд·¨ÓÐʱ²»³É¹¦¡£
2¡¢²Î¿¼ÈçÏÂÄÚÈÝ
Á©Ì¨²»Í¬µÄÊý¾Ý¿â·þÎñÆ÷£¬´Óһ̨Êý¾Ý¿â·þÎñÆ÷µÄÒ»¸öÓû§¶ÁÈ¡Áíһ̨Êý¾Ý¿â·þÎñÆ÷ϵÄij¸öÓû§µÄÊý¾Ý£¬Õâ¸öʱºò¿ÉÒÔʹÓÃdblink¡£
ÆäʵdblinkºÍÊý¾Ý¿âÖеÄview²î²»¶à£¬½¨dblinkµÄʱºòÐèÒªÖªµÀ´ý¶ÁÈ¡Êý¾Ý¿âµÄipµØÖ·£¬ssidÒÔ¼°Êý¾Ý¿âÓû§ÃûºÍÃÜÂë¡£
´´½¨¿ÉÒÔ²ÉÓÃÁ½ÖÖ·½Ê½£º
1¡¢ÒѾ­ÅäÖñ¾µØ·þÎñ
create public database
link fwq12 connect to fzept
identified by neu using 'fjept'
CREATE DATABASE LINKÊý¾Ý¿âÁ´½ÓÃûCONNECT TO Óû§Ãû IDENTIFIED BY ÃÜÂë USING ‘±¾µØÅäÖõÄÊý¾ÝµÄʵÀýÃû’;
2¡¢Î´ÅäÖñ¾µØ·þÎñ
create database link linkfwq
connect to fzept identified by neu
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.142.202.12)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = fjept)
)
)';
host£½Êý¾Ý¿âµÄipµØÖ·£¬service_name£½Êý¾Ý¿âµÄssid¡£
ÆäʵÁ½ÖÖ·½·¨ÅäÖÃdblinkÊDz¶àµÄ£¬ÎÒ¸öÈ˸оõ»¹ÊǵڶþÖÖ·½·¨±È½ÏºÃ£¬ÕâÑù²»Êܱ¾µØ·þÎñµÄÓ°Ïì¡£
Êý¾Ý¿âÁ¬½Ó×Ö·û´®¿ÉÒÔÓÃNET8 EASY CONFIG»òÕßÖ±½ÓÐÞ¸ÄTNSNAMES.ORAÀﶨÒå.
Êý¾Ý¿â²ÎÊýglobal_name=trueʱҪÇóÊý¾Ý¿âÁ´½ÓÃû³Æ¸úÔ¶¶ËÊý¾Ý¿âÃû³ÆÒ»Ñù
Êý¾Ý¿âÈ«¾ÖÃû³Æ¿ÉÒÔÓÃÒÔÏÂÃüÁî²é³ö
SELECT * from GLOBAL_NAME;
²éѯԶ¶ËÊý¾Ý¿âÀïµÄ±í
SELECT …… from ±íÃû@Êý¾Ý¿âÁ´½ÓÃû;
²éѯ¡¢É¾³ýºÍ²åÈëÊý¾ÝºÍ²Ù×÷±¾µØµÄÊý¾Ý¿âÊÇÒ»ÑùµÄ£¬Ö»²»¹ý±íÃûÐèҪд³É“±íÃû@dblink·þÎñÆ÷”¶øÒÑ¡£
¸½´øËµÏÂͬÒå´Ê´´½¨:
CREATE SYNONYMͬÒå´ÊÃûFOR ±íÃû;
CREATE SYNONYMͬÒå´ÊÃûFOR ±íÃû@Êý¾Ý¿âÁ´½ÓÃû;
ɾ³ýdblink£ºDROP PUBLIC DATABASE LINK linkfwq¡£
Èç¹û´´½¨È«¾Ödblink£¬±ØÐëʹÓÃsystm»òsysÓû§£¬ÔÚdatabaseǰ¼Ópublic¡£
 
3¡¢ÓÃdblinkÁ´½Ósqlserver;
²Î¿¼1£º
ͨ¹ýdblink·ÃÎÊsqlserverÊý¾Ý¿â
ͨÓÃÍ


Ïà¹ØÎĵµ£º

oracleÖжÔÏó±í£¬ref¼°derefµÄÒ»¸öʵÀý¡£

ORACLEÔÚ¹ØÏµÊý¾Ý¿âÍ⣬ÈÚÈëÁËÃæÏò¶ÔÏóµÄÔªËØ£¬±ÈÈç¿ÉÒÔ´´½¨type£¬typeÖ®¼ä¿ÉÒԼ̳У¬type¿ÉÒÔ´ø¹¹Ô캯Êý¡¢ÅÅÐòº¯Êý¡¢¸÷ÖÖ¸÷ÑùµÄ³ÉÔ±º¯Êý¡¢´æ´¢¹ý³ÌµÈµÈ¡£
¶ÔÏó±íÊÇÖ¸¸Ã±íµÄÒ»ÐоÍÊÇÒ»¸ö¶ÔÏó£¬ÓÐÒ»¸öOID(object ID)£¬¶ÔÏó±íÖ®¼äûÓÐÖ÷Íâ¼ü¹ØÁªµÄ¸ÅÄΪÁËÌåÏÖÕâ²ã¹ØÏµ£¬oracleÖÐÓÃÁËref¶ÔÏóÀ´ÊµÏÖ¡£
ÏÂÃæÀý×Ó£¬´´½¨Ò»¸öµ ......

OracleÊý¾Ý¿âÀ䱸·Ý»Ö¸´µÄ²½Öè

     À䱸·ÝÊý¾Ý±ØÐëÊÇÊý¾Ý¿â²»ÔÚopen״̬Ï¡£ ÒÔϲ½Öè»á¸ø³öÏêϸµÄ¹ý³Ì£º
¡¡¡¡(1)£º ¹Ø±ÕDB £º shutdown immediate£»
¡¡¡¡(2)£ºcopy oradataĿ¼ÏµÄËùÓÐÎļþ£¬ °üÀ¨Êý¾ÝÎļþ£¬ ¿ØÖÆÎļþ£¬redo£¬µÈ£¬»¹ÐèÒªcopy ÃÜÂëÎļþ ÔÚĿ¼ora92Ï µÄdatabase ÖеÄpwd Îļþ.È«²¿copyµ½Ò»¸ö°²È«Ä¿Â¼ÖС£ÔÚsql ......

Oracle·ÖÒ³ÌÖÂÛ

oracle·ÖÒ³£¿£¿£¿
ÔÚmysqlÖÐÖ»Òªlimit x,y¾Í¿ÉÒÔ·ÖÒ³³É¹¦£¬ÄÇoracle ÖÐÊÇÔõô×öµÄÄØ£¿
=================================================
·½·¨Ò»£º
SELECT   id,rown  
      from   (SELECT   id,   ROWNUM   rown  
          &nb ......

OracleÊý¾Ý¿âÖеÄËø»úÖÆÑо¿

Êý¾Ý¿âÊÇÒ»¸ö¶àÓû§Ê¹ÓõĹ²Ïí×ÊÔ´¡£µ±¶à¸öÓû§²¢·¢µØ´æÈ¡Êý¾Ýʱ£¬ÔÚÊý¾Ý¿âÖоͻá²úÉú¶à¸öÊÂÎñͬʱ´æÈ¡Í¬Ò»Êý¾ÝµÄÇé¿ö¡£Èô¶Ô²¢·¢²Ù×÷²»¼Ó¿ØÖƾͿÉÄÜ»á¶ÁÈ¡ºÍ´æ´¢²»ÕýÈ·µÄÊý¾Ý£¬ÆÆ»µÊý¾Ý¿âµÄÒ»ÖÂÐÔ¡£
¼ÓËøÊÇʵÏÖÊý¾Ý¿â²¢·¢¿ØÖƵÄÒ»¸ö·Ç³£ÖØÒªµÄ¼¼Êõ¡£µ±ÊÂÎñÔÚ¶Ôij¸öÊý¾Ý¶ÔÏó½øÐвÙ×÷ǰ£¬ÏÈÏòϵͳ·¢³öÇëÇó£¬¶ÔÆä¼ÓËø¡£¼ÓËøºó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ