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 jdbc:oracle:thin:@20.20.20.20:1521:jh --username *** --password *** --table *** -m 1 --fields-terminated-by "," --hive-database *** --hive-table *** --hive-import --hive-overwrite

修改导入语句@20.20.20.20:1521:jh中的jh为数据库安装目录tnsnames.ora下SERVICE_NAME的名字。因为这里导入语句中需要的是SERVICE_NAME的名字为而不是SID。

猜你喜欢

转载自blog.csdn.net/gdkyxy2013/article/details/79880378