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
207 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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

772 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

14 Experts available now in Live!

Get 1:1 Help Now