Oracle: to restore archive log
SELECT thread#, process, pid, status, client_process, client_pid, sequence#, block#, active_agents, known_agents FROM gv$managed_standby
ORDER BY thread#, process;
RMAN>
run {
set archivelog destination to '/usr/opt/app/oracle/admin/bfprod/arch';
allocate channel aux1 device type disk;
restore archivelog logseq 2777 thread 1; <-- to restore one archive log
### 4> restore archivelog from logseq=36747 until logseq=36753 thread=1; <-- to restore a range of archive logs
release channel aux1;
}
3* where completion_time between to_date('SEP-28-2015 07:55:00','MON-DD-YYYY HH24:MI:SS') and to_date('SEP-28-2015 08:05:00','MON-DD-YYYY HH24:MI:SS')
SQL> /
SEQUENCE# FIRST_TIM FIRST_CHANGE# NEXT_TIME NEXT_CHANGE#
---------- --------- --------------- --------- ------------
299184 28-SEP-15 65484369404 28-SEP-15 6.5484E+10
299185 28-SEP-15 65484379464 28-SEP-15 6.5484E+10
3* where completion_time between to_date('SEP-28-2015 23:55:00','MON-DD-YYYY HH24:MI:SS') and to_date('SEP-29-2015 00:05:00','MON-DD-YYYY HH24:MI:SS')
SQL> /
SEQUENCE# FIRST_TIM FIRST_CHANGE# NEXT_TIME NEXT_CHANGE#
---------- --------- --------------- --------- ------------
299511 28-SEP-15 65487872065 28-SEP-15 6.5488E+10
299512 28-SEP-15 65487878331 29-SEP-15 6.5488E+10
299513 29-SEP-15 65487881871 29-SEP-15 6.5488E+10
3* where completion_time between to_date('SEP-29-2015 23:55:00','MON-DD-YYYY HH24:MI:SS') and to_date('SEP-30-2015 00:05:00','MON-DD-YYYY HH24:MI:SS')
SQL> /
SEQUENCE# FIRST_TIM FIRST_CHANGE# NEXT_TIME NEXT_CHANGE#
---------- --------- ---------------- --------- ----------------
300057 29-SEP-15 65491615706 30-SEP-15 65491622588
502580
SQL> l
Select sequence#, to_date(first_time,'DD-MON-YYYY HH24:MI:SS') first_time, first_change#, to_date(next_time,'DD-MON-YYYY HH24:MI:SS') next_time, next_change# from v$archived_log where completion_time between to_date('DEC-04-2016 23:55:00','MON-DD-YYYY HH24:MI:SS') and to_date('DEC-06-2016 00:05:00','MON-DD-YYYY HH24:MI:SS')
SQL> /
SQL> alter database register logfile
'/var/arch/arch_1_101.arc';
rman> catalog start with '/var/arch';
After the redo logs have been registered on the physical standby database, the DBA can restart the managed recovery operations. For example, to put the physical standby database into automatic recovery managed mode:
SQL> alter database recover managed standby database disconnect from session;
Comments
Post a Comment