Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop Import from Oracle with Wallet

Sqoop Import from Oracle with Wallet

New Contributor

Hi,

We are facing errors while trying to import data from Oracle configured with walletsFollowing is the error while executing the sqoop command

sqoop import --libjars /usr/local/sqoop/lib/oraclepki.jar -Djavax.net.ssl.trustStore=/home/hadoop/app/Wallets/client_wallet/ewallet.p12 -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword=WalletPasswd123 --connect jdbc:oracle:thin:@testssl --username neon_main --password bullet --table APP_INSTANCE --verbose

Here , testssl is the wallet name configured in the listerner.ora.

The error thrown is

17/06/30 12:38:01 DEBUG manager.DefaultManagerFactory: Trying with scheme: jdbc:oracle:thin

17/06/30 12:38:01 DEBUG manager.OracleManager$ConnCache: Instantiated new connection cache.

17/06/30 12:38:01 INFO manager.SqlManager: Using default fetchSize of 1000

17/06/30 12:38:01 DEBUG sqoop.ConnFactory: Instantiated ConnManager org.apache.sqoop.manager.OracleManager@1623b78d

17/06/30 12:38:01 INFO tool.CodeGenTool: Beginning code generation

17/06/30 12:38:01 DEBUG manager.OracleManager: Using column names query: SELECT t.* FROM APP_INSTANCE t WHERE 1=0

17/06/30 12:38:01 DEBUG manager.SqlManager: Execute getColumnInfoRawQuery : SELECT t.* FROM APP_INSTANCE t WHERE 1=0

17/06/30 12:38:01 DEBUG manager.OracleManager: Creating a new connection for jdbc:oracle:thin:@testssl, using username: neon_main

17/06/30 12:38:01 DEBUG manager.OracleManager: No connection paramenters specified. Using regular API for making connection.

17/06/30 12:38:02 ERROR manager.SqlManager: Error executing statement: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)

at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)

at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:327)

at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)

at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744)

at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767)

at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270)

at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)

at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:227)

at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295)

at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833)

at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)

at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)

at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)

at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)

at org.apache.sqoop.Sqoop.run(Sqoop.java:143)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)

at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)

at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)

at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)

at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection

at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:439) at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:454) at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340) ... 25 more

Caused by: oracle.net.ns.NetException: The method specified in wallet_location is not supported. Location: /home/hadoop/app/Wallets/client_wallet

at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:219)

at oracle.net.nt.TcpsNTAdapter.connect(TcpsNTAdapter.java:119)

at oracle.net.nt.ConnOption.connect(ConnOption.java:133)

at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:405) ... 30 more

Steps followed to cofigure the SSL with Oracle wallet is described below.

.We have configured SSL in Oracle using the instructions in the following link(have followed the same instructions for RHEL)

https://drive.google.com/open?id=0B5rPtj-mVRvPbEhFVlBNa0ZyRTg

1) Have created wallets for server & client.

2) Exchanged the wallets between the server and client

3) Able to successfully connect to the oracle using SSL through JDBC thin client

The sqlnet.ora content is as follows

17589-sqlnetora.png

The tnsnames.ora content is as follows

17590-tnsnamesora.png

The listener.ora content is as follows

17591-listenerora.png

I am able to sucessfully connect to the Database using JDBC client.The content of the java program and the files associated are attached.Note:Have truncated the ip before attaching the file jdbc-test.zip

17593-jdbc-connection.png

Any help would be much appreciated.

1 REPLY 1

Re: Sqoop Import from Oracle with Wallet

New Contributor

Is it working for you or still no luck ? I am also trying Sqoop with ssl enabled oracle db through oracle wallet but getting the same error? 

 

Can you please provide me the steps to configure if it is working for you ?

 

Thanks.

Don't have an account?
Coming from Hortonworks? Activate your account here