Go Premium for a chance to win a PS4. Enter to Win

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
?
219 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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup

916 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