`
itspace
  • 浏览: 978420 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

OCI安装错误记录(一)

阅读更多
主机环境:
WINDOWS 2008 X64+ORACLE 11G R2 x64+CYGWIN
初始安装时报以下错误:
引用
$ gem install -l --no-doc --no-ri ruby-oci8-1.0.2.gem
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-oci8-1.0.2.gem:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install -l --no-rdoc --no-ri ruby-oci8-1.0.2.gem
checking for load library path... (PATH)...
  not found
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-instant-client
        --without-instant-client
./oraconf.rb:642:in `get_home': RuntimeError (RuntimeError)
        from ./oraconf.rb:520:in `initialize'
        from ./oraconf.rb:238:in `new'
        from ./oraconf.rb:238:in `get'
        from extconf.rb:24
ok
---------------------------------------------------
error messages:
Set the environment variable ORACLE_HOME if Oracle Full Client.
Append the path of Oracle client libraries to PATH if Oracle Instant Client.

---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/en/HowToInstall.html
* http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html



经检查ORACLE 11G x64没有lib32目录,将ORACLE 11G 32bit的lib目录拷贝至ORACLE 11G x64的ORACLE_HOME下,取名为lib32,同时设置环境变量,再次安装时报如下错误
引用
$ gem install -l --no-rdoc --no-ri ruby-oci8-1.0.2.gem
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-oci8-1.0.2.gem:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install -l --no-rdoc --no-ri ruby-oci8-1.0.2.gem
checking for load library path... (PATH)...
  not found
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... ok
Get the version of Oracle from SQL*Plus... 1120
checking for OCIInitialize() in oci.h... no
nm: OCI.dll: File format not recognized
nm: OCI.dll: File format not recognized
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized
BFD: /cygdrive/c/app/Administrator/product/11.2.0/dbhome_1/OCI/LIB/MSVC/OCI.LIB(OCI.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive
nm: OCI.dll: File format not recognized...


安装win32_11gR2_client.zip,同时修改环境变量,ORACLE_HOME。LD_LIBARAY_PATH。报如下错误:
引用
$ gem install -l --no-rdoc --no-ri ruby-oci8-1.0.2.gem
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-oci8-1.0.2.gem:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install -l --no-rdoc --no-ri ruby-oci8-1.0.2.gem
checking for load library path... (PATH)...
  found: /cygdrive/c/app/Administrator/product/11.2.0/client_1/oci.dll looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-instant-client
        --without-instant-client
./oraconf.rb:863:in `initialize': RuntimeError (RuntimeError)
        from ./oraconf.rb:236:in `new'
        from ./oraconf.rb:236:in `get'
        from extconf.rb:24
ok
---------------------------------------------------
error messages:
Could not compile with Oracle instant client.
/cygdrive/c/app/Administrator/product/11.2.0/client_1/sdk/lib/msvc/oci.lib could not be found.

---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/en/HowToInstall.html
* http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html



Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/ext/oci8/gem_make.out

Administrator@BF /cygdrive/c/dbra/app/softs


将ORACLE 11G WIN32的OCI目录下面的子目录拷贝至/cygdrive/c/app/Administrator/product/11.2.0/client_1/sdk下安装成功


引用
$ gem install -l --no-rdoc --no-ri ruby-oci8-1.0.2.gem
Building native extensions.  This could take a while...
Successfully installed ruby-oci8-1.0.2
1 gem installed

Administrator@BF /cygdrive/c/dbra/app/softs
$


