无法通过Linux上的JDBC连接SQOOP到Oracle Timesten



我已经在linux上安装了timesten数据库(完整版((Linux是使用Cloudera VM安装的oracle viritual box的访客OS

我正在尝试按照linux上的sqoop命令进行运行,并以下错误

命令

sqoop list-tables --connect jdbc:timesten:direct:dsn=sampledb_1122 --driver com.timesten.jdbc.TimesTenDriver

**error**
ERROR manager.SqlManager: Error reading database metadata: java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc in java.library.path
java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc in java.library.path
    at com.timesten.jdbc.JdbcOdbcConnection.connect(JdbcOdbcConnection.java:1809)
    at com.timesten.jdbc.TimesTenDriver.connect(TimesTenDriver.java:305)
    at com.timesten.jdbc.TimesTenDriver.connect(TimesTenDriver.java:161)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:233)
    at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:878)
    at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
    at org.apache.sqoop.manager.SqlManager.listTables(SqlManager.java:520)
    at org.apache.sqoop.tool.ListTablesTool.run(ListTablesTool.java:49)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
Could not retrieve tables list from server
18/02/18 18:56:04 ERROR tool.ListTablesTool: manager.listTables() returned null

timesten bin和lib文件夹位置

/home/cloudra/timesten/timesten/tt1122_64/bin/home/cloudera/timesten/timesten/tt1122_64/lib

在我的环境和其他参数中设置以下值

USERNAME=cloudera
DESKTOP_SESSION=gnome
MAIL=/var/spool/mail/cloudera
PATH=/var/lib/sqoop:/home/cloudera/timesten/TimesTen/tt1122_64/bin:/home/cloudera/timesten/TimesTen/tt1122_64/lib:/home/cloudera/anaconda3/bin:/var/lib/sqoop:/home/cloudra/timesten/TimesTen/tt1122_64/bin:/home/cloudera/timesten/TimesTen/tt1122_64/lib:/home/cloudera/anaconda3/bin:/home/cloudera/anaconda3/bin:/usr/local/firefox:/sbin:/usr/java/jdk1.7.0_67-cloudera/bin:/usr/local/apache-ant/apache-ant-1.9.2/bin:/usr/local/apache-maven/apache-maven-3.0.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/cloudera/bin
PWD=/home/cloudera
THREAD_FLAGS=native
HOME=/home/cloudera
SHLVL=2
M2_HOME=/usr/local/apache-maven/apache-maven-3.0.4
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=cloudera
CVS_RSH=ssh
CLASSPATH=/home/cloudera/timesten/TimesTen/tt1122_64/lib/ttjdbc6.jar
[cloudera@quickstart ~]$ echo $LD_LIBRARY_PATH
/home/cloudera/timesten/TimesTen/tt1122_64/lib:/home/cloudera/timesten/TimesTen/tt1122_64/lib:
[cloudera@quickstart ~]$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
[cloudera@quickstart ~]$ 
cloudera@quickstart bin]$ ./ttversion 
TimesTen Release 11.2.2.8.0 (64 bit Linux/x86_64) (tt1122_64:53396) 2015-01-20T08:36:31Z
  Instance admin: cloudera
  Instance home directory: /home/cloudera/timesten/TimesTen/tt1122_64
  World accessible
  Daemon home directory: /home/cloudera/timesten/TimesTen/tt1122_64/info
  PL/SQL enabled.

除了上面.. ttjdbc6.jar文件位于以下位置

[cloudera@quickstart sqoop]$ pwd
/var/lib/sqoop
[cloudera@quickstart sqoop]$ ls -ltr
total 0
lrwxrwxrwx 1 root root 40 Jun  9  2015 mysql-connector-java.jar -> /usr/share/java/mysql-connector-java.jar
lrwxrwxrwx 1 root root 58 Feb 16 21:37 ttjdbc6.jar -> /home/cloudera/timesten/TimesTen/tt1122_64/lib/ttjdbc6.jar
[cloudera@quickstart timesten]$ pwd
/usr/lib/timesten
[cloudera@quickstart timesten]$ ls -ltr
total 276
-rwxrwxrwx 1 root root 279580 Feb 18 11:33 ttjdbc6.jar

java_library_path输出

[cloudera@quickstart timesten]$ java -XshowSettings:properties
Property settings:
    awt.toolkit = sun.awt.X11.XToolkit
    file.encoding = UTF-8
    file.encoding.pkg = sun.io
    file.separator = /
    java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
    java.awt.printerjob = sun.print.PSPrinterJob
    java.class.path = /home/cloudera/timesten/TimesTen/tt1122_64/lib/ttjdbc6.jar
    java.class.version = 51.0
    java.endorsed.dirs = /usr/java/jdk1.7.0_67-cloudera/jre/lib/endorsed
    java.ext.dirs = /usr/java/jdk1.7.0_67-cloudera/jre/lib/ext
        /usr/java/packages/lib/ext
    java.home = /usr/java/jdk1.7.0_67-cloudera/jre
    java.io.tmpdir = /tmp
    java.library.path = /home/cloudera/timesten/TimesTen/tt1122_64/lib
        /home/cloudera/timesten/TimesTen/tt1122_64/lib
        /usr/java/packages/lib/amd64
        /usr/lib64
        /lib64
        /lib
        /usr/lib
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.7.0_67-b01

我执行ttenv.sh脚本,但是当我检查env参数时,它没有设置任何参数,因此我必须手动进行。

Gurus and Expertes ..请在这里帮助我..不确定是什么问题以及为什么我会遇到上述错误。

感谢您的帮助..

这里的关键行是:

java.sql.SQLException: Problems with loading native library/missing methods: 
  no ttJdbc in java.library.path

TIMESTEN JDBC驱动程序是1/2驱动程序,它依赖于基础的时间斯滕本机库。具体而言,它需要位于<TimesTen_install_dir>/lib中的几个共享库,例如libttJdbc.so(错误正在抱怨(,libtten.so等。通常,您需要确保java.library.path包括此目录(似乎是这种情况(,并且CLASSPATH在该目录中包括ttjdbc7.jar文件。另一种可能性是,您的时间安装是"仅客户端"安装的,在这种情况下,您无法使用"直接"驱动程序,如果您尝试这样做,则将获得此确切的错误。我建议检查您是否实际上在<TimesTen_install_dir>/lib中是否有文件libttJdbc.solibtten.so,如果不是,则意味着您只有一个客户端安装并需要配置/使用客户端/服务器连接。

相关内容

  • 没有找到相关文章