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

x
?
Solved

Oracle schema and data copy script

Posted on 2011-02-11
5
Medium Priority
?
808 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 59

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 1600 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 400 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
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 how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

670 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