Skip to content

Instantly share code, notes, and snippets.

@tmusabbir
Last active December 25, 2015 18:19
Show Gist options
  • Save tmusabbir/7019840 to your computer and use it in GitHub Desktop.
Save tmusabbir/7019840 to your computer and use it in GitHub Desktop.
Sqoop import/export from/to Oracle
Sqoop import/export from/to Oracle
1212 John Smith Accountant
1213 Brian Pitt Economist
\\N \\N \\N \\N
.....
.....
8823 Oliver Hoff Programmer
--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
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'
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