Home > Database > Mysql Tutorial > body text

Oracle 创建 DBLink 的方法

WBOY
Release: 2016-06-07 17:02:57
Original
1144 people have browsed it

1、如果需要创建全局 DBLink,则需要先确定用户有创建 dblink 的权限: select * from user_sys_privs where privilege like u

1、如果需要创建全局 DBLink,则需要先确定用户有创建 dblink 的权限:

  • 如果没有,则需要使用 sysdba 角色给用户赋权:

  • 2、使用该用户登录 PL/SQL,使用命令:

  • -- 第一种方法:要求数据库服务器 A 上 tnsnames.ora 中有 数据库 B 的映射  
  • 采用图形配置界面则如下所示:

     

    3、查询数据:

  • -- 查询、删除和插入数据和操作本地的数据库是一样的,只不过表名需要写成“表名@dblink服务器”而已。  
  • select xxx FROM 表名@数据库链接名;  
  • 4、删除 DBLink

  • 5、创建和删除同义词

    6、创建和删除视图

  • drop view 视图名;  
  • 7、注意:

    创建 DBLink 很简单,但是在使用中后台却出现锁,查看这个锁的方法可以去 console 中看到或者查询数据库。每次使用dblink查询的时候,,均会与远程数据库创建一个连接,dblink 应该不会自动释放这个连接,如果是大量使用 dblink 查询,会造成 web 项目的连接数不够,导致系统无法正常运行,导致系统无正常运行。

    linux

    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!