Link to home
Start Free TrialLog in
Avatar of adamgasior
adamgasiorFlag for Poland

asked on

Making database clone (without data)

Hi experts,

I am newbie in Oracle administration. I am using Oracle 10g database. I would like to clone database i.e. make an exact copy of tablespaces, tables, indexes, triggers, functions etc but without data.
What is the most efficient way to do it.?

Currently I am doing it in the way that taking sql scripts from 1st database and I am creating users, roles, tablespaces on the second database an than I am importing using dump files schema by schema (taken from 1st database). It takes a lot of time, and there are many errors that appears, so sometimes I need to perform import few times to be sure that I have everything in the new database.

Is there any other faster and more automatic way to have the same result?

Thanks for any advice

Adam
Avatar of schwertner
schwertner
Flag of Antarctica image

Use Export/Import or DataPump with
ROWS=N
parameter
Avatar of adamgasior

ASKER

I know this, but to use export import, tables and users need to be in the destination database.
you can create database using Database Configuration Assistant
http://download.oracle.com/docs/cd/B19306_01/win.102/b14304/create.htm#i1005759
it allows you to Manage Templates ... you can create template for creating DB with all you need, you've described
----> but to use export import, tables and users need to be in the destination database.

NO!

If you use DATA PUMP (Oracle 10g R2) you have to create only the NONSYSTEM tablespaces.
Users will be created from DATA PUMP.

Neither in Export/Import nor in Data Pump you have to create tables!
what about trigger, stored fucntions, roles, synonyms,  packages,indexes will they also be created by importing using import dump? (i have oracle 10g2)
Hi adamgasior,

Yes, all those database objects will be imported. I've provided a slightly more detailed instruction in one of my previous answer https://www.experts-exchange.com/questions/22822286/how-to-import-a-dmp-file-into-a-clean-installed-Oracle.html.

The instruction is import and export. The steps for doing the data pump is similar.

Cheers,
NicksonKoh
ASKER CERTIFIED SOLUTION
Avatar of schwertner
schwertner
Flag of Antarctica image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial