Restore Oracle Dataguard/standby using service

 
==> Datgaurd refresh  using service 



1)  disable Mrp and transport 


2)  restore new controlfile from prod 

restore standby controlfile from service <tns alias for primary database>;



3) restore database 

run 
{
allocate channel c1 device type disk;  
allocate channel c2 device type disk;  
allocate channel c3 device type disk;  
allocate channel c4 device type disk;
allocate channel c5 device type disk;
allocate channel c6 device type disk;
allocate channel c7 device type disk;
allocate channel c8 device type disk;
allocate channel c9 device type disk;
allocate channel c10 device type disk;
allocate channel c11 device type disk;
allocate channel c12 device type disk;
allocate channel c13 device type disk;
allocate channel c14 device type disk;
allocate channel c15 device type disk;
allocate channel c16 device type disk;
set newname for  database to '+idsflp_DATA' ;
restore database from service service_name ;
switch datafile all;
-- switch database to copy ;
-- recover database;
release channel ch1;
release channel ch2;
release channel ch3;
}



3)  Clear logfile group all

> begin
for log_cur in ( select group# group_no from v$log )
loop
execute immediate 'alter database clear logfile group '||log_cur.group_no;
end loop;
end;
/

SQL> begin
for log_cur in ( select group# group_no from v$standby_log )
loop
execute immediate 'alter database clear logfile group '||log_cur.group_no;
end loop;
end;
/


3)  enable recovery 

Comments

Popular posts from this blog

How To Purge Optimizer Statistics Advisor Old Records From 12.2 Onwards (Doc ID 2660128.1)

Oracle session snapper

Oracle Materialized View In-Depth and Materialized View refresh issues in 19c