Hive中导入Oracle数据错误:Listener refused the connection with the following error: ORA-12505
问题:
今天往Hive中导入Oracle数据的时候碰到了如下错误:Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
解决办法:
导入数据的语句如下:
/usr/bin/sqoop import —connect jdbcthin:@20.20.20.20
jh —username *** —password *** —table *** -m 1 —fields-terminated-by “,” —hive-database *** —hive-table *** —hive-import —hive-overwrite
修改导入语句@20.20.20.20jh中的jh为数据库安装目录tnsnames.ora下SERVICE_NAME的名字。因为这里导入语句中需要的是SERVICE_NAME的名字为而不是SID。
还没有评论,来说两句吧...