Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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 setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

662 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