Reply
YP
New Contributor
Posts: 1
Registered: ‎03-05-2019

Sqoop connect to Oracle problem

[ Edited ]

Hi,

 

I have done some searching and can't seem to find a solution to my problem.  

 

I am new to using Hadoop and sqoop and am trying to connect to our Oracle databases, however when I try I simply don't get any conenction established.

 

For example:

-bash-4.2$ sqoop list-tables --verbose --connect jdbc:oracle:thin:@lshdb03.biopharm.com:1521:lsh3/APPS
Warning: /opt/sqoop/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /opt/sqoop/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
Error: Could not find or load main class org.apache.hadoop.hbase.util.GetJavaProperty
19/03/05 07:54:01 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
19/03/05 07:54:01 DEBUG tool.BaseSqoopTool: Enabled debug logging.
19/03/05 07:54:01 DEBUG sqoop.ConnFactory: Loaded manager factory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
19/03/05 07:54:01 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
19/03/05 07:54:01 DEBUG sqoop.ConnFactory: Trying ManagerFactory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
19/03/05 07:54:01 DEBUG oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop can be called by Sqoop!
19/03/05 07:54:01 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
19/03/05 07:54:01 DEBUG sqoop.ConnFactory: Trying ManagerFactory: com.cloudera.sqoop.manager.DefaultManagerFactory
19/03/05 07:54:01 DEBUG manager.DefaultManagerFactory: Trying with scheme: jdbc:oracle:thin:@lshdb03.biopharm.com:1521
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avro/LogicalType
        at org.apache.sqoop.manager.DefaultManagerFactory.accept(DefaultManagerFactory.java:78)
        at org.apache.sqoop.ConnFactory.getManager(ConnFactory.java:184)
        at org.apache.sqoop.tool.BaseSqoopTool.init(BaseSqoopTool.java:272)
        at org.apache.sqoop.tool.ListTablesTool.run(ListTablesTool.java:44)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: org.apache.avro.LogicalType
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 10 more

If anyone can help me with this I would be very grateful.

 

Thanks

 

Bryan

 

Highlighted
Cloudera Employee
Posts: 7
Registered: ‎10-01-2018

Re: Sqoop connect to Oracle problem

Hi Bryan,

 

Please try to check the version of avro libraries you are using

$ rpm -qi avro-libs

 

 

if they are 1.7 version libraries then try to upgrade those libraries using yum command

$yum upgrade avro-libs

 

 

Please also check the prerequisites before using sqoop

https://www.cloudera.com/documentation/enterprise/5-15-x/topics/cdh_ig_sqoop_installation.html#topic...

for more documentation regarding sqoop please use the link ..which might help you for better under standing.

 

https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#

 

To check the supported database versions 

 

https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_supported_databases

 



Please use username and password as well for accessing the oracle database like below,If credentials are required.

sqoop import --connect jdbc:oracle:thin:@localhost:1521/orcl --username MOVIEDEMO --password welcome1

 

Regards,

Bhuvan

Announcements