Solved

Oracle schema and data copy script

Posted on 2011-02-11
5
789 Views
Last Modified: 2012-05-11
Is there any utility (free) that can copy an entire oracle schema to another - including all data?  I am looking for something that uses SQL, not any Oracle export / import utility.  I am asking for this because I do not have privileges to use the export/ import tools on our database, but I do have access to create / drop objects, insert / update / delete, etc.  
0
Comment
Question by:jbaird123
5 Comments
 

Author Comment

by:jbaird123
ID: 34875607
I should also specify that I need to re-create all indexes, foreign keys, etc.
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34875646
try oracle sql developer (free)
or toad for oracle (free version)

using these tools, you can create scripts and run on other schema
also export data as sql insert statements...
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 400 total points
ID: 34876663
what about dbms_data_pump  package?  Can you run that?
DECLARE
    v_handle NUMBER;
BEGIN
    v_handle :=
        DBMS_DATAPUMP.open(
            operation     => 'IMPORT',
            job_mode      => 'SCHEMA',
            remote_link   => 'DB_LINK_TO_SOURCE'
        );

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

    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;
/

Open in new window

0
 
LVL 34

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 100 total points
ID: 34876822
The simple way to do this task is with the Oracle tools (export and import or DataPump export and DataPump import) that do this task easily.  You indicate that you have the security that you would need to do this the hard way (with manual scripts or tools like TOAD, SQL Developer, etc.) but you don't have the security you would need to run export and import.  That sounds strange.

If this is because you aren't allowed access to the O/S of the database server, do you have the option of installing the database utilities (export and import or DataPump export and DataPump import) on your client PC?  That would allow you to use these utilities on your client.  You will need the same version of Oracle for these utilities as your database.  They will run slower on a client, but depending on the size of the schema, this may or may not be much of a problem.
0
 

Author Closing Comment

by:jbaird123
ID: 34880362
Thank you.  The dbms_datapump package does what I need.
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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
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 shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

707 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

12 Experts available now in Live!

Get 1:1 Help Now