DBLINK

2017-09-28  本文已影响0人  点点渔火

dblink建立跨库查询, 但是要注意clob和 blob字段不行, 解决办法是在:
1, 在源数据库做截断建视图处理 dbms_lob.substr(CHANGE_RESULT,4000,1)

2, 在目标数据库建临时表global temporary table 或者实体表

两种方法其实都不是太好, 查询速度都会受到很大影响, 最好还是定期做增量ETL吧

附部分转: http://blog.csdn.net/junfeng120125/article/details/7249321

dblink说明:

    create public database link dblink

       connect to totalplant identified by totalplant 

       using '(DESCRIPTION =

                (ADDRESS_LIST =

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

                )

                (CONNECT_DATA =

                  (SERVICE_NAME = prd.gdc)

                )

              )';
        create database link dblink

        connect to totalplant identified by totalplant 

        using '(DESCRIPTION =

                (ADDRESS_LIST =

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

                )

                (CONNECT_DATA =

                  (SERVICE_NAME = prd.gdc)

                )

              )';  
上一篇 下一篇

猜你喜欢

热点阅读