Beruflich Dokumente
Kultur Dokumente
Overview
---------------
A switchover is a role reversal between the primary database and one of its
standby
databases. A switchover operation guarantees no data loss. This is typically done
for planned maintenance of the primary system. During a switchover, the primary
database transitions to a standby role and the standby database transitions to
the primary role. The transition occurs without having to re-create either
database.
1. Verify that both the primary and standby init.ora support role transition.
Oracle recommends that you maintain a single init.ora for both the primary
and the standby. Each init.ora should have all the parameters that are needed
to support either the standby or primary role. An example of the primary
init.ora follows:
-- snip ---
FAL_SERVER=920DG_hasunclu2
FAL_CLIENT=920DG_hasunclu1
DB_FILE_NAME_CONVERT=('/standby','/primary')
LOG_FILE_NAME_CONVERT=('/standby','/primary')
STANDBY_ARCHIVE_DEST=/database/oracle/920DG/arch
STANDBY_FILE_MANAGEMENT=AUTO
-- snip --
-- snip --
FAL_SERVER=920DG_hasunclu1
FAL_CLIENT=920DG_hasunclu2
DB_FILE_NAME_CONVERT=("/primary","/standby")
LOG_FILE_NAME_CONVERT=("/primary","/standby")
STANDBY_ARCHIVE_DEST=/database/oracle/920DG/standby/arch
LOG_ARCHIVE_DEST_1='LOCATION=/database/oracle/920DG/standby/arch'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_FORMAT=%d_%t_%s.arc
STANDBY_FILE_MANAGEMENT=AUTO
LOG_ARCHIVE_DEST_2='SERVICE=920DG_hasunclu1'
LOG_ARCHIVE_DEST_STATE_2=DEFER
-- snip --
With the initialization parameters on both the primary and standby databases
set as described above, the only parameter that needs to change after a role
transition is the LOG_ARCHIVE_DEST_STATE_2 parameter. Change this parameter to
ENABLED on the database that assumes the primary role.
2. Verify that there is network connectivity between the primary and standby
locations.
5. Verify that all but one primary instance and one standby instance in a Real
Application Clusters configuration are shut down.
6. For a Real Application Clusters database, only one primary instance and one
standby instance can perform the switchover operation. Shut down all other
instances before the switchover operation.
8. The standby database that you plan to transition to the primary role must be
mounted before you begin the switchover operation. Ideally, the physical
standby database will also be actively recovering archived redo logs when
the database roles are switched. If the physical standby database is open
for read-only access, the switchover operation still will take place, but
will require additional time.
9. For switchover operations involving a logical standby database, both the primary
and standby database instances are open.
10. Place the standby database that will become the new primary database in
ARCHIVELOG mode.
11. Remove any redo data application delay in effect on the standby database.
SWITCHOVER_STATUS
------------------
TO STANDBY
Note that the clause also works with the switchover to primary command.
SESSIONS ACTIVE - Indicates that there are active SQL sessions attached to
the primary or standby database that need to be disconnected before the
switchover operation is permitted.
SWITCHOVER LATENT - The switchover was in pending mode, but did not complete
and went back to the primary database.
RECOVERY NEEDED - This is a standby database that has not received the
switchover request.
Database altered.
Database altered.
5. Verify that the physical standby can be converted to the new primary:
SWITCHOVER_STATUS
------------------
SWITCHOVER PENDING
Note that if the status returns SESSIONS ACTIVE then you should append the
with session shutdown clause to the command in step 6.
Database altered.
If you are on verion 9.0.1 then you should first cancel managed recovery prior
to issuing the above command. If you are on 9.2.0 and have started managed
recovery with the "through all switchover" clause then you should also cancel
managed recovery before issuing the above command.
Database altered.
2. Stop the old primary database from shipping archive logs to the logical
standby:
System altered.
Database altered.
4. Enable archiving from the new primary to the new logical standby
System altered.
6. On the new logical standby database (formerly the primary database) and on
any other existing logical standby destinations, begin SQL apply operations:
SQL> ALTER DATABASE START LOGICAL STANDBY APPLY NEW PRIMARY location1;
7. On the new primary database, enable archive logging and switch logs to ensure
that all the standby databases begin receiving redo logs by executing the
following SQL statements: