TDLIB > Oracle
Oracle查询、创建、删除DBLink
山炮   ·  2021.0422 10:02:47
Stat:760v. 0r. 0u. 0d. 0f 
#0. (Normal)

Oracle查询、创建、删除DBLink

查询DBLINK信息
select * from dba_db_links;
select owner,object_name from dba_objects where object_type='DATABASE LINK';
select * from ALL_DB_LINKS;

Oracle创建dblink报错:ORA-01017、ORA-02063解决:
根据ORA-01017的提示是连接到另一方的用户密码错误,当9i或10g的版本的Oracle数据库连接11g的版本时,会自动将密码转化为大写。
**密码最好用双引号引起来,否则可能在连接的时候报错

create database link dblink名
  connect to 数据库用户名 identified by "数据库密码"
 using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))';  

-- 如果创建全局 dblink,必须使用 systm 或 sys 用户,在 database 前加 public。  
create public database link dblink名
  connect to 数据库用户名 identified by "数据库密码"
  using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))';  

--删除DBLINK
DROP DATABASE LINK [name];  
--或  
DROP PUBLIC DATABASE LINK [name];  

DBLINK

【Copyright Notice】
This article is original, follow CC 4.0 BY-SA copyright agreement! Please indicate the original url when repost.
Original url:https://tdlib.com/am.php?t=dqOYAEHLRi3C

Tag:   Oracle   DBLink   
Next
【Related content】
Top     1/1 
You are not logged in, please [Register] or [Login]
(Register in one minute!)
Copyright ©TDLIB, All Rights Reserved.
Powered by TYCMS Version 1002