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

Unable to sqoop import all tables from an external DB having primary key

Unable to sqoop import all tables from an external DB having primary key


Hi All,

We are trying to import all the tables from an external DB using sqoop with below command.
It doesnt work and neither does it give any errors.

sqoop-import-all-tables --connect "jdbc:sqlserver://CTSINCHNVPDTDB2;database=DemandandCapacity" --username ApplensView --password ApplensView --hive-import -create-hive-table --hs2-url "jdbc:hive2://"

[5:39 PM] S, Venkatesh (Cognizant)
Warning: /opt/cloudera/parcels/CDH-7.1.4-1.cdh7.1.4.p0.6300266/bin/../lib/sqoop/../accumulo does not exist! Accumulo imports will fail. Please set $ACCUMULO_HOME to the root of your Accumulo installation.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-7.1.4-1.cdh7.1.4.p0.6300266/jars/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-7.1.4-1.cdh7.1.4.p0.6300266/jars/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
21/04/19 17:36:45 INFO sqoop.Sqoop: Running Sqoop version:
21/04/19 17:36:45 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
21/04/19 17:36:45 INFO tool.BaseSqoopTool: Using Hive-specific delimiters for output. You can override
21/04/19 17:36:45 INFO tool.BaseSqoopTool: delimiters with --fields-terminated-by, etc.
21/04/19 17:36:45 INFO manager.SqlManager: Using default fetchSize of 1000

Upon researching we could see that tables with no primary key or composite key or any varchar columns cannot be sqooped with sqoop-import-all-tables command.

Is there any other way to import all the Tables of a DB in a single shot using sqoop , which has tables with no primary keys ?
If there is no option in sqoop what is the alernative method to import all tables of a DB.

Please help as we need to ingest Data from external DBs which has many tables within it

Thank you!