Basic operation of Sqoop ETL tool
Basic operation of Sqoop ETL tool View sqoop command description
Sqoop help
View the instructions for a command:
Sqoop cammond-help
From orange,mysql to hdfs
Sqoop import-connect jdbc:oracle:thin:@192.168.1.254:1521:orcl-username bd_user-password bd_user-table GS_B_GY_DWCPNYXHBJG_S-target-dir'/ user//'-m 1
Sqoop import-connect jdbc:mysql://192.168.1.232:3307/bigdatamanager-username root-password root-table gbi_pd_log-target-dir / user/hehe-m 1
From oracle,mysql to hive
Sqoop import-all-tables-- connect jdbc:oracle:thin:@192.168.1.232:14231:xe-- username bhl_user-- password bhl_user-- hive-database bhl_user-M1-- create-hive-table-- hive-import-hive-overwrite
Sqoop import-connect jdbc:oracle:thin:@192.168.1.232:14231:xe-username bhl_user-password bhl_user-table BD_ECO_TX_2015_0516
Sqoop import-- connect jdbc:oracle:thin:@192.168.1.232:14231:xe-- username bhl_user-- password bhl_user-- table BD_ECO_TX_2015_0516-hive-import-hive-database bhl_user-m 1 (the screenshot of the oracle connection will not be written here, here is the test of mysql)
=
List the databases:
Sqoop list-databases-connect jdbc:mysql://192.168.1.232:3307/bigdatamanager-username root-password root
List the tables in the bigdatamanager database
Sqoop list-tables-connect jdbc:mysql://192.168.1.232:3307/bigdatamanager-username root-password root
From mysql to hive
Sqoop import-connect jdbc:mysql://192.168.1.232:3307/bigdatamanager-username root-password root-table insurance_yearcost-hive-import