I have a production enviroment in a Oracle 10g database which I would like to authomatically duplicate in a test enviroment. My production enviroment is just a number of tables in which I have usually indices, constrains and triggers. Is there a way to authomatically make a copy of the prod-enviroment including all tables, indices, triggers and constrains without the data in the tables? Thanks in advance for your help.
2 Answers
This can be achieved with the expdp CONTENT flag:
expdp username/password DIRECTORY=directory_object_name \
DUMPFILE=dumpfile_name \
TABLES=table_names|TABLESPACES=tablespace_names|FULL=y \
CONTENT=metadata_only
mmmmmpie offers you a very viable way to do it. However, especially if you want to get your test environment as close to possible as prod for testing purposes, I highly recommend you look into RMAN cloning. You will end up with a block-for-block recreation of your production environment, which IMO is worth its weight in gold in regard to performance tuning (assuming the underlying tech stack is similar).
http://docs.oracle.com/cd/B19306_01/backup.102/b14191/rcmdupdb.htm
There's a 10g version of the methodology. HTH.
DataPump
utility