Solved

How to copy all tables from one schema into other which are residing in different databases(same server though)?

Posted on 2011-09-06
2
209 Views
Last Modified: 2012-05-12
I want to copy all tables in a schema into other schema which are residing in different 10g databases(same server).
0
Comment
Question by:ajaybelde
2 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 36488811
dbms_datapump is probably the easiest


create a db link from the target db to the source db.

then, on the target db


declare
   v_handle NUMBER;
BEGIN
   v_handle:=
   DBMS_DATAPUMP.OPEN (operation   => 'IMPORT',
                       job_mode    => 'SCHEMA',
                       remote_link => 'YOUR_DB_LINK'
                               );

   DBMS_DATAPUMP.metadata_filter (handle => v_handle,
                                  NAME   => 'SCHEMA_LIST',
                                  VALUE  => '''SCHEMA1'',''SCHEMA2'''
                               );

   DBMS_DATAPUMP.set_parameter (handle => v_handle,
                                NAME   => 'TABLE_EXISTS_ACTION',
                                VALUE  => 'REPLACE'
                               );


   dbms_datapump.add_file(handle => v_handle,
                          filename => 'your_log_file_name_here.log',
                          directory => 'DATA_PUMP_DIR',
                          filetype=>3);


   DBMS_DATAPUMP.set_parallel(v_handle, 4);

   DBMS_DATAPUMP.start_job (v_handle);
END;
/
0
 
LVL 7

Expert Comment

by:Docteur_Z
ID: 36488946
Argh ! Not quick enough :-)

Or in commande line on destination withe db link pointing to source:
impdp impdp_schem/passschemimpdp DIRECTORY=EXPORT NETWORK_LINK=SOURCE_DBL LOGFILE=imp_over_network_${SCHEMA}.log schemas=${SCHEMA} parallel=3 TABLE_EXISTS_ACTION=REPLACE exclude=STATISTICS
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now