Check the status of the database:
select open_mode,database_role from v$database;Cancel the recovery process:
alter database recover managed standby database cancel;
Make sure the standby database is running with spfile if not, create 1 and restart the db:
show parameter spfile ;
create spfile from pfile ;
shut immediate ;
startup mount;
show parameter spfile ;
Enable flashback mode as Flashback is turned off on standby database:
select flashback_on from v$database;
alter database recover managed standby database cancel;
shut immediate
startup mount;
show parameter db_recovery_file_dest
alter system set db_recovery_file_dest_size=100G ;
alter system set db_recovery_file_dest='/Archive/PROD/archives' ;
show parameter db_recovery_file_dest
alter database flashback on;
Now convert Physical standby to snapshot standby:
select NAME, GUARANTEE_FLASHBACK_DATABASE from v$restore_point;
select status from v$instance;
select open_mode,database_role from v$database;
select status from v$instance;
alter database convert to snapshot standby;
alter database open;
shut immediate;
startup;
select name,open_mode,database_role from v$database;
select NAME,GUARANTEE_FLASHBACK_DATABASE from v$restore_point;
Release the instance for customer testing:
Now revert to physical standby:
shut immediate;
startup mount
select FLASHBACK_ON from v$database;
alter database convert to physical standby;
select name,open_mode,database_role from v$database;
select status from v$instance;
shut immediate
startup nomount
alter database mount standby database;
alter database flashback off;
select flashback_on from v$database;
select name,open_mode,database_role from v$database;
alter database recover managed standby database disconnect from session;
Verify the standby sync with primary database.
select to_char(sysdate,'DD.MM.RR HH24:MI:SS') time, a.thread#, (select max(sequence#) from v$archived_log where archived='YES' and thread#=a.thread#) archived, max(a.sequence#) applied, (select max(sequence#) from v$archived_log where archived='YES' and thread#=a.thread#)-max(a.sequence#) gap from v$archived_log a where a.applied='YES' group by a.thread#;
select PROCESS,STATUS,THREAD#,SEQUENCE#,BLOCK# from v$managed_standby;
show parameter spfile ;
create spfile from pfile ;
shut immediate ;
startup mount;
show parameter spfile ;
Enable flashback mode as Flashback is turned off on standby database:
select flashback_on from v$database;
alter database recover managed standby database cancel;
shut immediate
startup mount;
show parameter db_recovery_file_dest
alter system set db_recovery_file_dest_size=100G ;
alter system set db_recovery_file_dest='/Archive/PROD/archives' ;
show parameter db_recovery_file_dest
alter database flashback on;
Now convert Physical standby to snapshot standby:
select NAME, GUARANTEE_FLASHBACK_DATABASE from v$restore_point;
select status from v$instance;
select open_mode,database_role from v$database;
select status from v$instance;
alter database convert to snapshot standby;
alter database open;
shut immediate;
startup;
select name,open_mode,database_role from v$database;
select NAME,GUARANTEE_FLASHBACK_DATABASE from v$restore_point;
Release the instance for customer testing:
Now revert to physical standby:
shut immediate;
startup mount
select FLASHBACK_ON from v$database;
alter database convert to physical standby;
select name,open_mode,database_role from v$database;
select status from v$instance;
shut immediate
startup nomount
alter database mount standby database;
alter database flashback off;
select flashback_on from v$database;
select name,open_mode,database_role from v$database;
alter database recover managed standby database disconnect from session;
Verify the standby sync with primary database.
select to_char(sysdate,'DD.MM.RR HH24:MI:SS') time, a.thread#, (select max(sequence#) from v$archived_log where archived='YES' and thread#=a.thread#) archived, max(a.sequence#) applied, (select max(sequence#) from v$archived_log where archived='YES' and thread#=a.thread#)-max(a.sequence#) gap from v$archived_log a where a.applied='YES' group by a.thread#;
select PROCESS,STATUS,THREAD#,SEQUENCE#,BLOCK# from v$managed_standby;
No comments:
Post a Comment