MsSql ºÍ Oracle ¿çÊý¾Ý¿â²éѯ
SQL
insert into table_name(colum1,colum2)
select colum1,colum2
from opendatasource('sqloledb','data source=·þÎñÆ÷Ãû;user id=Óû§Ãû ;password=ÃÜÂë ').database_name.dbo.table_name
ÈçÖ´ÐгöÏÖÒÔÏ´íÎó”sql server ×èÖ¹Á˶Ô×é¼þ \'ad hoc distributed queries\' µÄ·ÃÎÊ“£¬½â¾ö·½·¨ÈçÏ£º
ÆôÓÃAd Hoc Distributed Queries£º
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
oracle
oracle ÖÐÌí¼ÓÅäÖÃ
test=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.221.0.1)(PORT = 1001))
)
(CONNECT_DATA =
(SERVICE_NAME = servname)
)
)
¡¡
create public database link linkname connect to Óû§Ãû identified by ÃÜÂë¡¡
using 'test'
select * from table_name@linkname
×¢ÒâÓÐʱºò»á±¨ "insufficienct privilege" ÇëÈ·¶¨½ÇÉ«ÖÐÊÇ·ñ¿ªÍ¨connectµÄȨÏÞŶ
Ïà¹ØÎĵµ£º
# LISTENER.ORA Network Configuration File: /opt/oracle/product/9.2/network/admin/listener.ora
# Generated by Oracle configuration tools.
ORA92 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS ......
ORACLEÖУ¬±í¿Õ¼äÊÇÊý¾Ý¹ÜÀíµÄ»ù±¾·½·¨£¬ËùÓÐÓû§µÄ¶ÔÏóÒª´æ·ÅÔÚ±í¿Õ¼äÖУ¬Ò²¾ÍÊÇÓû§ÓпռäµÄʹÓÃȨ£¬²ÅÄÜ´´½¨Óû§¶ÔÏó£®·ñÔòÊDz»³äÐí´´½¨¶ÔÏó£¬ÒòΪ¾ÍÊÇÏë´´½¨¶ÔÏó,Èç±í,Ë÷ÒýµÈ£¬Ò²Ã»Óеط½´æ·Å,Oracle»áÌáʾ:ûÓд洢Åä¶î£®¡¡¡¡Òò´Ë£¬ÔÚ´´½¨¶ÔÏó֮ǰ£¬Ê×ÏÈÒª·ÖÅä´æ´¢¿Õ¼ä.
·ÖÅä´æ´¢£¬¾ÍÒª´´½¨±í¿Õ¼ä£º¡¡¡¡
´´½¨±í¿Õ¼äÊ ......
ÎÒÃÇÏÈÀ´¿´Ò»ÏÂËûÃǵĶ¨Ò壺
A schema is a collection of database objects (used by a user.).
Schema objects are the logical structures that directly refer to the database’s data.
A user is a name defined in the database that can connect to and access objects.
Schemas and users help database ......
µ±ÄãÔÚÊý¾Ý¿âÖд´½¨Êý¾Ý±íµÄʱºò£¬ÄãÐèÒª¶¨Òå±íÖÐËùÓÐ×ֶεÄÀàÐÍ¡£ORACLEÓÐÐí¶àÖÖÊý¾ÝÀàÐÍÒÔÂú×ãÄãµÄÐèÒª¡£Êý¾ÝÀàÐÍ´óÔ¼·ÖΪ£ºcharacter, number, date, LOB, ºÍRAWµÈÀàÐÍ¡£ËäÈ»ORACLE8iÒ²ÔÊÐíÄã×Ô¶¨ÒåÊý¾ÝÀàÐÍ£¬µ«ÊÇËüÃÇÊÇ×î»ù±¾µÄÊý¾ÝÀàÐÍ¡£
ÔÚÏÂÃæµÄÎÄÕÂÖÐÄ㽫Á˽⵽ËûÃÇÔÚoracle ÖеÄÓ÷¨¡¢ÏÞÖÆÒÔ¼°ÔÊÐíÖµ¡£
¡¡¡¡
......
SQL> select * from emp where sal=800;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- ----- ......