Professional Documents
Culture Documents
18c & 19c Physical Standby Switchover Best Practices Using SQLPlus
18c & 19c Physical Standby Switchover Best Practices Using SQLPlus
18c & 19c Physical Standby Switchover Best Practices Using SQLPlus
Dashboard Knowledge Service Requests Patches & Updates
Give Feedback...
Copyright (c) 2023, Oracle. All rights reserved. Oracle Confidential.
18c & 19c Physical Standby Switchover Best Practices using SQL*Plus (Doc ID 2485237.1) To Bottom
Goal Yes
No
Solution
Prerequisites
Document Details
Latest psu/bundle patches
Setup/configuration verification
Type:
Verify Initialization Parameters Status: HOWTO
Last Major PUBLISHED
Understand and Test Fallback Options 17-Jun-2021
Update:
Pre-Switchover Last 17-Apr-2023
Update: English
Verify Redo/Archive log apply is good and there are no gaps
Language:
Check the datafiles & Tempfiles status
Recently Viewed
APPLIES TO:
GOAL
This Document explain about switchover steps for 18c and 19c
SOLUTION
Prerequisites
Setup/configuration verification
You can also optionally use the below queries to check the redo transport and apply status.
On Primary:
Check the remote redo log transport status and errors, V$ARCHIVE_DEST.ERROR will show the details.
On Standby:
Using the below query, check the last received archivelog from primary database (RAC database result will be displayed for each
thread).
log_archive_config : should include primary and standby database (if multiple standby databases are existing, then all the
standby database details should be included)
fal_server : remote server from where archivelog can be fetched
db_unique_name : unique name under this configuration
log_archive_dest_n: for remote database to send archives
In idle primary & one standby configuration, primary should have configuration (log_archive_dest_n) to send archives to
standby with VALID_FOR clause (PRIMARY_ROLE,ONLINE_FILE) & standby will also have similar configuration.
Once switchover completes, new primary will have log_archive_dest_n configuration to send archive logs/redos to new
standby database.
If the datafiles and redo logfiles locations are different between primary and standby, then use db_file_name_convert &
log_file_name_convert respectively.
Pre-Switchover
Ensure Prerequisites are completely verified. Along with Prerequisites, Follow the below guidance to have successful switchover.
These steps should be executed before real planned outage starts and ensure no issues.
Run the below query in physical standby to check last archive log sequence received and applied from all the threads. This will
not include current sequence of primary database as the SQL is extracting details from v$archived_log.
Check the MRP(Managed Recovery Process) process status (it should be started, running and applying the logs).
If standby database recovery (MRP) started with delay OR if the standby always maintained with lag, then switchover will
consume time to apply the logs to be synchronised.
Before switchover, try to maintain minimal archive log apply lag, which will reduce the total switchover time window.
1) Make zero archivelog transport lag Monitoring Redo Transport Services and apply all archivelogs
2) Standby can also be recovered using incremental backup taken from primary Restoring and Recovering Files Over the
Network
Expected all the datafiles should be online in primary and standby, incase if there are files in offline (OR) NOT in online status,
then restore the file and recover so standby database datafiles are same as primary database datafiles.
Check the file status and use the below command to make files online.
For tempfiles:
SQL> select tf.name filename, bytes, ts.name tablespace from v$tempfile tf, v$tablespace ts where
tf.ts#=ts.ts#;
Execute above SQL to get tempfile details. Add more tempfile if needed.
Data Guard Physical Standby - Managing temporary tablespace tempfiles (Doc ID 1514588.1)
At primary when the above command executed, we may get a.status in (INACTIVE,ACTIVE,CURRENT).
Expected a.status from Standby is UNUSED, CLEARING or CLEARING_CURRENT, if output has different result, then manually
clear redo logfiles.
If ORL or SRL needs to be cleared in the standby, Managed recovery process has to be stopped.
During switchover ORLs will be cleared if ORLs were not cleared previously, but switchover will be consuming time to complete.
Switchover session will wait for 15 min to complete otherwise timeout will occur. if the switchover is terminated due to timeout,
then retry again until switchover is successful.
If database is configured to use OMF files for Redo logfile OR log_file_name_convert is set, then Online redo logfiles would get
cleared automatically with the managed recovery process is started.
Note: log_file_name_convert parameter is recommended to set in primary & standby even though SRL & ORL locations are
same at primary and standby.
If the file locations are same at primary and standby, then configure log_file_name_convert with same value as replacing
string.
Example: log_file_name_convert='dummy','dummy'
You must configure the LOG_ARCHIVE_DEST_n and LOG_ARCHIVE_DEST_STATE_n parameters for each standby database.
When a switchover or failover occurs, all standby databases continues to receive redo logs / Archivelogs from the new primary
database.
If the delay configured, stop the MRP process and start the MRP process without delay.
If the delay is not removed, then switchover will take longer time.
Specifying a Time Delay for the Application of Archived Redo Log Files
Switchover
o
While doing switchover, if standby connection needs to be maintained without disconnecting, then set the parameter
STANDBY_DB_PRESERVE_STATES to SESSION OR to ALL.
If the below command executes successfully, then "Database Altered" message should be returned (Execute the below SQL in
the primary).
In case of an error, fix an issue and then rerun switchover verify command.
Example: "ORA-16475: succeeded with warnings, check alert log for more details", in this case check the alert logfile and
then resolve all the errors/warnings
Switchover steps
If switchover verify is successful, then execute the command to switchover the database.
if the step 1 is successful, then follow step 2 open the new primary database in open mode.
3) Old primary (current/new standby) should be mounted OR opened depends on the case
SQL> STARTUP;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Post Switchover
In primary:
Check, is the archivelogs are being transferred to the standby and getting applied?
Incase remote archivelog destination 2 is set in primary (log_archive_dest_2 ), we can use the below query to check the
maximum sequence transferred and applied in the standby.
In standby:
Verify the archivelog availability and the application of the archivelog files.
Additionally, Alert logfiles can be viewes to confirm the archivelog transfer and archivelog apply in standby.
REFERENCES
NOTE:888.1 - Primary Note for Database Proactive Patch Program
Didn't find what you are looking for? Ask in Community...
Related
Products
Oracle Database Products > Oracle Database Suite > Oracle Database > Oracle Database - Enterprise Edition > Oracle Data Guard > Switchover
Translations
English Source Japanese 日本語
Back to Top
Copyright (c) 2023, Oracle. All rights reserved. Legal Notices and Terms of Use Privacy Statement