Posts

Showing posts from 2015

Testing FAILOVER when primary database is not available

Image
Send redo data from Primary database if MOUNT is possible.
ALTER SYSTEM FLUSH REDO TO target_db_name; At Standby, if Flashback Database is not already enabled:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; # 3 days
ALTER DATABASE FLASHBACK ON; Create a restore point BEFORE_FAILOVER, The restore point will be used later to restore the database again to the same state before FAILOVER scenario.
set lines 300
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
CREATE RESTORE POINT before_failover GUARANTEE FLASHBACK DATABASE;
SELECT scn, guarantee_flashback_database, name FROM v$restore_point;

SCN GUARANTEE_FLASHBACK_DATABASE NAME
------- ---------------------------- ----------------
2619073 YES BEFORE_FAILOVER Testing FAILOVER on physical standby database STBY.
SELECT name, db_unique_name, log_mode, protection_mode, database_role
FROM v$database;

NAME DB_UNIQUE_NAME LOG_MODE PROTEC…

Rolling Forward a Physical Standby Database Using the RECOVER FROM SERVICE

Image
Hi
Since Oracle 12c we can recover standby only by accessing the standby database/site, no need to copy nor transfer any file
Short and easy - just copy and paste
enjoy :)

Standby Database Name: STBY
Primary Database Name: PRIM

On Standby
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;

rman target /
RECOVER DATABASE FROM SERVICE PRIM USING COMPRESSED BACKUPSET NOREDO SECTION SIZE 120M;

sqlplus / as sysdba
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;

rman target /
RESTORE STANDBY CONTROLFILE FROM SERVICE PRIM;

sqlplus / as sysdba
ALTER DATABASE MOUNT STANDBY DATABASE;

rman target /
CATALOG START WITH '+DATA/STBY/DATAFILE/';
SWITCH DATABASE TO COPY;

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#||'…