Documente Academic
Documente Profesional
Documente Cultură
STEP 1:
=======
SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
Verify there is no log file gap between the primary and the standby database.It
is important that both the STATUS is VALID and that GAP_STATUS has the value NO
GAP.
SQL> select status, gap_status from v$archive_dest_status where dest_id = 2;
STEP 2:
=======
Verify that the standby database has temporary files that match the primary.
Primary
SQL> select name from v$tempfile;
NAME
-------------------------------------------------------------------------------/data1/oracle10g/oracle/product/10.2.0/oradata/orcl/temp01.dbf
Standby
SQL> select name from v$tempfile;
NAME
-------------------------------------------------------------------------------/data1/oracle10g/oracle/product/10.2.0/oradata/orcl/temp01.dbf
STEP 3:
=======
Verify there is no delay in effect for applying redo on standby. If there is a d
elay remove it.
You can determine if there is a delay in applying archive logs by looking at the
DELAY_MINS column of V$ARCHIVE_DEST.
SQL> select delay_mins from v$archive_dest where dest_id = 2;
DELAY_MINS
---------0
If there is a delay you can use the following to disable the delay for the physi
cal standby
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;
STEP 4:
=======
PROCESS
PROGRAM
------------------------ -------------------------------------------3536
3536
13544
3536
8266
emagent@prod.localdomain
emagent@prod.localdomain
sqlplus@prod.localdomain
emagent@prod.localdomain
oracle@dreco.localdomain
(TNS
(TNS
(TNS
(TNS
(TNS
V1-V3)
V1-V3)
V1-V3)
V1-V3)
V1-V3)
You should verify the connected sessions even if the SWITCHOVER_STATUS is TO STA
NDBY.
STEP 6: Switch the Primary to the Standby Role
=======
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY.
If your database has a SWITCHOVER_STATUS of ACTIVE SESSIONS you will need to app
end the WITH the below:
SQL> alter database commit to switchover to physical standby with session shutdo
wn;
Database altered.
STEP 6:
=======
SQL> shutdown immediate
SQL> startup mount
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
-------------------SESSIONS ACTIVE
switch the standby database to a primary database
==================================================
Note: Before going on you should check the LOG_ARCHIVE_DEST_n parameters. You ma
y need to set up a LOG_ARCHIVE_DEST_n parameter to write archive logs to the new
primary.
alter system set log_archive_dest_2='service="orcl" LGWR ASYNC NOAFFIRM delay=0
optional compression=disable max_failure=0 max_connections=1 reopen=300 db_uniqu
e_name="orcl" net_timeout=30 valid_for=(all_logfiles,primary_role)' scope = both
;
-ON Primary-------------------------------------------------------------------------------------------------------------------------------------------------------------------SQL> alter system set log_archive_dest_2='service="orcl" LGWR ASYNC NOAFFIRM del
ay=0 optional db_unique_name="orcl" valid_for=(all_logfiles,primary_role)' scop
e = both;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------on primary:
SQL> alter system set log_archive_dest_2='service="orcl_stby" LGWR ASYNC NOAFFIR
M delay=0 optional db_unique_name="orcl_stby" valid_for=(all_logfiles,primary_r
ole)' scope = both;
System altered.
SQL> Alter database recover managed standby database using current logfile disco
nnect from session;
Database altered.
SQL> alter system set log_archive_dest_state_2=ENABLE;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
on standby
----------SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> alter database open;
Database altered.
select database_role from v$database;
Start Redo Apply on the new physical standby database
SQL> alter database recover managed standby database using current logfile disco
nnect from session;
Database altered.
SQL> alter system switch logfile;
SQL> select status, gap_status from v$archive_dest_status where dest_id = 2;
STATUS
GAP_STATUS
--------- -----------------------VALID
NO GAP
NOTE:
=====
SQL> Alter database recover managed standby database using current logfile disco
nnect from session; ---if this not work on standby then use other below command
Alter database recover managed standby database using current logfile disconnect
from session
*
ERROR at line 1:
ORA-38500: USING CURRENT LOGFILE option not available without stand
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
REF:
=====
http://www.oracledistilled.com/oracle-database/data-guard-switchover-to-a-physic
al-standby/
http://pavandba.com/2009/10/24/configuration-of-oracle-10g-data-guard/