oracle 如何使用“impdp”命令导入带有端口号的 .dmp 数据?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9839605/
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
how can I use "impdp" command importing .dmp data with port number?
提问by leon
I am trying to import data to an Oracle database. I have ".imp" and ".dmp" files for importing data. The database is using port 1521 and database name is "DB". I have tried the following command, but doesn't work.
我正在尝试将数据导入 Oracle 数据库。我有用于导入数据的“.imp”和“.dmp”文件。数据库使用端口 1521,数据库名称为“DB”。我尝试了以下命令,但不起作用。
impdp root/[email protected]:1521:DB
dumpfile=transmart.dmp
logfile=transmart.imp
schemas=i2b2hive,i2b2metadata,i2b2sampledata,i2b2demodata,i2b2workdata
,biomart,biomart_user,deapp,searchapp,tm_cz,tm_lz,tm_wz
ERROR: either ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATAor ORA-12545: Connect failed because target host or object does not exist
错误:ORA-12504: TNS:listener 在 CONNECT_DATA 中没有被赋予 SERVICE_NAME或ORA-12545: 连接失败,因为目标主机或对象不存在
I can telnet the IP and port with no problem.
我可以毫无问题地远程登录 IP 和端口。
Can anyone suggest please?
有人可以建议吗?
Thanks!
谢谢!
回答by DCookie
You have a syntax error in your EZConnect string.
您的EZConnect 字符串中有语法错误。
Try this instead (no need to fuss with tnsnames.ora this way):
试试这个(无需以这种方式对 tnsnames.ora 大惊小怪):
impdp root/[email protected]:1521/DB
Notice the replacement of the ":" with a "/" between port and service name.
请注意在端口和服务名称之间用“/”替换了“:”。
As a side note, I long ago got out of the habit of putting passwords in command lines, where they may be easily snooped while the command is running. Let the program prompt you for the password:
作为旁注,我很久以前就改掉了将密码放在命令行中的习惯,因为在命令运行时很容易窥探到它们。让程序提示您输入密码:
impdp [email protected]:1521/DB
Especially if you're going to use root for your commands ;-)
特别是如果您要使用 root 来执行您的命令;-)
回答by APC
Your reference to telnet suggests you are running this from a remote client rather than locally on the database server.
您对 telnet 的引用表明您正在从远程客户端而不是在数据库服务器本地运行它。
You need to edit your client's TNSNAMES.ORA file with the location information for DB. Perhaps you think you've already done this, in which case you've probably introduced a typo or got the syntax wrong.
您需要使用 DB 的位置信息来编辑客户端的 TNSNAMES.ORA 文件。也许您认为您已经这样做了,在这种情况下,您可能引入了拼写错误或语法错误。
The other thing to check is that the listener is running on the database server, as that's a very common cause of ORA-12545.
要检查的另一件事是侦听器正在数据库服务器上运行,因为这是 ORA-12545 的一个非常常见的原因。
回答by Tim
to import the latest transmart database dump we used the following:
为了导入最新的 transmart 数据库转储,我们使用了以下内容:
wget https://github.com/transmart/transmartApp-DB/zipball/master
unzip master
tar zxvf transmart.dmp.tar.gz
cp transmart.dump /u01/app/oracle/admin/XE/dpdump
chown oracle:dba /u01/app/oracle/admin/XE/dpdump/transmart.dmp
impdp SYSTEM dumpfile=transmart.dmp logfile=transmart3.log full=y
If you don't use the full=y
you will end up missing a number of tables. Hope this is still useful to you or someone else.
如果您不使用,full=y
您最终会丢失许多表。希望这对您或其他人仍然有用。