1 上传安装包
[dmdba@DM8 dm] $ mkdir 11g
[dmdba@DM8 11g] $ unzip instantclient- sqlplus- linux. x64- 11. 2. 0. 4. 0. zip
[dmdba@DM8 11g] $ unzip instantclient- sdk- linux. x64- 11. 2. 0. 4. 0. zip
[dmdba@DM8 11g] $ unzip instantclient- jdbc- linux. x64- 11. 2. 0. 4. 0. zip
[dmdba@DM8 11g] $ unzip instantclient- odbc- linux. x64- 11. 2. 0. 4. 0. zip
[dmdba@DM8 11g] $ unzip instantclient- tools- linux. x64- 11. 2. 0. 4. 0. zip
[dmdba@DM8 11g] $ unzip instantclient- basiclite- linux. x64- 11. 2. 0. 4. 0. zip
[dmdba@DM8 11g] $ unzip instantclient- basic- linux. x64- 11. 2. 0. 4. 0. zip
2 配置环境变量
export ORACLE_HOME=/ dm/ 11g/ instantclient_11_2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH :$ORACLE_HOME
export PATH=$ORACLE_HOME :$PATH
3 配置tns
[dmdba@DM8 ~] $ cd / dm/ 11g/ instantclient_12_2
[dmdba@DM8 instantclient_12_2]
[dmdba@DM8 instantclient_12_2]
[dmdba@DM8 admin]
orcl =
( DESCRIPTION =
( ADDRESS_LIST =
( ADDRESS = ( PROTOCOL = TCP) ( HOST = 192. 168. 1. 12) ( PORT = 1521) )
)
( CONNECT_DATA =
( SERVER = DEDICATED)
( SERVICE_NAME = orcl)
)
)
4 测试sqlplus
[dmdba@DM8 admin] $ sqlplus system/ oracle@orcl
SQL* Plus: Release 11. 2. 0. 4. 0 Production on Tue Jan 19 19:37:55 2021
Copyright ( c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11. 2. 0. 4. 0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
5 复制文件
[dmdba@DM8 instantclient_12_2] $ cp * so* / dm/ dmdbms/ bin
[dmdba@DM8 instantclient_12_2] $ cd / dm/ dmdbms/ bin
[dmdba@DM8 bin] $ cp libclntsh. so. 11. 1 libclntsh. so
[dmdba@DM8 bin] $ chmod - R 777 / dm/ dmdbms/ bin
6 创建DBlink
SQL> create or replace public link test connect 'oracle' with system identified by "oracle" using 'orcl' ;