oracle 在本地查询远程数据库的方法,如何组合远程链接字符串

WBOY
发布: 2016-06-07 15:18:43
原创
1125 人浏览过

方法如下: 第一、创建远程链接的link: create public database like linkorcl(创建的link名称) connect to zhang(用户名) identified by xxxx(密码) using '111.111.1.1:1521/orcl'(远程数据库ip和数据库名称); 其他均为关键字 第二、使用创建的li

方法如下:

第一、创建远程链接的link:

create public database like linkorcl(创建的link名称) connect to zhang(用户名) identified by
xxxx(密码) using  '111.111.1.1:1521/orcl'(远程数据库ip和数据库名称);

其他均为关键字

 

第二、使用创建的link名称进行查询即可:

select * from student@linkorcl;

 

实例如下:

SQL>
SQL>创建公共数据库链接 linkorcl 连接至 zhang,识别者:
  2  XXXX 使用   '111.111.1.1:1521/orcl';
 
数据库链接已创建
 
SQL>从student@linkorcl中选择*;
 
S_ID                                                                           S_NAME                                             S_AGE
-------------------------------------------------- ------------------------------------------ -------------------- ------------------------------ -----
1                                                                                                                       26
2                                                                             马明                                                  21
3                                                                             张士波                                                12
4                                                                             蕾妮                                                  15
5                                                                                reday                                                 18
6                                                                                alisa                                                 19
7                                                                                胡总                                                  23
8                                                                                阿里山                                                29
9                                                                                扎西                                                  20
10                                                                               香格里拉                                              24
11                                                                               琪琪格                                                28
12                                                                               暗夜精灵                                              19
 
12 rows selected
 
SQL>

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板