Solved

Oracle schema and data copy script

Posted on 2011-02-11
5
807 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
[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
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 56

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 74

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
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, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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
Suggested Courses

627 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