Support Questions
Find answers, ask questions, and share your expertise

Errors when sqoop importing data from oracle10.0.2

Errors when sqoop importing data from oracle10.0.2

New Contributor

cloudera-quickstart-vm-5.8

oracle10.0.2

----------------------------------------------------------------------------------------

[cloudera@quickstart lib]$ sqoop import-all-tables -m 1 --connect jdbc:oracle:thin:@10.160.160.217:1521:cloudera --username=sys --password=mtxszx --as-parquetfile
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
16/10/26 16:52:41 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.8.0
16/10/26 16:52:41 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
16/10/26 16:52:41 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
16/10/26 16:52:41 INFO manager.SqlManager: Using default fetchSize of 1000
16/10/26 16:52:42 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.sqoop.manager.OracleManager.listTables(OracleManager.java:760)
at org.apache.sqoop.tool.ImportAllTablesTool.run(ImportAllTablesTool.java:95)
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)

---------------------------------------------------------------------------

I have copied the ojdbc6.jar to /usr/lib/sqoop/lib.

I have tried many oracle database servers, but never succeed.

Should i install a oracle client for the linux on whick cloudera is running ?

thx. in advance.

9 REPLIES 9

Re: Errors when sqoop importing data from oracle10.0.2

New Contributor

cann't import data from oracle

Re: Errors when sqoop importing data from oracle10.0.2

Champion

Could you verify your service name with tnsnames.ora and also make sure there is no firewall between your node and oracle . You may also want to take look in to this  bug SQOOP-2571. where you able to import table with different type of file other than parquet . Connect string with oracle is sometimes tedious , try the below command 

and could you let me know

 --connect  "jdbc:oracle:thin:username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyIPAddress)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=Your service name )))"

Re: Errors when sqoop importing data from oracle10.0.2

New Contributor

thank you. i have tried this database connect strings,but it didn't work.

------------------------------------------------------------------------------------------

[cloudera@quickstart lib]$ sqoop import-all-tables -m 1 --connect "jdbc:oracle:thin:sys/mtxszx@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.160.160.217)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=cloudera)))"
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
16/10/28 14:17:28 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.8.0
16/10/28 14:17:29 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
16/10/28 14:17:29 INFO manager.SqlManager: Using default fetchSize of 1000
16/10/28 14:17:31 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.sqoop.manager.OracleManager.listTables(OracleManager.java:760)
at org.apache.sqoop.tool.ImportAllTablesTool.run(ImportAllTablesTool.java:95)
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)

--------------------------------------------------------------------------

Re: Errors when sqoop importing data from oracle10.0.2

Champion

 1. if you are using the vm in your laptop ,did you disable the OS firewall. 

also , 2 . Can you check 1521 is open from the node your are hitting  to your host ip?

 

here is an example using netcat:
from node01:
nc -z 10.5.44.240 1521

 3. Can you check the permission on ojdbc6.jar file on the lib folder. 

 

Since Null pointer exception is a  generic exception i am throwing  my guess. 

Re: Errors when sqoop importing data from oracle10.0.2

New Contributor
Thank you very much, but i had try, it did not work.

Re: Errors when sqoop importing data from oracle10.0.2

Champion
Could you please let me know your oracle Jdbc driver version .



--
Sent from iPad

Re: Errors when sqoop importing data from oracle10.0.2

New Contributor
ojdbc6.jar oracle10.0.2

Re: Errors when sqoop importing data from oracle10.0.2

Champion

Let us insert the --driver in the sqoop command , please let me know if that works 

sqoop import-all-tables --driver oracle.jdbc.driver.OracleDriver  -m 1 --connect jdbc:oracle:thin:@10.160.160.217:1521:cloudera --username=sys --password=mtxszx --as-parquetfile

Re: Errors when sqoop importing data from oracle10.0.2

New Contributor

Yes, It works for me 

I inserted the driver in the sqoop command:

 

sqoop-list-tables --driver oracle.jdbc.driver.OracleDriver --connect jdbc:oracle:thin:@88.88.88.88:1521/epmt11 --username MyUserName --password MayPassword

 

thanks.