tags:

views:

53

answers:

3

I need to import Oracle Database from production to development just for one schema. What's the easiest way to do this? What I did is to drop the user with this schema and recreate the user with the same options and run import command. Is this the right way to do?

I use Oracle 10g and I am a developer not DBA but my DBA gives me the dump file and I need to build a local test environment.

Do I need to drop the user? Can I just delete all objects for this user?

+1  A: 

When you say dump files, do you mean RMAN backups or data pump files? If the latter, you should the Oracle data pump import utility, impdp, to bring in the files. Some documentation can be found here: http://wiki.oracle.com/page/Data+Pump+Export+(expdp)+and+Data+Pump+Import(impdp)

If it's the former, the best bet is to use the Enterprise Management Console to schedule an RMAN restore job.

Delmania
+1  A: 

I'm also a developer and not a DBA but have had to use import\export functionality recently.

I used the Oracle Data Pump to achieve this found the Oracle documentation to be really useful.

The documentation for the Data Pump can be found here and the documentation for what Oracle call the "Original Export and Import" can be found here.

carpenteri
+1  A: 

What I did is to drop the user with this schema and recreate the user with the same options and run import command. Is this the right way to do

That's pretty much what I do when I want to create a development schema on my laptop.

Can I just delete all objects for this user?

I think this is a rather messy approach. Best is to drop the user and import it.

Sathya
what do you mean "messy approach"?
Henry Gao
Sathya
@Sathya, I do not agree with you. you can use "cascade constraints." for the dependencies. You still just import while you recreate them. I agree dropping user is a one way. I just wonder dropping all objects may be an alternative way.
Henry Gao