oracle 使用 sqlldr 将数据加载到远程数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3895632/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Load data to remote DB using sqlldr
提问by nath
I wanted to load data to remote db using sqlldr.I did it using following command
我想使用 sqlldr 将数据加载到远程数据库。我使用以下命令做到了
>sqlldr GANUKA/GANUKA@jdbc:oracle:thin:@172.21.0.180:1521:orcl control=D:\Work\CLSTMAS.ctl
log=D:\Work\CLSTMAS.log
But it gives the following error.
但它给出了以下错误。
SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
ORA-12154: TNS:could not resolve the connect identifier specified
Need a help
需要帮助
回答by Codo
You're mixing up two different worlds here. One is the OCI world where sqlldrlives. It expects Oracle instance names defined in TNSNAMES.ORA (or a similar service). The other world is the JDBC world that uses connection identifiers with words like "jdbc" or "thin".
你在这里混淆了两个不同的世界。一个是sqlldr所在的 OCI 世界。它需要在 TNSNAMES.ORA(或类似服务)中定义的 Oracle 实例名称。另一个世界是 JDBC 世界,它使用带有“jdbc”或“thin”之类的词的连接标识符。
So you have two options:
所以你有两个选择:
If your environment has a proper TNS setup, you have to change the command line to something like
sqlldr GANUKA/[email protected] control=...
If not, you can use an Easy Connect string:
sqlldr GANUKA/GANUKA@//172.21.0.180:1521/orcl control=...
如果您的环境具有正确的 TNS 设置,则必须将命令行更改为类似
sqlldr GANUKA/[email protected] control=...
如果没有,您可以使用 Easy Connect 字符串:
sqlldr GANUKA/GANUKA@//172.21.0.180:1521/orcl control=...
回答by gaoagong
I ended up having to use a thin client connection string. I couldn't get @Codo 's solution to work.
我最终不得不使用瘦客户端连接字符串。我无法让 @Codo 的解决方案起作用。
sqlldr \'username/passwd@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost.com)(PORT=1111)))(CONNECT_DATA=(SID=MYSIDE)(SERVER=DEDICATED)))\' control=loader.ctl data=data.csv
sqlldr \'username/passwd@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost.com)(PORT=1111)))(CONNECT_DATA=(SID=MYSIDE)(SERVER=DEDICATED)))\' control=loader.ctl data=data.csv