views:

45

answers:

3

I have access to a remote Oracle database with a schema consisting of may tables but no data. I'd like to recreate this schema on my local database system for testing purpose. How would I go about this? Are there any utilities that can help with this?

Also, if the 2 Oracle database versions are different would that be a cause of any concern?

+2  A: 

Use exp to export it, and imp to import it.

Paul Tomblin
Would futher recommend `expdp` and `impdp` if the version(s) of Oracle are recent enough. Much better tools.
Adam Hawkes
@Adam, you are correct in general, but OP stated the transfer is for the schema only, no data, so it's likely a wash performance-wise. Also, with expdp, the dump file is created ON THE SERVER, so you need access to the server to get at your dump file, and put it on your local server to use impdp. In this way it can be less convenient, since exp/imp are client-side utilities.
DCookie
+1  A: 

As Paul stated, use exp/imp to perform the operation.

As for your question concerning different DB versions, yes, this is a possible concern. I assume you're copying the schema from an older version to a newer one? Make sure you use the exp utility for the older database, as imp is backward compatible. You might run into problems trying to go from a newer version to an older one, as you'd have to use the exp utility from the older version on the newer DB, and that might be problematic.

DCookie
A: 

As stated, exp/imp will work and these should already be on your machine. I just wanted to add that if you use any third party tools (for example, I use TOAD) your tool might contain some common operations such as "Compare Schemas" or "Create Sync Script" etc.

wweicker