You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This document is a collection of examples of Sqoop commands and arguments that are commonly used together. Its a good starting place for those overwhelmed by all the Sqoop configuration options and want to start exploring with something tried and true.

Importing a small table from DB2 (using one map process):

sqoop import --driver com.ibm.db2.jcc.DB2Driver --connect jdbc:db2://db2host:50000/DBNAME 
--username USER --password passw0rd --table MYTABLE -m 1

Import from Oracle to Avro file (using 6 map processes):

Note: User name and table name must be ALL CAPS. You'll get exceptions about lack of columns or non-existent table otherwise.

sqoop import --connect "jdbc:oracle:thin:@(description=(address=(protocol=tcp)(host=orahost)(port=1521))(connect_data=(service_name=myser)))"  
--username SCOTT --password tiger --table MYTABLE -m 6 --as-avrodatafile --warehouse-dir /staging/sqoop/MYTABLE

  • No labels