2

我正在尝试将数据导入 Oracle 数据库。我有用于导入数据的“.imp”和“.dmp”文件。数据库使用端口 1521,数据库名称为“DB”。我尝试了以下命令,但不起作用。

impdp root/password@xxx.xxx.xxx.xxx: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

错误: ORA-12504: TNS:listener is not given the SERVICE_NAME in CONNECT_DATA or ORA-12545: Connect failed because target host or object does not exist

我可以毫无问题地远程登录 IP 和端口。

有人可以建议吗?

谢谢!

4

3 回答 3

7

您的EZConnect 字符串中有语法错误。

试试这个(不需要用这种方式对 tnsnames.ora 大惊小怪):

impdp root/password@xxx.xxx.xxx.xxx:1521/DB

注意端口和服务名称之间的“:”替换为“/”。

作为旁注,我很久以前就养成了将密码放在命令行中的习惯,在命令运行时它们很容易被窥探到。让程序提示您输入密码:

impdp root@xxx.xxx.xxx.xxx:1521/DB

特别是如果您要为您的命令使用 root ;-)

于 2012-03-23T15:42:23.893 回答
0

您对 telnet 的引用表明您是从远程客户端而不是在数据库服务器本地运行的。

您需要使用 DB 的位置信息编辑客户的 TNSNAMES.ORA 文件。也许您认为您已经这样做了,在这种情况下,您可能引入了拼写错误或语法错误。

要检查的另一件事是侦听器正在数据库服务器上运行,因为这是 ORA-12545 的常见原因。

于 2012-03-23T13:49:38.783 回答
0

要导入最新的 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

如果您不使用,full=y您最终会丢失许多表。希望这对您或其他人仍然有用。

于 2012-05-15T08:58:16.323 回答