Last active
December 25, 2015 18:19
-
-
Save tmusabbir/7019840 to your computer and use it in GitHub Desktop.
Sqoop import/export from/to Oracle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sqoop import/export from/to Oracle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1212 John Smith Accountant | |
1213 Brian Pitt Economist | |
\\N \\N \\N \\N | |
..... | |
..... | |
8823 Oliver Hoff Programmer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--connect | |
jdbc:oracle:thin:@//10.0.0.24:1521/test | |
--username | |
username1 | |
--password | |
password1 | |
--table | |
EMPLOYEE_REPORTING.EMPLOYEE | |
--fields-terminated-by | |
\t | |
--class-name | |
com.example.reporting.Employee | |
--verbose | |
--split-by | |
ID | |
--where | |
ID <= 100000 | |
--target-dir | |
/user/ambari_qa/reporting/input | |
-m | |
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqoop export \ | |
--connect jdbc:oracle:thin:@//10.0.0.24:1521/test \ | |
--username username1 \ | |
--password password1 \ | |
--table EMPLOYEE_REPORTING.EMP_RECORD \ | |
--export-dir /apps/hive/warehouse/emp_record \ | |
--input-fields-terminated-by "\t" \ | |
--input-lines-terminated-by "\n" \ | |
--verbose \ | |
-m 8 \ | |
--input-null-string '\\N' \ | |
--input-null-non-string '\\N' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqoop import --connect jdbc:oracle:thin:@//10.0.0.24:1521/test \ | |
--username username1 \ | |
--password password1 \ | |
--table EMPLOYEE_REPORTING.EMPLOYEE --fields-terminated-by \t | |
--class-name com.example.reporting.Employee \ | |
--verbose --split-by ID \ | |
--where 'ID <= 100000' \ | |
--target-dir /user/ambari_qa/reporting/input -m 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment