Solved

Oracle schema and data copy script

Posted on 2011-02-11
5
798 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 35

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle - Query Insert and Update multiple tables 5 58
history tablespace temp usage 2 31
help on oracle query 5 33
1 FROM DUAL wont work with additional columns ?? 4 26
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
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 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.

895 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

16 Experts available now in Live!

Get 1:1 Help Now