hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ram <pramesh...@gmail.com>
Subject Re: sqoop oracle connection error
Date Thu, 05 Sep 2013 05:07:40 GMT
Hi Ravi,
   Thanks for post. The problem is listener and privileges and Database
name, username and tablename are in CAPITAL Letters. here is the query.

sqoop import --connect
jdbc:oracle:thin:@//ramesh.ops.cloudwick.com/CLOUD--username RAMESH
--password password --table TEST -m 1


Here is the output.

[root@ramesh bin]# sqoop import --connect jdbc:oracle:thin:@//
ramesh.ops.cloudwick.com/CLOUD --username RAMESH --password password
--table TEST -m 1
13/09/05 10:34:20 WARN tool.BaseSqoopTool: Setting your password on the
command-line is insecure. Consider using -P instead.

13/09/05 10:34:21 INFO manager.SqlManager: Using default fetchSize of 1000
13/09/05 10:34:21 INFO tool.CodeGenTool: Beginning code generation
13/09/05 10:34:22 INFO manager.OracleManager: Time zone has been set to GMT
13/09/05 10:34:22 INFO manager.SqlManager: Executing SQL statement: SELECT
t.* FROM TEST t WHERE 1=0
13/09/05 10:34:22 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is
/usr/lib/hadoop
13/09/05 10:34:22 INFO orm.CompilationManager: Found hadoop core jar at:
/usr/lib/hadoop/hadoop-core.jar
Note: /tmp/sqoop-root/compile/2633ca54b23921416d40e2bdd5141abb/TEST.java
uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
13/09/05 10:34:24 INFO orm.CompilationManager: Writing jar file:
/tmp/sqoop-root/compile/2633ca54b23921416d40e2bdd5141abb/TEST.jar
13/09/05 10:34:24 INFO manager.OracleManager: Time zone has been set to GMT
13/09/05 10:34:24 INFO manager.OracleManager: Time zone has been set to GMT
13/09/05 10:34:24 INFO mapreduce.ImportJobBase: Beginning import of TEST
13/09/05 10:34:25 INFO manager.OracleManager: Time zone has been set to GMT
13/09/05 10:34:29 INFO mapred.JobClient: Running job: job_201309051031_0001
13/09/05 10:34:30 INFO mapred.JobClient:  map 0% reduce 0%
13/09/05 10:34:44 INFO mapred.JobClient:  map 100% reduce 0%
13/09/05 10:34:46 INFO mapred.JobClient: Job complete: job_201309051031_0001
13/09/05 10:34:46 INFO mapred.JobClient: Counters: 18
13/09/05 10:34:46 INFO mapred.JobClient:   Job Counters
13/09/05 10:34:46 INFO mapred.JobClient:     SLOTS_MILLIS_MAPS=12771
13/09/05 10:34:46 INFO mapred.JobClient:     Total time spent by all
reduces waiting after reserving slots (ms)=0
13/09/05 10:34:46 INFO mapred.JobClient:     Total time spent by all maps
waiting after reserving slots (ms)=0
13/09/05 10:34:46 INFO mapred.JobClient:     Launched map tasks=1
13/09/05 10:34:46 INFO mapred.JobClient:     SLOTS_MILLIS_REDUCES=0
13/09/05 10:34:46 INFO mapred.JobClient:   File Output Format Counters
13/09/05 10:34:46 INFO mapred.JobClient:     Bytes Written=24
13/09/05 10:34:46 INFO mapred.JobClient:   FileSystemCounters
13/09/05 10:34:46 INFO mapred.JobClient:     HDFS_BYTES_READ=87
13/09/05 10:34:46 INFO mapred.JobClient:     FILE_BYTES_WRITTEN=58070
13/09/05 10:34:46 INFO mapred.JobClient:     HDFS_BYTES_WRITTEN=24
13/09/05 10:34:46 INFO mapred.JobClient:   File Input Format Counters
13/09/05 10:34:46 INFO mapred.JobClient:     Bytes Read=0
13/09/05 10:34:46 INFO mapred.JobClient:   Map-Reduce Framework
13/09/05 10:34:46 INFO mapred.JobClient:     Map input records=6
13/09/05 10:34:46 INFO mapred.JobClient:     Physical memory (bytes)
snapshot=117080064
13/09/05 10:34:46 INFO mapred.JobClient:     Spilled Records=0
13/09/05 10:34:46 INFO mapred.JobClient:     CPU time spent (ms)=2320
13/09/05 10:34:46 INFO mapred.JobClient:     Total committed heap usage
(bytes)=105775104
13/09/05 10:34:46 INFO mapred.JobClient:     Virtual memory (bytes)
snapshot=861552640
13/09/05 10:34:46 INFO mapred.JobClient:     Map output records=6
13/09/05 10:34:46 INFO mapred.JobClient:     SPLIT_RAW_BYTES=87
13/09/05 10:34:46 INFO mapreduce.ImportJobBase: Transferred 24 bytes in
21.2419 seconds (1.1298 bytes/sec)
13/09/05 10:34:46 INFO mapreduce.ImportJobBase: Retrieved 6 records.
[root@ramesh bin]#


Hi,



From,
Ramesh.




On Sat, Aug 31, 2013 at 2:45 PM, Ravi Kiran <ravikiranmagham@gmail.com>wrote:

