mac下安装配置sql plus

下载

oracle instantclient
mac下安装配置sql plus

解压

将两个压缩包解压到同一个目录:instantclient下

配置环境变量

vim ~/.bash_profile

增加如下内容:

DYLD_LIBRARY_PATH="/Users/mac/opt/oracle/instantclient"
export DYLD_LIBRARY_PATH
export ORACLE_HOME=$DYLD_LIBRARY_PATH
export PATH=$ORACLE_HOME:$PATH

# mac下防止中文乱码
export NLS_LANG="AMERICAN_AMERICA.UTF8"

source .bash_profile

配置数据库

instantclient/network/admin/tnsnames.ora

wuhu_jh =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.247.52)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = meter)
    )
  )

连接

sqlplus meter/meter@172.18.247.52/meter

username/password@ip/servicename

mac下安装配置sql plus

上一篇:MySQL备份与恢复之Xtrabackup工具(二)


下一篇:SQL理论阅读心得(一)