下载mac数据库客户端:
地址:http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
下载这俩个:(来源:http://www.cnblogs.com/xiaobo-Linux/p/7821402.html)
12.12.0.1.0版本的:
解压instantclient包到 cd ~
创建目录lib然后做一个文件连接:
mkdir ~/lib
ln -s ~/instantclient_12_2/libclntsh.dylib ~/lib/
ln -s ~/instantclient_12_2/libclntsh.dylib.12.1 ~/lib/
做一个监听:tnsnames.ora文件
If you intend to co-locate optional Oracle configuration files such as tnsnames.ora
, sqlnet.ora
, ldap.ora
, or oraaccess.xml
with Instant Client, then create a network/admin
subdirectory. For example:
mkdir -p ~/instantclient_12_2/network/admin
vim tnsnames.ora
下如下内容,配置IP地址,IP地址是服务器地址,端口默认1521;
ORALOCAL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.211.55.14)(PORT = 1521)) )
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
连接windows oraclez11g
可以看一下IP地址:
连接的时候需要关闭防火墙,或者配置该端口允许连接。
配置一下环境变量:
~ vim .profile
追加如下:
ORCL_LIBRARY_PATH="instantclient_12_2"
export ORCL_LIBRARY_PATH
export ORACLE_HOME=$ORCL_LIBRARY_PATH
export PATH=$ORACLE_HOME:$PATH
执行一下生效:
~ source .profile
登录:
~ sqlplus sys/sys@10.211.55.14:1521/orcl as sysdba
安装macports支持telnet命令记录
https://guide.macports.org/#installing.macports
安装完配置一下环境变量:
~ vim .profile
添加:
export PATH=/opt/local/bin:$PATH
export PATH=/opt/local/sbin:$PATH
安装rlwrap
sudo port install rlwrap
安装完配置一下环境变量:
~ vim .profile
添加:
alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'
执行一下生效:
~ source .profile
登录:
~ rlwrap sqlplus sys/sys@10.211.55.14:1521/orcl as sysdba