【oracle 客戶端】linux下安裝配置oracle客戶端
阿新 • • 發佈:2019-01-24
要在伺服器linux 下連線使用oracle 必須先按裝oracle客戶端。下面來記錄下如何安裝成功。
一、安裝必要的庫gcc依賴
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel gcc python-devel -y
二、用pip安裝cx_Oracle
pip install cx_Oracle
四、上傳 oracle_client.zip 到伺服器linux
rz oracle_client.zip
五、移動到 /usr/local/oracle 目錄
mkdir -p /usr/local/oracle unzip -d /usr/local/oracle/ oracle_client.zip
六、配置環境變數:
(root)
vim /etc/profile
export ORACLE_HOME=/usr/local/oracle
export LD_LIBRARY_PATH=/usr/local/oracle
PATH=$PATH
export PATH
source /etc/profile
七、建立軟連結
cd /usr/local/oracle
ln -s /usr/local/oracle/libclntsh.so.11.2 libclntsh.so
如果提示存在就不需要建立
八、指定動態連結庫
(root)
cd /etc/ld.so.conf.d touch oracle.conf vim oracle.conf
九、寫入oracle_client的路徑
/usr/local/oracle
啟動生效
ldconfig
十:配置etc/hosts
增加一行命令
127.0.0.1 hostname
如:127.0.0.1 DT-IMG-1