Wednesday, 2 October 2019

failover testing

 select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
RDP    READ WRITE           PRIMARY
alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';

Session altered.
select sequence#,first_time,next_time,applied from v$archived_log order by sequence#; SEQUENCE# FIRST_TIME           NEXT_TIME            APPLIED
---------- -------------------- -------------------- ---------
       491 01-OCT-19 02-OCT-19 NO
       491 01-OCT-19 02-OCT-19 YES
       492 02-OCT-19 02-OCT-19 YES
       492 02-OCT-19 02-OCT-19 NO
select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
TO STANDBY
alter system archive log current;
alter database commit to switchover to standby;

database altered;

or

alter database commit to switchover to standby with session shutdown;
shut immedite
startup nomount
alter database mount standby database;
database altered;
alter database recover managed standby database disconnect from session;
alter system set log_archive_dest_state_2=defer;
                  Standby database  SDEFR2PB02
select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
PRD    MOUNTED              PHYSICAL STANDBY
alter database recover managed standby database cancel;
alter database commit to switchover to primary with session shutdown;

or
alter database commit to switchover to primary;
shut immediate
startup mount
Alter database open;

database altered.

SQL> select INSTANCE_NAME,name,open_mode,database_role from v$database,v$instance;

INSTANCE_NAME    NAME      OPEN_MODE            DATABASE_ROLE
---------------- --------- -------------------- ----------------
RDSBY        PRD    READ WRITE           PRIMARY
SQL> !
[oracle@SDEFRB02 ~]$ date
Wed Oct  2 09:12:57 CEST 2019
Alter system switch logfile

SQL> alter system switch logfile
  2  ;

System altered.

SQL> !
[oracle@SDEFB02 ~]$ date
Wed Oct  2 09:15:53 CEST 2019
CONNECTIVITY CHECKING BY O & M TEAM
[oracle@SDEFB02 ~]$ sqlplus

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Oct 2 09:16:37 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.



Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> show user;
USER is "GBO_"

No comments:

Post a Comment

Featured post

duplicate db from standy to other server

 Duplicate Testuat   $ export ORACLE_SID=Testuat3 $ sqlplus '/as sysdba' Testuat3 SQL> alter system set cluster_database=FALSE sc...