<pre name="code" class="plain">ORACLE_BASE=/opt/oracle/app #修改和OFA路径一致 ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 ORACLE_SID=h3c export ROACLE_PID=orcl export ORACLE_BASE ORACLE_HOME ORACLE_SID export PATH=$PATH:$ORACLE_HOME/bin export NLS_LANG=AMERICAN_AMERICA.UTF8 export <span style="color:#ff6666;">TNS_ADMIN</span>=$ORACLE_HOME/network/admin/修改后source .bash_profile使之生效。
jt1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.91.106)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = yourservicename) ) )完成之后退出并重新登录连接这个服务是否可用
SQL> create public database link jt1_link connect to root identified by passwd using 'jt1'; Database link created.测试下是否可用:
SQL> select count(*) from atable@jt1_link;
create database link jt1_link connect to root identified by passwd using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.91.106)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = yourservicename) ) )'
private | 创建者 | 当前Scheme可用,创建者可删除 |
public | PUBLIC | 当前database可用,所有连接到当前database都可以 |
global | PUBLIC | 跨database可用 |
Privilege | Database | Required For |
CREATE DATABASE LINK | Local | Creation of a privase database link. |
CREATE PUBLIC DATABASE LINK | Local | Creation of a public database link. |
CREATE SESSION | Remote |
Creation of any type of
database link.
|