How to list list tablespace DEFINITIONs and export CREATEs for cloning?
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