zoukankan      html  css  js  c++  java
  • PLSQL_Database Link的基本概念和用法(概念)

    2014-06-08 Created By BaoXinjian

    一、总结


    1. 建立数据库连接的方式

    2. 查询方式

    3. 连接类型

    4. 常用的查询

     

    二、具体分析


    1. 建立数据库连接的方式

        (1).使用tns进行建立

                    CREATE DATABASE LINK linkname

                        CONNECT TO user_name IDENTIFIED BY password

                        USING tns_dbname 

        (2).直接建立

                    CREATE DATABASE LINK linkname

                         CONNECT TO user_nameIDENTIFIED BY password

                        USING '(DESCRIPTION =

                                               (ADDRESS_LIST =

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

                                                )

                                                (CONNECT_DATA =

                                                        (SERVICE_NAME = dbname)

                                                )

                                     )'    

     

    2. 查询方式

        (1).直接使用select * form tablename@dblink    

        (2).建立同义词,按同义词方式进行查询

        (3).建立物化视图,提高执行效率

            create public synonym syn_name for tablename@linknam

     

    3. 连接类型

        (1).私有Private

        (2).共有Public

            建立共有的数据库连接时必须是有sysadmin和sys账户

                    CREATE PUBLIC DATABASE LINK linkname

                        CONNECT TO user_name IDENTIFIED BY password

                        USING tns_dbname

     

    4. 常用的查询

        (1).查询当前账户所有的dblink连接

                    select * from user_db_links; 

        (2).查询当前系统所有的dblink连接

                    select * from dba_db_links  

        (3).查询当前正在连接的dblink连接

                    select * from v$dblink

     

    Thanks and Regards

  • 相关阅读:
    the process cannot access the file because it is being used by another process
    SharePoint 2013: The "New Web Application" button is disabled is the central administration
    【转】Windows按键消息—虚拟键码
    【转】windows消息16进制对应表
    C#将图片字节流转为Base64直接放入html的img标签src属性中
    WPF自定义Main函数
    c#geckofx文件流下载
    腾讯RTX登录提示失败问题及处理办法
    C# \u8888类型的unicode转换为字符串方法
    C#System.Net.Mail采用简单邮件传输协议发送邮件
  • 原文地址:https://www.cnblogs.com/eastsea/p/3776603.html
Copyright © 2011-2022 走看看