Big Data Hadoop Certification Training
- 147k Enrolled Learners
- Live Class
1. Download the Oracle Expresss Edition from the below link and unzip it.
2. After extracting you will find a executable file of Oracle XE Edition as in the below image.
3. Double click on the OracleXEUniv to install Oracle database on your system and click on Run.
4. Click on Next
5. Accept the licence agreement and click on next.
6. By default oracle will take system as database name. Let us enter password
for this database.
Enter Password –> system
Confirm Password –> system
7. Click on Install
8. Click on Finish
9. Let us edit the sqlnet.ora file present in the folder
When you open it you will find the below content.
Edit it as in the Below Screen Shot
10. Let us start the SQL Command Line of Oracle.
Goto Start menu -> All Programs -> Oracle Database 10g Express Edition ->
Run SQL Command Line and double click on it.
11. You will get the Cli fo Oracle Database.
12. Let us connect to the Oracle database.
You will receive the message connected successfully.
13. Let us create a simple table.
create table emp (id number);
14. Let us insert some values in it by using Insert command.
insert into emp values(2);
15.Let us check if the data is inserted into the table by using Select Command.
select * from emp;
16. Let us commit the data.
17. To import the data from Oracle Database to Sqoop we need to add the
Oracle Connector (ojdbc6_g.jar).
You can download the jar from the below link.
18.Open Cloudera cdh3 and move Oracle connector to Cloudera cdh3 (To Desktop) using FileZilla.
Use the below link to understand how to move a file from Windows to cloudera cdh3 vm.
19. Once the Oracle connector is present on Cloudera Cdh3 Desktop, move it to the lib folder of
sqoop by executing the below command:
sudo cp /home/cloudera/Desktop/ojdbc6_g.jar /usr/lib/sqoop/lib/
20. Change the directory to Sqoop by executing the below command:
21. Open Command Prompt (CMD) on Windows and check the IPv4 Address
by executing the
22. Import the data of the table emp present in Oracle database to hdfs by executing the below
Required items for the command:
IPv4 Address – Your IPv4 address. In my case it is 192.168.46.1
Database Name – system
Table Name – emp
Username – system
Password – system
Output Directory – Could be any. I have used sqoopoutput1
sudo bin/sqoop import –connect jdbc:oracle:thin:system/
–username system -P –table system.emp –columns “ID” –target-dir /
sqoopoutput1 -m 1
23. When the command got executed successfully, you will receive the message
that Retrieved Records as in the below image.
24. Open the Browser and go to the below URL:
Click on Browse the filesystem
25. Click on sqoopoutput1 directory
26. Click on part-m-00000 file:
27.Below is the data that was imported from Oracle database:
Congratulations! You have Successfully Imported Data from Oracle Database
to HDFS Using Sqoop..!