标签:
sqoop import --connect jdbc:db2://<server>:<port>/<database> --username username --password password --compress --compression-codec ‘com.hadoop.compression.lzo.LzopCodec‘ -table tablename --hcatalog-database hiveschema --hcatalog-table hivetable -m 1
其中 –table tablename为db2中的数据库database中的表 --hcatalog-database hiveschema 为hive中Schema --hcatalog-table hivetable为hive中表名称
sqoop import --connect jdbc:db2://<server>:<port>/<database> --username username --password password --compress --compression-codec ‘com.hadoop.compression.lzo.LzopCodec‘ -table tablename --columns <column> --hcatalog-database hiveschema --hcatalog-table hivetable --hive-partition-key <partition-name> --hive-partition-value <partition-value> -m 1
6) import-all-tables Import tables from a database to HDFS
7) export Export an HDFS directory to a database table
sqoop export --connect jdbc:db2://<server>:<port>/<database> --username username --password password -table tablename --hcatalog-database hiveschema --hcatalog-table hivetable -m 1
8) merge Merge results of incremental imports
9) job Work with saved jobs
10) metastore Run a standalone Sqoop metastore
sqoop version
11) help List available commands
sqoop help
sqoop COMMAND help
12) codegen Generate code to interact with database records
13) version Display version information
sqoop version
标签:
原文地址:http://www.cnblogs.com/longjshz/p/5524344.html