> Hi ,
>    Can you check if you are able to ping or telnet to the ip address and
> port of Oracle database from your machine.  I have a hunch that Oracle
> Listener is stopped . If so , start it.
> The commands to check the status and start if the listener isn't running.
>
> $ lsnrctl status
> $ lsnrctl start
>
> Regards
>
> Ravi Magham
>
>
> On Sat, Aug 31, 2013 at 2:05 PM, Krishnan Narayanan <
> krishnan.smile@gmail.com> wrote:
>
>> Hi Ram,
>>
>> I get the same error.If you find an answer pls dp fwd it to me. I will do
>> the same.
>>
>> Thx
>> Krish
>>
>>
>> On Sat, Aug 31, 2013 at 12:00 AM, Ram <prameshfrz@gmail.com> wrote:
>>
>>>
>>> Hi,
>>>    I am trying to import table from oracle hdfs. i am getting the
>>> following error
>>>
>>> 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
>>>
>>> any work around this.
>>>
>>> the query is:
>>>
>>> sqoop import --connect jdbc:oracle:thin:@//
>>> ramesh.ops.cloudwick.com/cloud --username ramesh --password password
>>> --table cloud.test -m 1
>>>
>>> the output is as follows;
>>>
>>> [root@ramesh ram]# sqoop import --connect jdbc:oracle:thin:@//
>>> ramesh.ops.cloudwick.com/cloud --username ramesh --password password
>>> --table cloud.test -m 1
>>> Warning: /usr/lib/hbase does not exist! HBase imports will fail.
>>> Please set $HBASE_HOME to the root of your HBase installation.
>>> 13/08/31 12:27:27 WARN tool.BaseSqoopTool: Setting your password on the
>>> command-line is insecure. Consider using -P instead.
>>> 13/08/31 12:27:27 INFO manager.SqlManager: Using default fetchSize of
>>> 1000
>>> 13/08/31 12:27:27 INFO tool.CodeGenTool: Beginning code generation
>>> 13/08/31 12:27:27 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:458)
>>>  at
>>> oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
>>> at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
>>>  at
>>> oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
>>> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
>>>  at java.sql.DriverManager.getConnection(DriverManager.java:571)
>>> at java.sql.DriverManager.getConnection(DriverManager.java:215)
>>>  at
>>> org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:313)
>>> at
>>> org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
>>>  at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:605)
>>> at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:628)
>>>  at
>>> org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:235)
>>> at
>>> org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:219)
>>>  at
>>> org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:347)
>>> at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1255)
>>>  at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1072)
>>> at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
>>>  at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
>>> at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
>>>  at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
>>> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>>>  at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
>>> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
>>> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
>>>  at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
>>> Caused by: oracle.net.ns.NetException: The Network Adapter could not
>>> establish the connection
>>> at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:392)
>>>  at
>>> oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:434)
>>> at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687)
>>>  at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247)
>>> at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
>>>  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
>>> ... 24 more
>>> Caused by: java.net.ConnectException: Connection refused
>>>  at java.net.PlainSocketImpl.socketConnect(Native Method)
>>> at
>>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
>>>  at
>>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
>>> at
>>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
>>>  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>>> at java.net.Socket.connect(Socket.java:579)
>>>  at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:150)
>>> at oracle.net.nt.ConnOption.connect(ConnOption.java:133)
>>>  at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:370)
>>> ... 29 more
>>> 13/08/31 12:27:27 ERROR manager.OracleManager: Failed to rollback
>>> transaction
>>> java.lang.NullPointerException
>>> at
>>> org.apache.sqoop.manager.OracleManager.getColumnNames(OracleManager.java:744)
>>> at org.apache.sqoop.orm.ClassWriter.getColumnNames(ClassWriter.java:1222)
>>>  at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1074)
>>> at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
>>>  at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
>>> at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
>>>  at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
>>> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>>>  at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
>>> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
>>> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
>>>  at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
>>> 13/08/31 12:27:27 ERROR manager.OracleManager: Failed to list columns
>>> java.sql.SQLRecoverableException: IO Error: The Network Adapter could
>>> not establish the connection
>>>  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458)
>>> at
>>> oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
>>>  at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
>>> at
>>> oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
>>>  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
>>> at java.sql.DriverManager.getConnection(DriverManager.java:571)
>>>  at java.sql.DriverManager.getConnection(DriverManager.java:215)
>>> at
>>> org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:313)
>>>  at
>>> org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
>>> at
>>> org.apache.sqoop.manager.OracleManager.getColumnNames(OracleManager.java:728)
>>>  at
>>> org.apache.sqoop.orm.ClassWriter.getColumnNames(ClassWriter.java:1222)
>>> at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1074)
>>>  at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
>>> at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
>>>  at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
>>> at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
>>>  at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>>> at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
>>>  at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
>>> at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
>>> at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
>>> Caused by: oracle.net.ns.NetException: The Network Adapter could not
>>> establish the connection
>>> at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:392)
>>>  at
>>> oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:434)
>>> at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687)
>>>  at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247)
>>> at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
>>>  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
>>> ... 20 more
>>> Caused by: java.net.ConnectException: Connection refused
>>>  at java.net.PlainSocketImpl.socketConnect(Native Method)
>>> at
>>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
>>>  at
>>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
>>> at
>>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
>>>  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>>> at java.net.Socket.connect(Socket.java:579)
>>>  at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:150)
>>> at oracle.net.nt.ConnOption.connect(ConnOption.java:133)
>>>  at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:370)
>>> ... 25 more
>>> 13/08/31 12:27:27 ERROR tool.ImportTool: Imported Failed: Attempted to
>>> generate class with no columns!
>>> [root@ramesh ram]#
>>>
>>>
>>>
>>> Thanks,
>>> Ramesh.
>>>
>>>
>>>
>>
>

Mime
View raw message