Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Testing Refresh Procedure

RE: Testing Refresh Procedure

From: joshc <>
Date: Tue, 21 Mar 2006 10:33:00 -0800
Message-Id: <>


Use RMAN to do your duplications, it's incredibly easy. Especially if you set the init parameter db_file_name_convert. Here is an example on one of my dev databases.  

alter system set db_file_name_convert = '/u01/oradata/dbprod/','/u01/oradata/dbdup/dup_','/u02/oradata/dbprod/','/u02/or adata/dbdup/dup_','/u03/oradata/dbprod/','/u03/oradata/dbdup/dup_' scope=spfile;  

You can script the whole thing and it has the added bonus of exercising your RMAN backup sets, which helps validate your recovery plan. I have three files in my duplication process 1. shell script to control process (this script runs on the development server)

    . /home/oracle/environs/dbdup.env
    rm -rf /u03/oradata/dbdup/*
    rm -rf /u02/oradata/dbdup/*
    rm -rf /u01/oradata/dbdup/*

    sqlplus /nolog <<_EOF_
    connect / as sysdba
    shutdown abort;
    startup nomount;
    rman rcvcat uid/pwd_at_rmancat target sys_at_dbprod Auxiliary / cmdfile
/home/oracle/scripts/duplicate_dbprodf2dbdup.rcv    msglog
    sqlplus /nolog @post_dup_dbdev.sql >
2. The RCV file that stores the RMAN commands for the duplication. This will duplicate production to a point in time (yesterday at noon).

     run {
    allocate auxiliary channel ch1 type disk;     allocate auxiliary channel ch2 type disk;     duplicate target database to dbdev until time="(SYSDATE-1)+(12/24)"     LOGFILE
  GROUP 1 (

  ) SIZE 1M,
  GROUP 2 (

  ) SIZE 1M,
  GROUP 3 (

  ) SIZE 1M,
  GROUP 4 (

  ) SIZE 1M,
  GROUP 5 (

  ) SIZE 1M,
  GROUP 6 (

  ) SIZE 1M;     }
3. A post duplication script that changes passwords and anything else you may want, such as dropping database links to other production databases, renaming the global name, creating QA users, populating the temp space with a datafile.  

I use NFS to share the location of my RMAN backupsets with my development database and server.

Josh C.  

From: [] On Behalf Of Coleman, Kelley (HAC)
Sent: Tuesday, March 21, 2006 7:59 AM
Subject: Testing Refresh Procedure

Does anyone have a standard procedure for doing db refreshes that they'd be willing to share? I'd be going from Production down to test and development dbs. These were usually done by a co-worker who recently moved on to greener pastures. He didn't leave any desk procedures, so I've been winging it, but it seems like I'm making it harder than it needs to be.  

Should I drop relevant schemas before importing, so it's basically from scratch?  

I know the pastures guy would essentially do two imports, one just of table structures - no rows - then one just of data. Does that seem like a sound procedure?

Kelley Coleman
Database Administrator
VA Health Administration Center
Denver, Colorado

Confidentiality Note: This e-mail is intended only for the person or entity to which it is addressed, and may contain information that is privileged, confidential, or otherwise protected from disclosure. Dissemination, distribution, or copying of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this e-mail in error, please notify the sender by reply e-mail, phone, or fax, and destroy the original message and all copies. Thank you  

Received on Tue Mar 21 2006 - 12:33:00 CST

Original text of this message