运行require,报错
引用
$ irb
irb(main):001:0> require 'oci8'
LoadError: no such file to load -- oci8
        from (irb):1:in `require'
        from (irb):1


可以看到ruby-oci8已经成功安装
引用
$ gem list

*** LOCAL GEMS ***

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.1.0, 2.0.2)
activerecord-oracle-adapter (1.0.0.9250)
activerecord-oracle_enhanced-adapter (1.1.8)
activeresource (2.0.2)
activesupport (2.1.0, 2.0.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
gettext (1.93.0)
hoe (1.8.2)
log4r (1.0.5)
mongrel (1.1.4)
mongrel_cluster (1.0.5)
net-sftp (2.0.1)
net-ssh (2.0.3)
rails (2.0.2)
rake (0.8.3)
ruby-oci8 (1.0.2)
ruby-prof (0.7.3)
rubyforge (1.0.1)


将/cygdrive/c/app/Administrator/product/11.2.0/client_1/的oci.dll拷贝至tmp目录,环境变量恢复ORACLE 11G X64,在PATH前面加上/tmp,再次require
引用
$ irb
irb(main):001:0> require 'oci8'
=> true
irb(main

如果直接替换64位的oci.dll,会报如下错误
引用
$ irb
irb(main):001:0> require 'oci8'
LoadError: Permission denied - /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/lib/oci8lib.so
        from /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/lib/oci8lib.so
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.2/lib/oci8.rb:20
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from (irb):1
irb(main):002:0> exit
0
0
分享到:
评论

相关推荐

    oracle oci 批量插入源代码

    6. **错误处理**:在实际应用中,源代码还会包含错误处理机制,例如oci_error函数用于获取错误信息,oci_handle_free释放资源,确保程序在遇到问题时能够正常运行并给出反馈。 7. **测试**:描述中提到示例代码经过...

    OCI简单封装类能动态返回记录集

    6. **错误处理**:封装类应有一个良好的错误处理机制,如异常处理,将oci的错误信息转化为易于理解的字符串。 7. **内存管理**:由于OCI API使用了大量指针和内存分配,封装类需要确保正确释放分配的内存,避免内存...

    64位 OCI.DLL

    oci.dll 是一个重要的动态链接库(Dynamic Link Library)文件,主要在64位操作系统环境下用于支持Oracle数据库的连接。在Windows系统中,DLL文件提供了一种方式,使得多个应用程序可以共享同一段代码和数据,从而...

    OCI接口类 OCI接口类

    OCI提供了丰富的错误处理机制,包括返回码、错误栈和诊断记录。通过`OCIGetError`和`OCIServerVersion`等函数,开发者可以捕获和报告错误信息。 8. 大型对象(LOBs) OCI提供对Oracle的BFILE、BLOB、CLOB和NCLOB...

    简单的oci案例源码

    - **删除(DELETE)**:删除操作是定位一条或多条记录并从表中移除它们,oci案例会包含这一功能的实现。 5. **事务管理**:oci案例可能会涉及到事务的开始、提交和回滚。`OCITransStart`用于开始事务,`...

    常用的OCI函数说明

    2. **错误处理**:OCI提供了一个错误句柄(`OCI_HTYPE_ERROR`),用于记录OCI调用时产生的任何错误信息。可以通过`OCIErrorGet()`函数来获取这些错误信息。 3. **服务上下文句柄**(`OCI_HTYPE_SVCCTX`):用于表示...

    linux C语言 oracle_11g oci 单行, 多行 获取oracle中的记录

    在IT行业中,Linux操作系统、C语言和Oracle数据库的结合是常见的技术栈,特别是在需要进行高效、底层数据库操作的场景...记住,进行oci编程时,务必正确配置环境,理解oci接口的使用方式,以及正确处理错误和资源管理。

    oci_class--oracle oci c++ class and example

    5. **异常处理**:在处理数据库操作时,oci_class 可能会封装Oracle OCI的错误处理,当出现错误时抛出C++异常,便于开发者捕获和处理。 6. **预编译语句和参数绑定**:oci_class 可能支持预编译SQL语句,提高执行...

    oci导出工具,oracle数据导出工具

    lu.txt文件可能是运行oci导出工具时生成的输出日志,记录了导出过程的详细信息,包括成功操作、警告和错误,这对于排查问题和了解导出进度非常有帮助。 oci导出工具的优势在于它可以实现高效的数据导入导出,特别是...

    OCI编程简介

    - **错误句柄**: 记录OCI函数调用过程中产生的错误信息。通过`OCIErrorGet()`函数可以从错误句柄中获取具体的错误详情。 - **服务器环境句柄**: 包括服务器、用户会话和事务等不同层次的信息。 - **服务器句柄**: ...

    Oracle OCI API封装类Oracle OCI API封装类

    Oracle OCI(Oracle Call Interface)是Oracle数据库提供的一种C语言接口,允许开发者直接与数据库进行交互,实现高效且低级别的数据库操作。OCI提供了丰富的API函数,用于执行SQL语句、处理结果集、管理游标、事务...

    c#封装oracle的OCI

    6. 错误处理:在每个关键操作中添加适当的异常处理,捕获并记录Oracle数据库可能出现的错误。 7. 部署注意事项:封装后,虽然应用可以不再依赖Oracle客户端的全局安装,但用户仍需要在机器上安装Oracle Data Access...

    oci-oracle.rar_OCI oracle_oci_oracle

    oci-oracle.rar_OCI oracle_oci_oracle是一个与Oracle数据库交互的示例,它使用了Oracle Call Interface (OCI)技术来实现一个简单的图书馆管理系统。OCI是Oracle提供的C语言编程接口,允许开发者直接与Oracle数据库...

    Oracle数据访问 获取记录总数

    在开发应用程序时,我们经常需要与数据库进行交互,获取记录总数是一项基本但至关重要的任务。本篇文章将深入探讨如何在Visual C++ 6.0(简称VC6)环境下,利用MFC(Microsoft Foundation Classes)和OO4O(Object ...

    Oracle oci 87报错 instanticlient_10_2 64位

    错误的连接字符串或配置可能导致oci错误。 6. **权限问题**:运行应用程序的用户需要有足够的权限访问Instant Client的文件和执行网络连接。 解决这个问题的步骤可能包括: 1. 检查并调整系统资源,确保有足够的...

    OCI函数 中文的

    - **OCI错误句柄**(OCI_HTYPE_ERROR):用于记录OCI操作过程中的错误信息,可以通过`OCIErrorGet()`函数获取错误详情。 - **OCI服务上下文句柄**(OCI_HTYPE_SVCCTX):代表与数据库之间的连接。 - **OCI服务器句柄...

Global site tag (gtag.js) - Google Analytics