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

方法如下:

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

create public database like linkorcl(创建的link名称) connect to zhang(用户名) identified by

xxxx(密码) using '111.111.1.1:1521/orcl'(远程数据库ip和数据库名称);

其他均为关键字

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

实例如下:

SQL>

SQL> CREATE   PUBLIC   DATABASE   LINK   linkorcl CONNECT   TO   zhang IDENTIFIED   BY

2  XXXX USING   '111.111.1.1:1521/orcl';

Database link created

SQL> select * from student@linkorcl;   S_ID                                                                             S_NAME                                             S_AGE -------------------------------------------------------------------------------- -------------------------------------------------- ----- 1                                                                                potter                                                26 2                                                                                马明                                                  21 3                                                                                张士波                                                12 4                                                                                renee                                                 15 5                                                                                reday                                                 18 6                                                                                alisa                                                 19 7                                                                                胡总                                                  23 8                                                                                阿里山                                                29 9                                                                                扎西                                                  20 10                                                                               香格里拉                                              24 11                                                                               琪琪格                                                28 12                                                                               暗夜精灵                                              19   12 rows selected   SQL>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值