免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6943 | 回复: 8
打印 上一主题 下一主题

[求助] 安装libsqlora8-2.3.3出错,请大家帮忙看下! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-05-05 14:18 |只看该作者 |倒序浏览
刚学oracle,想用C语言连接oracle,现在安装libsqlora8-2.3.3来实现连接。但安装libsqlora8-2.3.3遇到错误,Cannot link with oracle !!!  
检查了ld.so.conf文件看没有什么问题的,进oracle也是可以的。不知道为什么连接不了。请大家帮忙看下!谢谢.


[oracle@db libsqlora8-2.3.3]$ ./configure
................
................
checking for usleep... yes
checking if compiler supports -Wl,-R... yes
checking Oracle version >= 8.0... 11.2.0.
checking linking with oracle shared libs (-lclntsh -ldl -lm -lpthread -lnsl -lirc -lipgo -lsvml) works... no

Cannot link with oracle !!!
LDFLAGS=-L/home/oracle/app/oracle/product/11.2.0/dbhome_1/lib -Wl,-R/home/oracle/app/oracle/product/11.2.0/dbhome_1/lib
LIBS=-lclntsh -ldl -lm -lpthread -lnsl -lirc -lipgo -lsvml


[oracle@db bsqlora8-2.3.3]$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
/home/oracle/app/oracle/product/11.2.0/dbhome_1/lib
/home/oracle/app/oracle/product/11.2.0/client_1
[oracle@db bsqlora8-2.3.3]$


[oracle@db bsqlora8-2.3.3]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon May 5 14:13:53 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>



论坛徽章:
17
天蝎座
日期:2014-03-10 14:35:04数据库技术版块每日发帖之星
日期:2015-12-13 06:20:00IT运维版块每日发帖之星
日期:2015-12-13 06:20:00数据库技术版块每日发帖之星
日期:2015-10-20 06:20:00数据库技术版块每日发帖之星
日期:2015-08-21 06:20:00数据库技术版块每日发帖之星
日期:2015-06-17 22:20:002015年迎新春徽章
日期:2015-03-04 09:57:092015年辞旧岁徽章
日期:2015-03-03 16:54:15技术图书徽章
日期:2015-01-12 17:05:35亥猪
日期:2014-11-09 13:05:04金牛座
日期:2014-09-25 11:28:54处女座
日期:2014-09-15 19:58:36
2 [报告]
发表于 2014-05-05 15:03 |只看该作者
启动数据库了吗?

论坛徽章:
0
3 [报告]
发表于 2014-05-05 15:19 |只看该作者

SQL> startup;
ORACLE instance started.

Total System Global Area 1620115456 bytes
Fixed Size                  2213816 bytes
Variable Size             939526216 bytes
Database Buffers          671088640 bytes
Redo Buffers                7286784 bytes
Database mounted.
Database opened.
SQL> select * from phonenumber;

        ID NUMBERS
---------- --------------------
         0 13632510111
         1 13632510222
         2 13632510333

SQL>


ps -aux

