Step 1:
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Step 2:
rman target /
RECOVER DATABASE FROM SERVICE PRIM USING COMPRESSED BACKUPSET NOREDO SECTION SIZE 120M;
sqlplus / as sysdba
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
Step 3:
rman target /
RESTORE STANDBY CONTROLFILE FROM SERVICE PRIM;
Step 4:
sqlplus / as sysdba
ALTER DATABASE MOUNT STANDBY DATABASE;
Step 5:
rman target /
CATALOG START WITH '+ORA_DATA/DATAFILE/';
SWITCH DATABASE TO COPY;
Step 6:
sqlplus / as sysdba
set pages 0 verify off feed off term off echo off
spool /tmp/clear.sql
select distinct 'ALTER DATABASE CLEAR LOGFILE GROUP '||GROUP#||';' as cmd from v$logfile;
spool off
@/tmp/clear.sql
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Step 2:
rman target /
RECOVER DATABASE FROM SERVICE PRIM USING COMPRESSED BACKUPSET NOREDO SECTION SIZE 120M;
sqlplus / as sysdba
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
Step 3:
rman target /
RESTORE STANDBY CONTROLFILE FROM SERVICE PRIM;
Step 4:
sqlplus / as sysdba
ALTER DATABASE MOUNT STANDBY DATABASE;
Step 5:
rman target /
CATALOG START WITH '+ORA_DATA/DATAFILE/';
SWITCH DATABASE TO COPY;
Step 6:
sqlplus / as sysdba
set pages 0 verify off feed off term off echo off
spool /tmp/clear.sql
select distinct 'ALTER DATABASE CLEAR LOGFILE GROUP '||GROUP#||';' as cmd from v$logfile;
spool off
@/tmp/clear.sql
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;