This is a simple script that makes use of ASM and classic duplicate, although I guess itβs possible to use the standby DB for a duplicate from active database.
You can launch it everyday to align your test env at a point in time.
#!/bin/bash
if [ $USER != 'oracle' ] ; then
echo "need to be oracle"
exit 0
fi
. $HOME/set11
export ORACLE_SID=test1
srvctl stop database -d test -o immediate
## this is supposed to be a script that erase your ASM from your old test dbfiles:
## it's as simple as running with the CORRECT ENV:
## asmcmd rm -rf \
## +DATA/TEST/ONLINELOG
## +DATA/TEST/DATAFILE
## +DATA/TEST/CONTROLFILE
## +DATA/TEST/TEMPFILE
## +FRA/TEST/ONLINELOG
## +FRA/TEST/CONTROLFILE
ssh grid@testsrv /shared/refresh_test/remove_test_files.sh
sqlplus / as sysdba < <EOF
set echo on
startup nomount
alter system set cluster_database=false scope=spfile;
shutdown immediate
startup nomount
EOF
rman <<EOF
connect target sys/mystrongpassword@stdby
connect auxiliary /
duplicate database to 'test' until time "trunc(sysdate)+6/24";
EOF
sqlplus / as sysdba <<EOF
set echo on
alter system set cluster_database=true scope=spfile;
shutdown immediate
startup mount
alter database noarchivelog;
shutdown immediate
EOF
srvctl start database -d test
https://www.ludovicocaldara.net/dba/tag/standby/
Latest posts by rajeshkumar (see all)
- Top 10 Customer Experience (CX) Platforms of 2026 (Reviewed by Experts) - March 24, 2026
- Top 10 Call Center Software Tools in 2026 (Reviewed by Experts) - March 24, 2026
- Global PR Points Calculators β Check Your Immigration Eligibility for Australia, Canada, Austria, Japan, New Zealand, and South Korea - March 14, 2026