Solved

Oracle schema and data copy script

Posted on 2011-02-11
5
805 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 53

Expert Comment

by:Huseyin KAHRAMAN
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pl/sql parameter is null sometimes 2 40
Oracle Date 6 42
Age Calculation from specific date 19 59
Oracle - time format validation issue 4 18
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‚Ķ
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 Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

752 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