Hi,

You can try and add --verbose to the command so it shows which table is missing any grant.

Regards,

Douglas


On Sat, Apr 21, 2018 at 2:26 AM, 王斌 <496838491@qq.com> wrote:
Hello,
I would like to use Oracle Data Connector when using sqoop for direct mode, however it prompt following error. If i omit --direct parameter it works fine.

sqoop import --direct --connect XXXX --table HCCN.TEST_AD
ERROR tool.ImportTool: Import failed: java.io.IOException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

I am using sqoop 1.4.6 and following guidance below. Currently the user for connecting oracle is granted all privilege as following with additional "alter session" but select_catalog_role is not granted.
May i know why i can not use direct mode to pull data from oracle database?
  • select on v_$instance
  • select on dba_tables
  • select on dba_tab_columns
  • select on dba_objects
  • select on dba_extents
  • select on dba_segments — Required for Sqoop imports only
  • select on dba_constraints — Required for Sqoop imports only
  • select on v_$database — Required for Sqoop imports only
  • select on v_$parameter — Required for Sqoop imports only


25.8.2.2. Oracle Roles and Privileges

The Oracle user for The Data Connector for Oracle and Hadoop requires the following roles and privileges:

  • create session

In addition, the user must have the select any dictionary privilege or select_catalog_role role or all of the following object privileges:

  • select on v_$instance
  • select on dba_tables
  • select on dba_tab_columns
  • select on dba_objects
  • select on dba_extents
  • select on dba_segments — Required for Sqoop imports only
  • select on dba_constraints — Required for Sqoop imports only
  • select on v_$database — Required for Sqoop imports only
  • select on v_$parameter — Required for Sqoop imports only
Note

The user also requires the alter session privilege to make use of session tracing functionality. See "oraoop.oracle.session.initialization.statements" for more information.