install oracle Instant Client 12.1.0.2 on Mac

首先从oracle官网上下载软件basic和sqlplus两个包。

创建oracle client使用的目录并将下载的两个包内的文件分发到对应的目录下。

mkdir -p /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/bin
mkdir -p /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/lib
mkdir -p /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/jdbc/lib
mkdir -p /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/rdbms/jlib
mkdir -p /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/sqlplus/admin
mkdir -p /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/network/admin

cd instantclient_12_1 & cd instantclient_12_1-2

mv ojdbc* /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/lib/
mv x*.jar /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/rdbms/jlib/
mv glogin.sql /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/sqlplus/admin/
mv *dylib* /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/lib/
mv *README /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/
mv * /Users/leo/oracle/product/instantclient_64/12.1.0.1.0/bin/

增加tnsnames.ora文件
PDB1_122 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.20)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = pdb1)
    )
  )

.bash_profile下添加环境变量
export ORACLE_HOME=/Users/leo/oracle/product/instantclient_64/12.1.0.1.0
export PATH=$ORACLE_HOME/bin:$PATH
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib

client安装完毕

此条目发表在Uncategorized分类目录。将固定链接加入收藏夹。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s