linux上安装简易Oracle cilent
来源:互联网 发布:办公网络组建方案 编辑:程序博客网 时间:2024/05/17 02:38
instantclient-basic-linux32-10.2.0.3-20061115.zip
instantclient-sdk-linux32-10.2.0.3-20061115.zip
instantclient-sqlplus-linux32-10.2.0.3-20061115.zip
sqlplus是用来检验是否安装成功的。依次解压,得到一个统一的文件夹,instantclient_10_2。如我前面的文章DBArtisan无法加载OCI,配置好TNS_ADMIN、LD_LIBRARY_PATH等,复制.bashrc文件部分内容如下:
export ORACLE_HOME=/usr/local/oracle
export TNS_ADMIN=$ORACLE_HOME/NETWORK/ADMIN
export LD_LIBRARY_PATH=$ORACLE_HOME
export SQLPATH=$ORACLE_HOME
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
PATH=$PATH:$ORACLE_HOME
export PATH
找一个配置好的tnsnames.ora文件放到TNS_ADMIN变量设置的位置,也就是/usr/local/oracle/NETWORK/ADMIN目录下。接下来就可以使用sqlplus验证是否安装成功。当我使用如下命令:sqlplus username/password@<连接字符串>测试时,系统提示段错误 (segmentation fault)。有提示解决方法如下:
1. cd /usr/bin (as root)
2. mv gcc gcc.script
3. mv g++ g++.script
4. ln -s gcc32 gcc
5. ln -s g++32 g++
6. login as oracle software owner (make sure environment is correct)
7. cd $ORACLE_HOME/bin
8. relink all
首先,这个是64位系统的解决方法,其次,我在当前linux系统中找不到relink命令。后来,传说中的高人又出现了,一顿检查以后,得出结论如下,这个linux的内核版本太高了,instant client这个版本可能还不支持,于是建议安装instant client 11。
下载如下文件:
instantclient-basic-linux32-11.2.0.1.zip
instantclient-sdk-linux32-11.2.0.1.zip
instantclient-sqlplus-linux32-11.2.0.1.zip
操作步骤与上面一样,其实配置已经做好了,只需将原来instant client 的文件都删除,替换成instant client 11的文件就行。再使用sqlplus测试,连接成功。
以下是讨论不设置环境变量安装Oracle instant client的内容,先记录下来,有空再尝试。
Oracle's instructions specify setting LD_LIBRARY_PATH. This makes my application dependent on random users' configuration and is very troublesome to set up.
How can I avoid having to set any environment variables?
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html
related note for OS/X: http://stackoverflow.com/questions/684352
answer:
/etc/ld.so.conf
, then run /sbin/ldconfig
. You don't need to setLD_LIBRARY_PATH
for libraries installed in standard locations like /usr/lib
because these locations are already configured in /etc/ld.so.conf
.------------------------------------------------------- 昏哥线 -------------------------------------------------------------------
Oracle's instantclient installation instructions specify that the user set LD_LIBRARY_PATH. This is very troublesome to manage for multiple users.
To use the instantclient without setting any environment variables:
Download the instantclient distribution from oracle.com. For doing non-java software development, you will need (assuming Oracle 10.2):
instantclient-basic-linux-x86_64-10.2.0.4.0.zipinstantclient-sdk-linux-x86_64-10.2.0.4.0.zipinstantclient-sqlplus-linux-x86_64-10.2.0.4.0.zip
Unzip the three files. This will give you a directory
instantclient_10_2/
Copy the files to /usr, which is one of the default places the dynamic loader searches.
sudo cp instantclient_10_2/sdk/include/*.h /usr/includesudo cp instantclient_10_2/sqlplus /usr/binsudo cp instantclient_10_2/*.so* /usr/lib
If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.
sudo cp tnsnames.ora /etc
Test with
/usr/bin/sqlplus scott/tiger@myoracle
------------------------------------------------------- 昏哥线 -------------------------------------------------------------------
You could of course rename sqlplus to sqlplus.real and make a wrapper script:
#!/bin/shif [ "$LD_LIBRARY_PATH" = "" ]then LD_LIBRARY_PATH=/what/everelse LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/what/everfiexport LD_LIBRARY_PATHexec sqlplus.real ${1+"$@"}
------------------------------------------------------- 昏哥线 -------------------------------------------------------------------
For anyone playing with Solaris (like me!) coming from a Linux background, I found that @David Phillips solution worked well using the Solaris commandcrle -u -l /opt/instantclient
Thanks to post http://chrismiles.info/systemsadmin/solaris/articles/ld-path-customisation-on-solaris/
- linux上安装简易Oracle cilent
- Oracle Linux x86_64 简易客户端安装步骤
- Linux下安装Oracle简易步骤
- linux 上oracle安装
- linux上安装oracle
- linux 上安装oracle
- Linux 6.4 + Oracle 11.2g Oracle 简易安装步骤
- LINUX上安装ORACLE总结
- Linux上静默安装Oracle
- 环境安装系列 - Linux上搭建简易Git服务01
- 【oracle】在Linux上安装Oracle
- linux 远程连接oracle 安装instantclient简易客户端
- linux简易安装方法
- oracle简易客户端安装配置。
- oracle 在LINUX上 的安装
- linux上安装oracle(有完善)
- 在Redhat Linux上安装Oracle XE
- Ubuntu Linux上安装Oracle 10g
- 如何实现局部刷新
- 关于flex 页面跳转的方法
- Oracle备份秘籍
- 用Ping命令测试MTU大小
- iphone获取手机设备号
- linux上安装简易Oracle cilent
- jquery打印指定的div
- js动态设置表格内容,生成HTML文件
- SendMessage与PostMessage的区别
- 兼容firefox的问题 event is not defined
- C#写的扫雷游戏
- ibatis开发过程中小计
- s3c2410下 platform 总线设备和驱动 led_drv.c led_dev.c 和test
- ASP.NET页面打印技术的总结