Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 








Refresh test database from production schema

Oracle Database Tips by Donald Burleson

Question:  I want to schedule a weekly job to refresh my test environment from my production database.  What are my options?

Answer: This is a common question, and you have many refreshing options, depending on your environment.  Any time you choose to migrate "pieces" of the production schema, you run the risk of missing something (current CBO statistics, sequences), so it's always best to do the whole schema, if you have enough disk space.

Guidelines for refreshing a test database include:

  • Current code - All PL/SQL and internal Java code must be kept synchronized with production.
  • Representative data - Whenever possible, a full-sized test and QA instance are best.
  • CBO statistics - It's critical to periodically refresh your test database with current CBO statistics and workload (system) statistics.

There are several methods commonly-used for fast test database refreshes, and they can all be reliably scheduled within Oracle, using dbms_job or dbms_scheduler:

1 - Database cloning - See my notes for a fast full clone of a production database into test.  Cloning a regular database.  Cloning a RAC database.

2 - Export-Import

You have a wealth of option with Oracle data pump (export-import), including IGNORE=N, which forces you to pre-drop the tables in TEST, thereby guaranteeing freshness.  Here is a common approach to refreshing a test database:

1 - Nuke all non-system objects in TEST - start fresh
2 - Export FULL from PROD and import into TEST
3 - Do full affirmative error checking (grep for "successfully completed" in the import log

Whatever approach you use, this can be fully automated using the dbms_scheduler package, but be careful to incorporate affirmative error checking to ensure that it always runs correctly. Dr. Hall has some good examples of this in his Oracle Job Scheduling book. It's a great book for creating bullet-proof jobs:

Oracle Job Scheduling book

If you like Oracle tuning, see the book "Oracle Tuning: The Definitive Reference", with 950 pages of tuning tips and scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.