简体   繁体   English

如何使用expdp和impdp命令将Oracle模式从本地计算机导出到Remote

[英]How can I export Oracle schema from my local machine to Remote using expdp and impdp command

I want to take the back up of my local Oracle instance and want it to import on my remote server. 我想备份本地Oracle实例,并希望将其导入到我的远程服务器上。

I have searched the web but couldn't find any solution. 我已经在网上搜索了,但找不到任何解决方案。 The solution I got is: 我得到的解决方案是:

  • Export from local and import into only local. 从本地导出,仅导入本地。
  • Export from Remote and import into only remote server. 从远程导出并仅导入到远程服务器。

But my requirement is: 但我的要求是:

I have a schema in my local oracle instance. 我的本地oracle实例中有一个架构。 Now I want to take it's backup and import it on to my remote server. 现在,我要备份它并将其导入到我的远程服务器上。

Below are commands I am running for exporting and importing. 以下是我正在运行的用于导出和导入的命令。

for Local-- 对于本地-

expdp HR/HR@ORCL directory=Export SCHEMAS=MUKESH DUMPFILE=MUKESH.dmp LOGFILE=MUKESH.log

impdp HR/HR@ORCL directory=Export SCHEMAS=MUKESH DUMPFILE=MUKESH.dmp LOGFILE=MUKESH.log

for Remote-- 对于远程-

expdp FASTAdmin/password@db-m3-medium.coplvukvijdo.us-east-1.rds.amazonaws.com:1521/ORCL network_link=to_rds directory=Data_pump_dir dumpfile=MUKESH.dmp logfile=MUKESH.log SCHEMAS='MUKESH'

impdp FASTAdmin/password@db-m3-medium.coplvukvijdo.us-east-1.rds.amazonaws.com:1521/ORCL directory=DATA_PUMP_DIR dumpfile=MUKESH.dmp logfile=MUKESH.log SCHEMAS=MUKESH

Note:Please give me the solution using expdp and impdp command only. 注意:请仅使用expdp和impdp命令给我解决方案。

Three simple steps: 三个简单步骤:

  • EXPDP on your local to generate the dump file. 在本地EXPDP上生成转储文件。
  • Move the dump file to the remote server and place it in the required directory, by default from 10g and up you could use DATA_PUMP_DIR 转储文件移动到远程服务器并将其放置在所需的目录中,默认情况下从10g起,您可以使用DATA_PUMP_DIR
  • EXPDP on the remote server using the dump file you placed in step 2. 使用您在步骤2中放置的转储文件在远程服务器上使用EXPDP

In step 2, if you don't know the directory , you could do: 在步骤2中,如果您不知道目录 ,则可以执行以下操作:

SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';

See an example here . 在这里查看示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM