Oracle 12cR1 – Duplicate Database Without Resetlogs

duplicationoracleoracle-12crestorerman

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,

Best Answer

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;