Home > Database > Mysql Tutorial > 建立数据库链接 create database link

建立数据库链接 create database link

WBOY
Release: 2016-06-07 16:57:24
Original
1458 people have browsed it

删除数据库链接:drop database link linkname;创建数据库链接:create database link linknameconnect to usernameidentified b

Linux公社

首页 → 数据库技术

背景:

阅读新闻

建立数据库链接 create database link

[日期:2010-08-08] 来源:Linux社区  作者:erichentao [字体:]

删除数据库链接:drop database link linkname;

创建数据库链接:
create database link linkname
connect to username
identified by password
using 'connection string';


如果想建立全局链接,则需要使用关键字:public

create public database link linkname
connect to username
identified by password
using 'connection string';


connection string可以有两种形式:
1,,在文件tnsnames.ora配置的名称:
如:
CDRDL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.129.29)(PORT = 2521))
)
(CONNECT_DATA =
(SERVICE_NAME = cdrdb)
)
)
此时可以写成:
create database link linkname
connect to username
identified by password
using 'CDRDL';

2,也可以直接使用‘=’号后面的字符串,
如:
create database link linkname
connect to username
identified by password
using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.147.129.29)(PORT=2521)))(CONNECT_DATA=(SERVICE_NAME=cdrdb)))';

linux

  • 0
  • 如何在本机用sqlplus登录远程的数据库

    CentOS下静默安装Oracle 10.2.0.1.0

    相关资讯       数据库 

    图片资讯      

    本文评论   查看全部评论 (0)

    评论声明

    最新资讯

    本周热门

    Linux公社简介 - 广告服务 - 网站地图 - 帮助信息 - 联系我们
    本站(LinuxIDC)所刊载文章不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。


    Copyright © 2006-2014 Linux公社 All rights reserved 浙ICP备06018118号

    Related labels:
    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