Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to list list tablespace DEFINITIONs and export CREATEs for cloning?

pstein-JavaNetApr 28 2009 — edited Apr 29 2009
Assume I have two Oracle databases one DB1 on computer A and the other DB2 on computer B.

Now I want to create all tablespaces from DB1 as well on DB2 if they do not exist already.

How do I do this (without manually typing)?

I could imagine to export all CREATE TABLESPACE statements from DB1 with der definitions
(e.g. DATAFILE 'c:\oracle\oradata\ora\userts.dbf' SIZE 10M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 100K;)
..and import them into the other DB2.

1. How can I do this export (preferable in human readable form)?

2. When I try to import them in DB2 and they already exist in DB2 then they should not be created. How do I code this condition?

3. How can I tell DB2 to use the default tablespace location for the *.dbf file? In the statement above the location is
'c:\oracle\oradata\ora\userts.dbf' . What if all the *.dbf files of DB2 are located in 'D:\project\myoracle\ordata\ora\....'
How can I tell a database to use the default directory for the *.dbf file?

Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 27 2009
Added on Apr 28 2009
8 comments
4,483 views