title: Sqoop error on data fetch from Oracle Database using Oracle wallet
body: <pre><code>sqoop import -D mapred.map.child.java.opts='-Doracle.net.tns_admin=. -Doracle.net.wallet_location=.' -files $HOME/wallet/cwallet.sso,$HOME/wallet/ewallet.p12,$HOME/wallet/sqlnet.ora,$HOME/wallet/tnsnames.ora --connect jdbc:oracle:thin:@TEST2 --table SQOOP_TEST
  </code></pre>
  
  <p>Am using this sqoop command to fetch data from Oracle DB but ending with below error</p>
  
  <blockquote>
    <p>ERROR manager.SqlManager: Error executing statement: java.sql.SQLRecoverableException: IO Error: Unknown host specified</p>
  </blockquote>
  
  <p>My Wallet:
  <strong>tnsnames.ora</strong></p>
  
  <pre><code>TEST2=   (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = &lt;IP&gt;)(PORT = 1521))
      )
      (CONNECT_DATA = (server=dedicated)
        (SERVICE_NAME = HDPTEST )
      )   )
  </code></pre>
  
  <p>Wallet works fine,</p>
  
  <blockquote>
    <p>$sqlplus /@TEST2</p>
    
    <p>SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 8 14:48:42 2017</p>
    
    <p>Copyright (c) 1982, 2013, Oracle.  All rights reserved.</p>
    
    <p>Connected to: Oracle Database 11g Enterprise Edition Release
    11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
    
    <p>SQL></p>
  </blockquote>
  
  <p>JDBC without uding wallet works fine,</p>
  
  <blockquote>
    <p>jdbc:oracle:thin:@:1521/HDPTEST</p>
  </blockquote>
  
  <p><strong>Detailed Log</strong></p>
  
  <pre><code>Warning: /usr/local/hbase does not exist! HBase imports will fail.
  Please set $HBASE_HOME to the root of your HBase installation.
  Warning: /usr/local/sqoop/../hcatalog does not exist! HCatalog jobs will fail.
  Please set $HCAT_HOME to the root of your HCatalog installation.
  Warning: /usr/local/sqoop/../accumulo does not exist! Accumulo imports will fail.
  
  Please set $ACCUMULO_HOME to the root of your Accumulo installation.
  17/06/08 15:06:15 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
  17/06/08 15:06:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  17/06/08 15:06:16 DEBUG tool.BaseSqoopTool: Enabled debug logging.
  17/06/08 15:06:16 DEBUG sqoop.ConnFactory: Loaded manager factory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
  17/06/08 15:06:16 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
  17/06/08 15:06:16 DEBUG sqoop.ConnFactory: Trying ManagerFactory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
  17/06/08 15:06:16 DEBUG oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop can be called by Sqoop!
  17/06/08 15:06:16 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
  17/06/08 15:06:16 DEBUG sqoop.ConnFactory: Trying ManagerFactory: com.cloudera.sqoop.manager.DefaultManagerFactory
  17/06/08 15:06:16 DEBUG manager.DefaultManagerFactory: Trying with scheme: jdbc:oracle:thin
  17/06/08 15:06:16 DEBUG manager.OracleManager$ConnCache: Instantiated new connection cache.
  17/06/08 15:06:16 INFO manager.SqlManager: Using default fetchSize of 1000
  17/06/08 15:06:16 DEBUG sqoop.ConnFactory: Instantiated ConnManager org.apache.sqoop.manager.OracleManager@1d2adfbe
  17/06/08 15:06:16 INFO tool.CodeGenTool: Beginning code generation
  17/06/08 15:06:16 DEBUG manager.OracleManager: Using column names query: SELECT t.* FROM SQOOP_TEST t WHERE 1=0
  17/06/08 15:06:16 DEBUG manager.SqlManager: Execute getColumnInfoRawQuery : SELECT t.* FROM SQOOP_TEST t WHERE 1=0
  17/06/08 15:06:16 DEBUG manager.OracleManager: Creating a new connection for jdbc:oracle:thin:@TEST2, using username: null
  17/06/08 15:06:16 DEBUG manager.OracleManager: No connection paramenters specified. Using regular API for making connection.
  17/06/08 15:06:16 ERROR manager.SqlManager: Error executing statement: java.sql.SQLRecoverableException: IO Error: Unknown host specified 
  java.sql.SQLRecoverableException: IO Error: Unknown host specified 
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743)
      at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)
      at java.sql.DriverManager.getConnection(DriverManager.java:664)
      at java.sql.DriverManager.getConnection(DriverManager.java:270)
      at org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:325)
      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: Unknown host specified 
      at oracle.net.resolver.HostnameNamingAdapter.resolve(HostnameNamingAdapter.java:207)
      at oracle.net.resolver.NameResolver.resolveName(NameResolver.java:131)
      at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:476)
      at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:595)
      at oracle.net.ns.NSProtocol.connect(NSProtocol.java:230)
      at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
      ... 24 more
  17/06/08 15:06:16 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter
      at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1651)
      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)
  </code></pre>
  
  <p>Please help me out to find where am wrong.</p>