DBlink

--SJZH4SZDIS/SJZH4SZDIS 用户名/密码

create database link to_test

connect to SJZH4SZDIS identified by SJZH4SZDIS

        using '(DESCRIPTION =

                   (ADDRESS_LIST=

                         (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.18.202)(PORT = 1521))

                    )

                    (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORCL)) 

                ) ';

 

DROP DATABASE LINK  to_test;

 

select * from SJZH4SZDIS.am_asset_0900@to_test;--做一个简单的运用DBLink查询语句,还可以再后面直接添加where条件,这里可以把SJZH4SZDIS.am_asset_0900@to_test当做一张表来看,可以喝本地的表直接进行连表查询

你可能感兴趣的:(oracle)