행위

"데이터펌프 디비링크"의 두 판 사이의 차이

DB CAFE

(새 문서: http://www.dba-oracle.com/t_direct_export_remote_database.htm Oracle direct export to remote database tips Oracle Database Tips by Donald BurlesonAugust 2, 2013 Question: How do yo...)
 
10번째 줄: 10번째 줄:
  
 
   
 
   
 
+
<source lang=sql>
 
create database link  
 
create database link  
 
   my_link
 
   my_link
19번째 줄: 19번째 줄:
 
using
 
using
 
   testdev;
 
   testdev;
 
+
</source>
 
   
 
   
  
29번째 줄: 29번째 줄:
  
 
   
 
   
 
+
<source lang=sql>
 
expdp fred/flintstone@testdev tables=customer network_link=my_link directory=TEST_DIR dumpfile=/tmp/cust.dmp logfile=mylog.log
 
expdp fred/flintstone@testdev tables=customer network_link=my_link directory=TEST_DIR dumpfile=/tmp/cust.dmp logfile=mylog.log
 
+
</source>
 
   
 
   
  
37번째 줄: 37번째 줄:
  
 
   
 
   
 
+
<source lang=sql>
 
impdp fred/flintstone@testdev tables=customer network_link=my_link directory=tempdir logfile=importcust.log remap_schema=fred:test
 
impdp fred/flintstone@testdev tables=customer network_link=my_link directory=tempdir logfile=importcust.log remap_schema=fred:test
 
+
</source>
 
   
 
   
  

2018년 9월 18일 (화) 14:27 판

thumb_up 추천메뉴 바로가기


http://www.dba-oracle.com/t_direct_export_remote_database.htm


Oracle direct export to remote database tips Oracle Database Tips by Donald BurlesonAugust 2, 2013

Question: How do you export a table directly to a remote database? I don't want to use expdp to create an intermediate .dmp file to transfer to the remote database and I understand that expdp can export and import using a db link. If so, how do you invoke a direct export to another database?

Answer: First, note that expdp/impsp is only one of many options to migrate tables between databases. In expdp and impdp you can use the network_link parameter provided that you have defined a database link:


create database link 
   my_link
connect to 
   fred
identified by 
   flintstone
using
  testdev;


One the network_link is create you have two ways to directly export/import database between systems:


1: Expdp from the source database to the destination (remote) database. Note that using expdp with the remote link requires that you specify a dmp file:


expdp fred/flintstone@testdev tables=customer network_link=my_link directory=TEST_DIR dumpfile=/tmp/cust.dmp logfile=mylog.log


2: Use impdp with the network_link parameter from the destination database.


impdp fred/flintstone@testdev tables=customer network_link=my_link directory=tempdir logfile=importcust.log remap_schema=fred:test


Both the local and remote users require the exp_full_database role granted to the user ID. Also note the "parallel" parameter which speeds-up the export/import operations.


Note that a traditional export to a dmp file, followed by an FTP may be a faster solution if you network connection has limited bandwidth. Also, using CTAS (create table as select) over a database link is faster than expdp, but it does not copy over the index and constraint definitions.