oracle   26952  0.0  0.4 1820060 18588 ?       Ss   15:13   0:00 ora_pmon_ora11g
oracle   26956  0.0  0.3 1817948 15508 ?       Ss   15:13   0:00 ora_vktm_ora11g
oracle   26962  0.0  0.3 1817948 15592 ?       Ss   15:13   0:00 ora_gen0_ora11g
oracle   26966  0.0  0.3 1817948 15444 ?       Ss   15:13   0:00 ora_diag_ora11g
oracle   26970  0.0  0.6 1818484 23992 ?       Ss   15:13   0:00 ora_dbrm_ora11g
oracle   26974  0.0  0.3 1817948 15652 ?       Ss   15:13   0:00 ora_psp0_ora11g
oracle   26978  0.0  0.4 1818460 19012 ?       Ss   15:13   0:00 ora_dia0_ora11g
oracle   26982  3.7  1.4 1817948 57060 ?       Ss   15:13   0:04 ora_mman_ora11g
oracle   26986  0.0  0.6 1824216 25128 ?       Ss   15:13   0:00 ora_dbw0_ora11g
oracle   26990  0.1  0.9 1833500 39728 ?       Ss   15:13   0:00 ora_lgwr_ora11g
oracle   26994  0.0  0.4 1818460 18804 ?       Ss   15:13   0:00 ora_ckpt_ora11g
oracle   26998  0.1  0.8 1818504 35096 ?       Ss   15:13   0:00 ora_smon_ora11g
oracle   27002  0.0  0.5 1818468 22740 ?       Ss   15:13   0:00 ora_reco_ora11g
oracle   27006  0.3  1.6 1823788 65064 ?       Ss   15:13   0:00 ora_mmon_ora11g
oracle   27010  0.0  0.5 1817948 20552 ?       Ss   15:13   0:00 ora_mmnl_ora11g
oracle   27014  0.0  0.3 1819784 15640 ?       Ss   15:13   0:00 ora_d000_ora11g
oracle   27018  0.0  0.3 1819012 14836 ?       Ss   15:13   0:00 ora_s000_ora11g
oracle   27086  0.0  0.4 1818968 19248 ?       Ss   15:13   0:00 ora_p000_ora11g
oracle   27090  0.0  0.4 1818968 19592 ?       Ss   15:13   0:00 ora_p001_ora11g
oracle   27094  0.0  0.4 1817948 17536 ?       Ss   15:13   0:00 ora_qmnc_ora11g
oracle   27136  0.3  1.3 1824648 53268 ?       Ss   15:13   0:00 ora_cjq0_ora11g
oracle   27140  0.1  0.8 1819532 31892 ?       Ss   15:14   0:00 ora_q000_ora11g
oracle   27144  0.0  0.4 1817944 18484 ?       Ss   15:14   0:00 ora_q001_ora11g
oracle   27425  0.4  0.6 1819524 25304 ?       Ss   15:15   0:00 ora_j000_ora11g
oracle   27441  0.2  0.3 1817944 15220 ?       Ss   15:15   0:00 ora_j001_ora11g

能查表格了,同时也有进程了,应该是启动数据库了。但还是安装不行,还是出现。Cannot link with oracle !!!

论坛徽章:
7
天蝎座
日期:2013-08-16 23:19:32丑牛
日期:2014-01-08 09:20:14寅虎
日期:2014-01-11 11:03:44午马
日期:2014-04-28 11:02:40天秤座
日期:2014-05-16 23:24:24摩羯座
日期:2014-07-20 10:46:04卯兔
日期:2014-08-08 15:21:41
4 [报告]
发表于 2014-05-05 20:56 |只看该作者
再次检查一下连接程序。

论坛徽章:
0
5 [报告]
发表于 2014-05-06 09:21 |只看该作者
本帖最后由 topstar_allan 于 2014-05-06 09:23 编辑

虽然看到是有进程,也能查表,但我没有看到1521的端口哦,奇怪。

[oracle@db ~]$ netstat -l -n
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:6982                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:798                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:38239               0.0.0.0:*                   LISTEN
udp        0      0 0.0.0.0:792                 0.0.0.0:*
udp        0      0 0.0.0.0:795                 0.0.0.0:*
udp        0      0 0.0.0.0:61219               0.0.0.0:*
udp        0      0 127.0.0.1:45378             0.0.0.0:*
udp        0      0 127.0.0.1:1869              0.0.0.0:*
udp        0      0 0.0.0.0:52183               0.0.0.0:*
udp        0      0 0.0.0.0:5595                0.0.0.0:*
udp        0      0 127.0.0.1:15073             0.0.0.0:*
udp        0      0 0.0.0.0:5353                0.0.0.0:*
udp        0      0 0.0.0.0:111                 0.0.0.0:*
udp        0      0 0.0.0.0:631                 0.0.0.0:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     5247   @ISCSIADM_ABSTRACT_NAMESPACE
unix  2      [ ACC ]     STREAM     LISTENING     8354   /tmp/.font-unix/fs7100
unix  2      [ ACC ]     STREAM     LISTENING     8840   /tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     8811   /tmp/.gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     6643   @/var/run/hald/dbus-eDPN0ZrLBe
unix  2      [ ACC ]     STREAM     LISTENING     5230   @ISCSID_UIP_ABSTRACT_NAMESPACE
unix  2      [ ACC ]     STREAM     LISTENING     8070   /dev/gpmctl
unix  2      [ ACC ]     STREAM     LISTENING     6213   /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     6312   /var/run/pcscd.comm
unix  2      [ ACC ]     STREAM     LISTENING     6347   /var/run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     8016   /var/run/cups/cups.sock
unix  2      [ ACC ]     STREAM     LISTENING     8523   /var/run/avahi-daemon/socket
unix  2      [ ACC ]     STREAM     LISTENING     6642   @/var/run/hald/dbus-ER9IqXzKGx
[oracle@db ~]$

论坛徽章:
0
6 [报告]
发表于 2014-05-06 16:23 |只看该作者
本帖最后由 topstar_allan 于 2014-05-06 16:23 编辑

[oracle@db libsqlora8-2.3.3]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-MAY-2014 16:22:28

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                06-MAY-2014 14:16:06
Uptime                    0 days 2 hr. 6 min. 21 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /home/oracle/app/oracle/diag/tnslsnr/pbx/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.24.100.235)(PORT=1521)))
The listener supports no services
The command completed successfully


[oracle@db libsqlora8-2.3.3]$ tnsping orcl

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 06-MAY-2014 16:19:42

Copyright (c) 1997, 2009, Oracle.  All rights reserved.

Used parameter files:
/home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.24.100.235)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (0 msec)
[oracle@db libsqlora8-2.3.3]$

监听启动了。1521端口也有了,但还是安装这个libsqlora8-2.3.4还是出错。Cannot link with oracle !!!  

论坛徽章:
0
7 [报告]
发表于 2014-05-09 19:31 |只看该作者
编译libsqlora8和oracle起不起来完全没有关系
确认libclntsh.so之类的库函数地址
实在不行,设置环境变量LD_LIBRARY_PATH,把oracle库函数路径加进去

论坛徽章:
0
8 [报告]
发表于 2014-12-04 10:34 |只看该作者
你好 我是刚接触oracle,要搭个环境,linux下安装了客户端,安装这个sqlora库的时候也遇到了你的问题,请问下你解决了吗?求告诉解决方法!!!

checking for usleep... yes
checking if compiler supports -Wl,-R... no
checking if compiler supports -Wl,-rpath,... yes
Using user specified oracle version: 11.02
cat: /opt/oracle/lib/ldflags: No such file or directory
checking linking with oracle shared libs (-lclntsh  -lm) works... no

Cannot link with oracle !!!
LDFLAGS=-L/opt/oracle/lib -Wl,-rpath,/opt/oracle/lib
LIBS=-lclntsh  -lm

论坛徽章:
17
天蝎座
日期:2014-03-10 14:35:04数据库技术版块每日发帖之星
日期:2015-12-13 06:20:00IT运维版块每日发帖之星
日期:2015-12-13 06:20:00数据库技术版块每日发帖之星
日期:2015-10-20 06:20:00数据库技术版块每日发帖之星
日期:2015-08-21 06:20:00数据库技术版块每日发帖之星
日期:2015-06-17 22:20:002015年迎新春徽章
日期:2015-03-04 09:57:092015年辞旧岁徽章
日期:2015-03-03 16:54:15技术图书徽章
日期:2015-01-12 17:05:35亥猪
日期:2014-11-09 13:05:04金牛座
日期:2014-09-25 11:28:54处女座
日期:2014-09-15 19:58:36
9 [报告]
发表于 2014-12-05 18:23 |只看该作者
请楼主兄弟@topstar_allan分享一下该问题的处理经验给@wen880808,谢谢!~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP