Oracle 12cR1 – Duplicate Database With No Resetlogs

All we need is an easy explanation of the problem, so here it is.

Database version: Oracle 12cR1
Operating system: Oracle Linux 7.x
ASM: yes

Duplicate script:

cat duplicatetodisaster.sh

ORACLE_UNQNAME=xxx
ORACLE_SID=xxx
ORACLE_HOME=xxx


rman target sys/***@PROD auxiliary sys/***@DRC <<EOF
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby1 type disk;
allocate auxiliary channel stby2 type disk;
allocate auxiliary channel stby3 type disk;
allocate auxiliary channel stby4 type disk;
duplicate target database to 'db_name' noopen from active database;
}
exit;
EOF

We are trying to create a disaster database with the log shipping method. Basic logic; production database will be duplicated and a disaster database will be created that continues in mount mode. Then, archivelogs transferred from production database will be recovered by disaster database and their continuity will be ensured.

As you can see in the rman script I shared; I tried to prevent the database from doing resetlogs by adding the noopen parameter, but still, after the restore and recover successfully finished, the controlfile created and resetlogs the database. Because of this, all incarnations in the database, DBID parameter and everything to keep it in sync with the production database are broken. Based on this, the transferred archivelogs cannot be recovered and continuity cannot be maintained. How can I prevent this situation?

Below, I share where resetlogs does exactly from the alert log:

Completed: CREATE CONTROLFILE REUSE SET DATABASE "DB_NAME" RESETLOGS ARCHIVELOG
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY     4382
 LOGFILE
  GROUP  11  SIZE 1536 M ,
  GROUP  12  SIZE 1536 M ,
  GROUP  13  SIZE 1536 M
 DATAFILE
  '+DATA/.../.../system...'
 CHARACTER SET WE8ISO8859P9

Another issue; there are about 250 datafiles, why did this happen for a single datafile…

Best regards,

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

So you described Data Guard with a standby database. If you want a standby database, tell RMAN to create a standby database:

duplicate target database for standby from active database;

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply