Oracle客户端安装
Oracle客户端安装Oracle客户端下载链接:https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html1、所需软件包instantclient-basic-linux.x64-12.1.0.2.0.zipinstantclient-sdk-linux.x64-12.1.0.2.
Oracle客户端安装
Oracle客户端下载链接:
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
1、所需软件包
instantclient-basic-linux.x64-12.1.0.2.0.zip
instantclient-sdk-linux.x64-12.1.0.2.0.zip
instantclient-sqlplus-linux.x64-12.1.0.2.0.zip
instantclient-precomp-linux.x64-12.1.0.2.0.zip
2、安装
2.1、创建oracle用户
1.在root用户下创建一个oracle用户
useradd oracle
2.修改密码
passwd oracle
3.修改权限
chown –R oracle:oracle /home/oracle/
chmod –R 755 /home/oracle/
2.2、解压缩软件包
unzip instantclient-basic-linux.x64-12.1.0.2.0.zip
unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
unzip instantclient-sqlplus-linux.x64-12.1.0.2.0.zip
unzip instantclient-precomp-linux.x64-12.1.0.2.0.zip
以上软件包都会解压到instantclient_12_1目录(文件夹)下,解压的时候注意权限,权限不对会解压失败。
2.3、配置
2.3.1、移动目录
mv instantclient_12_1 /home/oracle
2.3.2、创建数据库连接文件,并配置数据库服务器的连接信息
cd /home/oracle/instantclient_12_1
mkdir -p network/admin
cd network/admin
vim tnsnames.ora
CJKFDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = xxxx))
)
(CONNECT_DATA =
(SERVICE_NAME = xxxx)
)
)
2.3.3、建立libclntsh.12.1.so的软链接
ln -s libclntsh.so.12.1 libclntsh.so
2.3.4、配置环境变量
2.3.4.1、针对单个用户的配置
vim ~/.bash_profile
export ORACLE_HOME=/home/oracle/instantclient_12_1
export PROC=$ORACLE_HOME/sdk
export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME:$PROC
export LD_LIBRARY_PATH=$LD_LIRARY_PATH:$ORACLE_HOME
export LIBRARY_PATH=$LIBRARY_PATH:$ORACLE_HOME
source .base_profile
3、测试sqlplus
sqlplus username/passwd@ip:1521/数据库实例
更多推荐
所有评论(0)