Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Can we use Oracle SID in --connect option of sqoop loader?

avatar
Contributor

Geerally when we use --connect option in sqoop we use "jdbc:oracle:thin:@hostname:port/DB_SERVICE_NAME".

But can we user DB_SID instead of DB_SERVICE_NAME in connect option? If yes what will be the syntax for that.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Nilesh Shrimant

According to the JDBC Driver implementation it can take SID as well like, If the database to which you want to connect resides on host prodHost, at port 1521, and system identifier (SID) ORCL, and you want to connect with user name scott and password tiger, then use either of the two following connection strings:

Using host:port:sid 

syntax:
String connString="jdbc:oracle:thin:@prodHost:1521:ORCL";

NOTICE: After Port there is a Colon (:) and then SID.
https://docs.oracle.com/cd/B28359_01/java.111/b31224/jdbcthin.htm

Are you getting any error while using SID in the same URL ?

View solution in original post

3 REPLIES 3

avatar
Master Mentor

@Nilesh Shrimant

According to the JDBC Driver implementation it can take SID as well like, If the database to which you want to connect resides on host prodHost, at port 1521, and system identifier (SID) ORCL, and you want to connect with user name scott and password tiger, then use either of the two following connection strings:

Using host:port:sid 

syntax:
String connString="jdbc:oracle:thin:@prodHost:1521:ORCL";

NOTICE: After Port there is a Colon (:) and then SID.
https://docs.oracle.com/cd/B28359_01/java.111/b31224/jdbcthin.htm

Are you getting any error while using SID in the same URL ?

avatar
Master Mentor

@Nilesh Shrimant

Good to know that your issue is resolved. It will be wonderful if you can make the correct answer as "Accepted" so that it will be useful for other HCC users to quickly browse the answered threads.

avatar
Contributor

Hi @Jay SenSharma, Thanks very much for the information. "String connString="jdbc:oracle:thin:@prodHost:1521:ORCL" this worked fine.