tags:

views:

56

answers:

4

Hi,

I want to clone my existing oracle database structure without data including packages, users, tablespaces etc. I read some methods but they all copied data as well. Is there anyway out in order to do this?

Thanks in advance.

+1  A: 

You can do it in toad but its not free tool. (Database Tab->Export->Export DDL)

A: 

Try Oracle Export command with ROWS=N

exp SCOTT/TIGER ROWS=N TRIGGERS=N 
shiki
-1: Why triggers excluded? How you deal with tablespaces and users? How to import data?
ThinkJet
A full database export (FULL = Y, ROWS = N) will export definitions of all database items, including tablespaces and users, but no data. A similar export with ROWS = Y will include all of the data.
Adam Musch
A: 

Use SQL Developer > Tools > Database Export..

On "Specify Data" do not include any tables.

alt text

Omit packages etc here,

alt text

Fine tune your selection here,

alt text

My trial export has not finished yet but I expect this will work.

Janek Bogucki
-1 SQL Developer can't export/import information about tablespaces and users as specified in question.
ThinkJet
+2  A: 

Use Oracle exp.exe utility for export. E.g.

EXP.EXE login/password@TNSNAME file=entire_db.dmp owner=(scott, my_user, user2) rows=n grants=y triggers=y

Only rows=n option in command above make sense for your task.

You can import to target database with imp.exe utility.

Look for detailed option list and definition by running this utilities with help=y option.

BUT tablespaces and users on target databases must be created manually before running import. There are no standard tablespace cloning tools (including SQL Developer), but some queries exists for generating such cloning scripts. Examples can be found here and here.

P.S. This question better fits to ServerFault than to StackOverflow ...

ThinkJet