In a planned failover of database activity to a secondary Oracle instance, you can quickly move SharePlex to the secondary system. While users continue their transactions on that system, SharePlex captures their changes and stores them until the primary system is back online and activity is moved back to that system.
Supported databases
Oracle database on Unix or Linux
Requirements
- SharePlex must be configured correctly to support high availability. For more information, see Configure replication to maintain high availability.
- There must be enough disk space where the queues reside on the secondary system to contain the data that accumulates while users are working on that system.
- You must know how to run SharePlex. For more information, see Run SharePlex.
- You must understand the SharePlex flush command. For more information, see the SharePlex Reference Guide.
Procedure
This procedure is divided into logical segments. Follow them in the order presented. Do not shut down the primary instance until prompted in the procedure.
Switch users to the secondary system
- On the primary system, stop user access to the primary instance.
-
On the primary system, flush the data in the queues to the secondary system. This command stops Post on the secondary system and places a marker in the data stream to establish a synchronization point between the primary and secondary data.
sp_ctrl> flush datasource
where: datasource is the datasource specification of the primary Oracle instance, for example o.OraA.
-
On the secondary system, verify that Post stopped. (Continue to issue this command until it shows that Post stopped.)
sp_ctrl> status
-
On the primary system, verify that there are no messages in the capture and export queues. The Number of Messages and the Backlog (messages) fields must be 0.
sp_ctrl> qstatus
-
On the secondary system, verify that there are no messages in the post queue. The Number of Messages and the Backlog (messages) fields must be 0.
sp_ctrl> qstatus
- On the primary system, shut down SharePlex.
-
On the primary system, shut down the Oracle instance with the abort option. Do not use the immediate option.
svrmgr1> shutdown abort
Note: This resets the sequence on the primary system to the top of the cache when the database starts.
-
On the secondary system, verify that Export is stopped. This prevents user changes from being replicated to the primary system until it is back online and SharePlex is ready to receive them. Stop Export if needed.
sp_ctrl> status
sp_ctrl> stop export
- On the secondary system, run the script that grants INSERT, UPDATE and DELETE access to all users.
- On the secondary system, run the script that enables triggers and constraints on the secondary instance.
- Run your failover procedure for relocating users to the secondary system, including starting the applications and starting jobs that were running on the primary system.
- Move the users to the secondary system to resume working, but do not start the Export process.
Switch users back to the primary system
- On the primary system, open the Oracle instance. The sequence on this system should now be at the top of the cache.
- On the primary system, disable triggers on the tables, or run the sp_add_trigger.sql utility script so that the triggers ignore the SharePlex user.
- On the primary system, disable check constraints and scheduled jobs that perform DML.
- On the primary system, start SharePlex.
-
On the secondary system, start Export so that SharePlex sends the accumulated replicated data to the primary system.
sp_ctrl> start export
Note: SharePlex passes any sequence updates from the secondary system back to the primary system when Export starts.
-
On the primary system, stop Export.
sp_ctrl> stop export
-
On the primary system, allow Post to process the message backlog that was sent from the primary system.
- On the secondary system, stop user access to the Oracle instance.
-
On the secondary system, flush the data in the queues to the primary system.
sp_ctrl> flush datasource
where: datasource is the datasource specification of the secondary Oracle instance, for example o.OraB.
-
On the primary system, verify that Post stopped. (Continue to issue this command until it shows that Post stopped.)
sp_ctrl> status
-
On the secondary system, verify that there are no messages in the capture and export queues. The Number of Messages and the Backlog (messages) fields must be 0.
sp_ctrl> qstatus
-
On the primary system, verify that there are no messages in the post queue. The Number of Messages and the Backlog (messages) fields must be 0.
sp_ctrl> qstatus
-
On the secondary system, shut down SharePlex.
sp_ctrl> shutdown
-
On the secondary system, shut down the Oracle instance with the abort option. Do not use the immediate option.
svrmgr1> shutdown abort
Note: This resets the sequence on the secondary system to the top of the cache when the database starts.
-
On the secondary system, start the Oracle instance.
svrmgr1> startup
Note: The sequence on the secondary system is now at the top of the cache. When the next value is selected on the primary system, a new cache is acquired and is replicated to the secondary system. Now, the primary system is at the start of a cache, and the secondary system is at the top of a cache.
- On the primary system, run the script that grants INSERT, UPDATE and DELETE access to all users.
- On the primary system, run the script that enables triggers and constraints on the primary system when users begin using this system.
- Run your failover procedure for moving users back to the primary system, including starting the applications and starting jobs that were running on the secondary system.
- Switch the users to the primary system to resume working, but do not start the Export process. This prevents replicated data from being sent to the secondary system until SharePlex is ready to receive it there.
Resume replication to maintain the secondary instance
- On the secondary system, disable triggers on the tables, or run the sp_add_trigger.sql utility script so that the triggers ignore the SharePlex user.
- On the secondary system, disable check constraints and scheduled jobs that perform DML.
- On the secondary system, start SharePlex.
-
On the secondary system, stop Export. This prevents any accidental DML on that system from being replicated to the primary system.
sp_ctrl> stop export
-
On the primary system, start export.
sp_ctrl> start export
-
On the secondary system, start Post.
sp_ctrl> start post
Replication from the primary instance to the secondary instance is now active to keep the two databases synchronized and ready for future failover when needed.