2016-09-23 85 views
0

獲得以下例外。使用shell腳本從teradata到hdfs的sqoop數據

有什麼可能的錯誤?

數據庫真的不存在嗎?或與權限相關的問題有關?

com.teradata.connector.common.exception.ConnectorException: java.sql.SQLException: [Teradata Database] [TeraJDBC 15.00.00.20] [Error 3802] [SQLState 42S02] Database 'P_STORAGE' does not exist. 
     at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:308) 
     at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:109) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:307) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:196) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:114) 
     at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:385) 
     at com.teradata.jdbc.jdbc_4.TDStatement.prepareRequest(TDStatement.java:569) 
     at com.teradata.jdbc.jdbc_4.TDPreparedStatement.<init>(TDPreparedStatement.java:117) 
     at com.teradata.jdbc.jdk6.JDK6_SQL_PreparedStatement.<init>(JDK6_SQL_PreparedStatement.java:29) 
     at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.constructPreparedStatement(JDK6_SQL_Connection.java:81) 
     at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1357) 
     at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1401) 
     at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1387) 
     at com.teradata.connector.teradata.db.TeradataConnection.getColumnDescsForSQL(TeradataConnection.java:995) 
     at com.teradata.connector.teradata.db.TeradataConnection.getColumnNamesForSQL(TeradataConnection.java:940) 
     at com.teradata.connector.teradata.utils.TeradataUtils.validateInputTeradataProperties(TeradataUtils.java:315) 
     at com.teradata.connector.teradata.processor.TeradataInputProcessor.validateConfiguration(TeradataInputProcessor.java:91) 
     at com.teradata.connector.teradata.processor.TeradataSplitByPartitionProcessor.validateConfiguration(TeradataSplitByPartitionProcessor.java:412) 
     at com.teradata.connector.teradata.processor.TeradataInputProcessor.inputPreProcessor(TeradataInputProcessor.java:36) 
     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:116) 
     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:56) 
     at org.apache.sqoop.teradata.TeradataSqoopImportHelper.runJob(TeradataSqoopImportHelper.java:370) 
     at org.apache.sqoop.teradata.TeradataConnManager.importQuery(TeradataConnManager.java:531) 
     at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:499) 
     at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605) 
     at org.apache.sqoop.Sqoop.run(Sqoop.java:148) 
     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 
     at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235) 
     at org.apache.sqoop.Sqoop.main(Sqoop.java:244) 

     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:140) 
     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:56) 
     at org.apache.sqoop.teradata.TeradataSqoopImportHelper.runJob(TeradataSqoopImportHelper.java:370) 
     at org.apache.sqoop.teradata.TeradataConnManager.importQuery(TeradataConnManager.java:531) 
     at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:499) 
     at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605) 
     at org.apache.sqoop.Sqoop.run(Sqoop.java:148) 
     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 
     at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235) 
     at org.apache.sqoop.Sqoop.main(Sqoop.java:244) 
16/09/23 05:47:10 INFO teradata.TeradataSqoopImportHelper: Teradata import job completed with exit code 1 
16/09/23 05:47:10 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Exception running Teradata import job 
     at org.apache.sqoop.teradata.TeradataSqoopImportHelper.runJob(TeradataSqoopImportHelper.java:373) 
     at org.apache.sqoop.teradata.TeradataConnManager.importQuery(TeradataConnManager.java:531) 
     at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:499) 
     at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605) 
     at org.apache.sqoop.Sqoop.run(Sqoop.java:148) 
     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 
     at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235) 
     at org.apache.sqoop.Sqoop.main(Sqoop.java:244) 
Caused by: com.teradata.connector.common.exception.ConnectorException: java.sql.SQLException: [Teradata Database] [TeraJDBC 15.00.00.20] [Error 3802] [SQLState 42S02] Database 'P_STORAGE' does not exist. 
     at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:308) 
     at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:109) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:307) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:196) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123) 
     at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:114) 
     at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:385) 
     at com.teradata.jdbc.jdbc_4.TDStatement.prepareRequest(TDStatement.java:569) 
     at com.teradata.jdbc.jdbc_4.TDPreparedStatement.<init>(TDPreparedStatement.java:117) 
     at com.teradata.jdbc.jdk6.JDK6_SQL_PreparedStatement.<init>(JDK6_SQL_PreparedStatement.java:29) 
     at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.constructPreparedStatement(JDK6_SQL_Connection.java:81) 
     at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1357) 
     at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1401) 
     at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1387) 
     at com.teradata.connector.teradata.db.TeradataConnection.getColumnDescsForSQL(TeradataConnection.java:995) 
     at com.teradata.connector.teradata.db.TeradataConnection.getColumnNamesForSQL(TeradataConnection.java:940) 
     at com.teradata.connector.teradata.utils.TeradataUtils.validateInputTeradataProperties(TeradataUtils.java:315) 
     at com.teradata.connector.teradata.processor.TeradataInputProcessor.validateConfiguration(TeradataInputProcessor.java:91) 
     at com.teradata.connector.teradata.processor.TeradataSplitByPartitionProcessor.validateConfiguration(TeradataSplitByPartitionProcessor.java:412) 
     at com.teradata.connector.teradata.processor.TeradataInputProcessor.inputPreProcessor(TeradataInputProcessor.java:36) 
     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:116) 
     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:56) 
     at org.apache.sqoop.teradata.TeradataSqoopImportHelper.runJob(TeradataSqoopImportHelper.java:370) 
     at org.apache.sqoop.teradata.TeradataConnManager.importQuery(TeradataConnManager.java:531) 
     at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:499) 
     at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605) 
     at org.apache.sqoop.Sqoop.run(Sqoop.java:148) 
     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 
     at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226) 
     at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235) 
     at org.apache.sqoop.Sqoop.main(Sqoop.java:244) 

     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:140) 
     at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:56) 
     at org.apache.sqoop.teradata.TeradataSqoopImportHelper.runJob(TeradataSqoopImportHelper.java:370) 
     ... 9 more 
+1

使用sqoop名單的數據庫命令,看看數據庫是否真的存在。 – Sanket

回答

0

這可能是問題。

請儘量sqoop eval用相同的憑據:

sqoop eval --connect "<teradata connect class param>" \ 
--username <username> -P 
--query "SELECT * FROM DBC.Databases" 
相關問題