expdp/impdp 连接字符串

发布于 2025-01-11 18:55:48 字数 576 浏览 0 评论 0原文

我目前正在尝试复制名称为小写的架构。 因此,为了通过 sqlplus 进行连接,我只需执行以下操作:

sqlplus \"schema_name\"/schema_pass@localhost/DBRAZRAB

效果很好。

当然,我天真地对 expdp/impdp 尝试了相同的方法,但这一次不起作用:

[oracle@3e7716e807ed ~]$ expdp \"schema_name\"/schema_pass@localhost/DBRAZRAB schemas=\"schema_name\" <...>

Export: Release 19.0.0.0.0 - Production on Thu Mar 3 13:44:43 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Password: 

有人可以给我一个提示,我做错了什么吗?我应该使用哪种格式?

I am currently trying to copy a schema with the name in lowercase.
So in order to connect via sqlplus I simply do:

sqlplus \"schema_name\"/schema_pass@localhost/DBRAZRAB

That works well.

Of course naively I tried the same approach for expdp/impdp, but that does not work this time:

[oracle@3e7716e807ed ~]$ expdp \"schema_name\"/schema_pass@localhost/DBRAZRAB schemas=\"schema_name\" <...>

Export: Release 19.0.0.0.0 - Production on Thu Mar 3 13:44:43 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Password: 

Could someone please give me a hint, what am I doing wrong? Which format should I use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想你的星星会说话 2025-01-18 18:55:48

唔。该文档确实提到引号可能是调用 expdp/impdp 的问题,并且 建议使用 PARFILE,但这对解决用户名问题没有帮助。

作为解决方法,您可以以 SYSTEM(或具有 DATAPUMP_EXP_FULL_DATABASE 权限的类似用户)身份运行导出:

sqlplus SYSTEM/pass@localhost/DBRAZRAB PARFILE=params.txt

使用如下参数文件:

SCHEMAS="schema_name"
DUMPFILE=...etc...

Hmm. The documentation does mention that quotation marks can be an issue with calling expdp/impdp, and recommends using a PARFILE, but that doesn't help with the username issue.

As a workaround, you could run the export as SYSTEM (or similar user with DATAPUMP_EXP_FULL_DATABASE privilege):

sqlplus SYSTEM/pass@localhost/DBRAZRAB PARFILE=params.txt

with a parameter file like:

SCHEMAS="schema_name"
DUMPFILE=...etc...
无畏 2025-01-18 18:55:48

经过一晚上的研究,我得出了以下结论:

添加了一个具有 DATAPUMP_EXP_FULL_DATABASE 权限的用户,DATAPUMP_IMP_FULL_DATABASE

配置 parfile 并应用它们:

schema_exp.par:

SCHEMAS=\"schema_123\"
DUMPFILE=schema.dmp
DIRECTORY=schema_dir
LOGFILE=schema_exp.log
[oracle@3e7716e807ed ~]$ expdp expimp_user/expimp_pass@localhost/DBRAZRAB parfile=/schema_exp.par

schema_imp.par:

SCHEMAS=\"schema_123\"
DUMPFILE=schema.dmp
DIRECTORY=schema_dir
LOGFILE=schema_imp.log
REMAP_SCHEMA=\"schema_123\":SCHEMA_123
REMAP_TABLESPACE=\"schema_123\":SCHEMA_123
[oracle@3e7716e807ed ~]$ impdp expimp_user/expimp_pass@localhost/DBRAZRAB parfile=/schema_imp.par

After an evening of a research I came up with the following:

Added a user with the privileges DATAPUMP_EXP_FULL_DATABASE, DATAPUMP_IMP_FULL_DATABASE;

Configured parfiles and applied them:

schema_exp.par:

SCHEMAS=\"schema_123\"
DUMPFILE=schema.dmp
DIRECTORY=schema_dir
LOGFILE=schema_exp.log
[oracle@3e7716e807ed ~]$ expdp expimp_user/expimp_pass@localhost/DBRAZRAB parfile=/schema_exp.par

schema_imp.par:

SCHEMAS=\"schema_123\"
DUMPFILE=schema.dmp
DIRECTORY=schema_dir
LOGFILE=schema_imp.log
REMAP_SCHEMA=\"schema_123\":SCHEMA_123
REMAP_TABLESPACE=\"schema_123\":SCHEMA_123
[oracle@3e7716e807ed ~]$ impdp expimp_user/expimp_pass@localhost/DBRAZRAB parfile=/schema_imp.par
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文