Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Sqoop Import Oracle Error

avatar
Expert Contributor

Hi,

I got the below error using Sqoop on HDP 2.4.2 to import data from Oracle. The generate SQL seems to be wrong. It double quotes the table name ("logs") and also has a strange WHERE condition (1=0). I am using

sqoop import --connect jdbc:oracle:thin:@//xxxxxx:1521/ORCL --username admin --password xxxx --table logs --target-dir /user/centos/input/oracle -m 1

16/05/30 23:27:31 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM "logs" t WHERE 1=0 16/05/30 23:27:31 ERROR manager.SqlManager: Error executing statement: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

1 ACCEPTED SOLUTION

avatar
Super Guru

@yjiang

If table is exist in ORCL database then can you please try using table name in capital letter? i.e LOGS

sqoop import --connect jdbc:oracle:thin:@//xxxxxx:1521/ORCL --username ADMIN --password xxxx --table LOGS --target-dir /user/centos/input/oracle -m 1

Also we need to specify the user name in capital letter as per below sqoop doc.

https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html#_oracle_case_sensitive_catalog_qu...

View solution in original post

2 REPLIES 2

avatar
Super Guru

@yjiang

If table is exist in ORCL database then can you please try using table name in capital letter? i.e LOGS

sqoop import --connect jdbc:oracle:thin:@//xxxxxx:1521/ORCL --username ADMIN --password xxxx --table LOGS --target-dir /user/centos/input/oracle -m 1

Also we need to specify the user name in capital letter as per below sqoop doc.

https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html#_oracle_case_sensitive_catalog_qu...

avatar
Expert Contributor

Thanks, @Jitendra Yadav

Changing table name and user name to capital letter solved the issue.