ubuntu 安装oracle客户端
from: http://webikon.com/cases/installing-oracle-sql-plus-client-on-ubuntu
Installing Oracle SQL*Plus client on Ubuntu
Claudiu Cristea · 8/7/2014
Technologies:
Problem
You need to connect with sqlplus command line tool to your Oracle database but there are no binaries packages available for Debian/Ubuntu.
Solution
Convert and install from Oracle Instantclient RPM files. If case, tune your installation to correctlly access the Oracle client libraries.
Download
You'll need at least three RPM files. Go to http://www.oracle.com/technetwork/database/features/instant-client/index... and, once you have accepted the "License Agreement", download "Basic", "SQL*Plus" and the "SDK" RPMs.
In my case (Ubuntu 14.04 LTS, Intel on 64-bit) my downloaded files were:
- oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
- oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
- oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
Convert and Install
In order to convert from .rpm to .deb, you'll need alien:
$ sudo apt-get install alien
Now convert and install the packages in this order:
$ sudo alien -i oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
$ sudo alien -i oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
$ sudo alien -i oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
Test & Fix
Test your Oracle client. User either sqlplus either sqlplus64 depending on your platform:
$ sqlplus64 username/password@//dbhost:1521/SID
If sqlplus yields of a missing libaio.so.1 file, run:
$ sudo apt-get install libaio1
If you get the next message, then you need to instruct sqlplus to use the proper libray:
sqlplus64: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
To do so, first find the location of Oracle libraries. The path should be something like /usr/lib/oracle/<version>/client(64)/lib/. In my case (Ubuntu 14.04 LTS, Intel on 64-bit), it was /usr/lib/oracle/12.1/client64/lib/.
Now, add this path to the system library list. Create and edit a new file:
$ sudo nano /etc/ld.so.conf.d/oracle.conf
Add inside the path:
/usr/lib/oracle/12.1/client64/lib/
Run now the dynamic linker run-time bindings utility:
$ sudo ldconfig
For other errors when trying to run sqlplus, please consult the Ubuntu help page.
Wait! History? Auto-completion?
The weird thing about SQL*Plus is that it doesn't provide history and auto-completion like the MySQL client does. Here comes rlwrap, the "readline wrapper" — a small utility that uses the GNU readline library to allow the editing of keyboard input for any command.
Installing rlwrap on Ubuntu is simple:
$ sudo apt-get install rlwrap
Now you can run SQL*PLus wrapped with rlwrap:
$ rlwrap sqlplus64 username/password@//dbhost:1521/SID
Now you have line commands history in sqlplus. Nice :)
But what about auto-completion? Well, that needs some more workingaround and is not in the scope of this post. But you can check this post and figure a way to add tab completion to SQL*Plus.
It's time to make you life easy by adding an alias to .bashrc. Just ad this line:
alias sp='rlwrap sqlplus64 username/password@//dbhost:1521/SID'
and now you can simply use:
$ sp
to connect to your database.
Enjoy!
Resources
- https://help.ubuntu.com/community/Oracle%20Instant%20Client
- http://www.idevelopment.info/data/Oracle/DBA_tips/SQL_PLUS/SQLPLUS_8.shtml
- http://mikesmithers.wordpress.com/2013/07/06/simple-pleasures-rlwrap-and...
ubuntu 安装oracle客户端的更多相关文章
- Debian/Ubuntu安装Oracle客户端TNS
本文作为新手在Linux上部署Java程序的必经之路的Oracle客户端配置,请高手绕道. 确定服务器版本 首选确定你的Oracle服务器版本,以便下载相应的客户端.查看的sql如下: select ...
- 不安装oracle客户端,用plsql连接oracle
常用的Oracle开发的工具有SQL Developer和PL/SQL Developer,个人感觉前者虽然跨平台性优于后者,但比较大(大于300M)占用资源,而且用户体验也一般,而后者相对就小很多( ...
- 《oracle每日一练》免安装Oracle客户端使用PL/SQL
免安装Oracle客户端使用PL/SQL Oracle客户端挺招人烦的,部署连接它的应用通常需要先安装它的客户端,安装程序要求在目标机器上写注册表,假设你没有洁癖的话,你仍可能被下面的事情绊住:当你的 ...
- 代码生成器Kalman Studio2.2发布,完美支持Oracle,不需要安装Oracle客户端
这次更新主要是增加对Oracle的支持,不需要安装Oracle客户端,下面的配置文件列出了Kalman Studio支持的几种数据库 <?xml version="1.0" ...
- 一个不安装Oracle客户端的方法------未经试验
(一)不安装客户端的解决办法.第一种方法:1.在安装ORACLE服务器的机器上搜索下列文件,oci.dllocijdbc10.dllociw32.dllorannzsbb10.dlloraocci10 ...
- .net4.0中使用ODP.net访问Oracle数据库(无需安装oracle客户端部署方法)
1.在没有安装oracle客户端的设备上也能访问服务器上的oracle (通俗的讲就是:开发的应用程序 和 oracle数据库服务器分别在两台电脑上)2.不需要配置TnsNames.Ora文件 开发环 ...
- 不安装oracle客户端也可以使用pl/sql developer
通常情况下,用PL/SQL Developer连接Oracle是需要安装Oracle客户端软件的,这也就意味着你的硬盘将被占用大约1G-2G的空间,对于Windows操作系统来说,你还会多出一些开机自 ...
- .net远程连接oracle数据库不用安装oracle客户端
asp.net远程连接oracle数据库不用安装oracle客户端的方法下面是asp.net连接远程Oracle数据库服务器步骤: 1.asp.net连接oracle服务器需要添加Sytem.Data ...
- .net远程连接oracle数据库不用安装oracle客户端的方法
.net远程连接oracle数据库不用安装oracle客户端的方法步骤: 1.添加Sytem.Data.OracleClient命名空间. 2.连接时需要ConnectionString字符串,出现在 ...
随机推荐
- centos7 firewall-cmd 理解多区域配置中的 firewalld 防火墙
原文:https://www.linuxidc.com/Linux/2017-11/148795.htm 现在的新闻里充斥着服务器被攻击和数据失窃事件.对于一个阅读过安全公告博客的人来说,通过访问错误 ...
- 模拟实现ATM与购物商城
一.功能介绍(第6条未实现)模拟实现一个ATM + 购物商城程序1额度15000或自定义2实现购物商城,买东西加入购物车,调用信用卡接口结账3可以提现,手续费5%4支持多账户登录5支持账户间转账6记录 ...
- 关于Centos7 firewalld防火墙开放端口后仍不能访问ftp和nginx的问题解决
我在阿里轻量应用服务器搭建ftp服务器这篇博客中把防火墙换为iptables,因为当时无论我怎么设置firewalld,就是无法访问ftp服务器,今天在翻看其他博客的时候,突然发现firewalld有 ...
- 为什么QQ空间和QQ邮箱都是IE默认打开?
为什么QQ空间和QQ邮箱都是IE默认打开? 我已经设置成chrome为默认浏览器了 原文转载至:https://zhidao.baidu.com/question/390662851068217285 ...
- css3属性兼容性
来自:http://www.cnblogs.com/woleicom/p/4111030.html css3属性兼容性 /*圆角class,需要设置圆角的元素加上class名称*/ .roundedC ...
- (转)C#读写共享文件
原文地址:https://www.cnblogs.com/guohu/p/4694515.html using System; using System.Collections.Generic; us ...
- requests模块学习
- 基于如下5点展开requests模块的学习 什么是requests模块 requests模块是python中原生的基于网络请求的模块,其主要作用是用来模拟浏览器发起请求.功能强大,用法简洁高效.在 ...
- Apached+resin服务搭建
一.前言 Resin是CAUCHO公司的产品,是一个非常流行的支持servlets 和jsp的引擎,速度非常快.对servlet和JSP提供了良好的支持,性能也比较优良,resin自身采用JAVA语言 ...
- angularjs的ng-class
<!--第一种 直接加变量--> <div ng-class="tempClass"></div> <!--第二种 用{{}} 包住的变量 ...
- bayes公式 - 再从零开始理解
bayes公式与机器学习 - 再从零开始理解 从本科时候(大约9年前)刚接触Bayes公式,只知道P(A|B)×P(B) = P(AB) = P(B|A)×P(A) 到硕士期间,机器学习课上对P(B| ...