数据库链 博客分类: oracle Oracle
程序员文章站
2024-02-25 21:05:51
...
创建库链
LINK_TO_AAA 是库链名称,root 是连接的数据库的用户名,123456 是连接的数据库的用户密码
-- Create database link
create database link LINK_TO_AAA
connect to root identified by 123456
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.xxx.xxx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = aaa)
)
)';
查看库链的时候不会显示用户密码,如下:
-- Create database link
create database link LINK_TO_AAA
connect to root
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.xxx.xxx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = aaa)
)
)';
要删除专用数据库链,用户必须为DBA角色或者为该专用数据库链的创建者、所有者。要删除公用数据库链,则必须拥有DROP PUBLIC DATABASE LINK权限:
drop database link LINK_TO_AAA
LINK_TO_AAA 是库链名称,root 是连接的数据库的用户名,123456 是连接的数据库的用户密码
-- Create database link
create database link LINK_TO_AAA
connect to root identified by 123456
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.xxx.xxx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = aaa)
)
)';
查看库链的时候不会显示用户密码,如下:
-- Create database link
create database link LINK_TO_AAA
connect to root
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.xxx.xxx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = aaa)
)
)';
要删除专用数据库链,用户必须为DBA角色或者为该专用数据库链的创建者、所有者。要删除公用数据库链,则必须拥有DROP PUBLIC DATABASE LINK权限:
drop database link LINK_TO_AAA
推荐阅读
-
数据库链 博客分类: oracle Oracle
-
oracele中导入dmp文件 博客分类: 数据库
-
ORA-12505, TNS:listener does not currently know of SID given in connect descript 博客分类: oracle编程错误及处理 oracleORA-12505
-
Oracle中还原到指定时间时候的表内容 博客分类: Oracle Oracle
-
Oracle中还原到指定时间时候的表内容 博客分类: Oracle Oracle
-
ORA-12505, TNS:listener does not currently know of SID given in connect descript 博客分类: oracle编程错误及处理 oracleORA-12505
-
dual虚拟表 博客分类: oracle oracle
-
InstantClient安装配置 博客分类: oracle oracle
-
oracle时间运算和格式转换 博客分类: oracle
-
oracle迭代sql 博客分类: oracle Oracle