Use this procedure to synchronize the source and target data with the following utilities:
- Import/Export/Data Pump
- Store/Restore from tape
- FTP
Note: This document does not provide instructions for how to perform the chosen copy method. This procedure should be performed by someone who has a solid understanding of database copy methods.
Preliminary considerations
Read these points before you proceed.
Supported databases
Oracle source and Oracle target
Supported replication strategies
All but high-availability. This procedure is not appropriate for a high-availability strategy because it requires the source database to be quieted while the configuration file is being activated.
Requirements
- Read the requirements before you start this procedure. For more information, see Requirements for activating a configuration.
- Users must stop accessing the production database while the copy and configuration activation take place.
- The target instance must exist.
- Make certain SharePlex database accounts exist in the source and target databases. This account usually is created during installation. See the SharePlex Installation and Setup Guide for more information.
- Before you start, review this procedure and see the SharePlex Reference Guide for more information about the commands that are used.
Naming conventions used
In this procedure, the "source" system is one of the following:
- The source system of a single-direction replication configuration, including cascading replication.
- All source systems of a consolidated replication configuration.
- The trusted source system in a peer-to-peer replication configuration.
- The primary node of a cluster (where the cluster VIP is running).
In this procedure, the "intermediary" system only needs to be part of this procedure if SharePlex will be posting to, and capturing from, an intermediary system in a cascading configuration.
In this procedure, the "target" system is one of the following:
- The target system of a single-direction replication configuration, including cascading and consolidated replication.
- The secondary systems in a peer-to-peer replication configuration.
- The primary node (where the cluster VIP is running) of the target cluster.
In this procedure, the SharePlex commands in the procedure apply to all sp_cop instances that apply to the replication strategy you are using (for example, all sp_cop processes on a target in consolidated replication).
Procedure
-
On the source system, stop user access to the objects that are in the replication configuration.
- If deploying consolidated replication, you can either stop access to all of the source systems at once and make the copies at the same time, or you can synchronize each source system one at a time using these instructions.
- If deploying peer-to-peer replication, stop access to all databases in the peer group, including the trusted source.
- Copy the files from the source system to the intermediary and target systems.
- On the source system, start sp_cop and sp_ctrl.
-
On the source system, activate the configuration file (all files if using consolidated replication).
sp_ctrl> activate config filename
- On the intermediary and target systems, start sp_cop and sp_ctrl.
-
On the intermediary and target systems, stop Post. Stopping Post allows any data that gets replicated before the target data is established to collect in the post queue.
sp_ctrl> stop post
- On the source system, allow users to resume access to the source database.
-
On the source system, verify that the sp_cop, Capture, and Read processes are running.
sp_ctrl> status
- Start and mount the intermediary and target databases, but do not allow users access.
- On the intermediary and target systems, apply the copy to the database.
-
On the intermediary and target systems, disable triggers on the tables, or run the sp_add_trigger.sql utility script so that the triggers ignore the SharePlex user.
- On the intermediary and target systems, disable check constraints and scheduled jobs that perform DML.
- [Partitioned replication only] If you are using vertically partitioned or horizontally partitioned replication for any tables, delete the unneeded columns and rows from those tables on the intermediary and target systems.
-
[Intermediary system only] Set the SP_OCT_REPLICATE_POSTER parameter to 1. This directs SharePlex to capture posted changes on that system and replicate them to the target system.
sp_ctrl> set param SP_OCT_REPLICATE_POSTER 1
-
[Intermediary system only] Activate the configuration file.
sp_ctrl> activate config filename
- [Peer-to-peer] Activate the configuration file on the target systems.
-
Start Post on:
- The intermediary system
- The trusted source and all other targets in a peer group
- All other targets
Note: SharePlex will start executing SQL statements that accumulated in the post queue.
- [Peer-to-peer] On the target systems in the peer group, allow users to resume access to the database.
Use this procedure to synchronize an Oracle source database with an Open Target database. SharePlex replicates the Oracle data changes and maintains them in the Post queue until the target is established with the copy. When the target is ready, you run the SharePlex reconcile feature, which ensures that Post only applies the operations that occurred after the copy and discards operations that were committed to the source before the copy.
Preliminary considerations
Read these points before you proceed.
Supported databases
Oracle source and any supported target
Supported replication strategies
All
Requirements
Procedure
- On the source and target systems, start sp_cop and sp_ctrl from the bin sub-directory of the SharePlex product directory.
-
On source and target systems, verify that the SharePlex processes are running.
sp_ctrl> status
-
On the target system, stop the Post process. This allows replicated data to accumulate in the post queue until the target database is instantiated and reconciled.
sp_ctrl> stop post
-
Activate the configuration on the source system.
sp_ctrl> activate config filename
-
On the source system, monitor activation status.
Note: The command retains control of sp_ctrl until activation is finished.
- When activation is complete, start the hot backup to the staging instance.
-
When the hot backup is finished, switch log files on the primary source system twice.
On-premises database:
svrmgr1> alter system switch logfile;
svrmgr1> alter system switch logfile;
Amazon RDS database:
Run the Amazon RDS procedure rdsadmin.rdsadmin_util.switch_logfile twice.
- Copy the archive logs that were generated by the log switch from the primary instance to the staging instance.
-
Do one of the following:
- If the source is RAC, recover the database on the staging server to the latest SCN of the last archive log that was copied to the staging server.
-
If the source is not RAC, recover to the sequence number of the last archive log that was copied to the staging server.
Note: The next steps apply the replicated changes that occurred after the backup point.
-
Do one of the following:
- Using the copy method of your choice, make a copy of the Oracle data from the staging server to the Open Target database. Wait until the copy is finished before proceeding to the next step.
-
[Optional] If you are using named post queues and are unsure of the queue names, issue the qstatus command and make a note of them.
sp_ctrl> qstatus
- On the target system, disable triggers on the target tables.
- On the target system, disable check constraints and scheduled jobs that perform DML.
-
On the target system, run sp_ctrl, then issue one of the following reconcile commands. If you are using named post queues, issue the command for each one.
-
If the source is non-RAC, reconcile to the log sequence number of the log that you noted previously.
sp_ctrl> reconcile queue queuename for datasource-datadest seq sequence_number
Example: reconcile queue SysA for o.prod1-r.rep1 seq 1234
-
If the source is RAC, reconcile to the SCN that you noted previously.
sp_ctrl> reconcile queue queuename for datasource-datadest scn scn_number
Example: reconcile queue SysA for o.prod1-r.rep1 scn 0123456789
Note: The command retains control of sp_ctrl until the reconcile process is finished.
-
On the target system, start the Post process. The two instances are now in synchronization, and SharePlex will continue replicating to maintain synchronization.
sp_ctrl> start post
This chapter contains an overview of the tools that SharePlex provides to detect errors and monitor the replication processes. Like any mission-critical software, SharePlex should be monitored regularly for situations or events that could interfere with processing, especially those that could result in loss of data synchronization.
Contents
These instructions show you how to forcefully terminate SharePlex processes in cases where replication must be shut down immediately. In normal circumstances, follow the shutdown instructions in the following topic:
Run SharePlex
View and terminate SharePlex processes
On Windows systems, SharePlex is managed by the NuTCRACKER operating environment, rather than the Windows operating system. However, you can view and terminate SharePlex processes in the normal manner, as you would other Windows programs.
View SharePlex processes
You can view the SharePlex processes on Windows systems in the following ways:
- From the Command Prompt console using the tlist program provided with the SharePlex software.
- From the Windows Task Manager.
In the Windows Task Manager, SharePlex appears as Sp_Copsrv.exe, representing the SharePlex sp_cop process. The operating system controls the parent Sp_Copsrv.exe service. The parent Sp_Copsrv.exe process spawns child Sp_Copsrv.exe processes — one for each replication process (Capture, Read, Export, Import, Post, sp_ctrl, and so forth.).
For a standard uni-directional configuration replicating through default queues to one target system, there are following processes on a Windows system:
On the source system:
- One parent Sp_Copsrv.exe process.
- One Sp_Ocap or Sp_capture (Capture) process plus one child Sp_Copsrv.exe process.
- One Sp_Ordr (Read) process plus one child Sp_Copsrv.exe process.
- One Sp_Xport (Export) process plus one child Sp_Copsrv.exe process.
- If there are any additional SharePlex processes running, such as sp_ctrl, there is an additional Sp_Copsrv.exe process for each one.
On the target system:
- One parent Sp_Copsrv.exe process.
- One Sp_Mport (Import) process plus one child Sp_Copsrv.exe process.
- One Sp_Opst_Mt (Oracle Post) or Sp_Xpst (Open Target Post) process plus one child Sp_Copsrv.exe process.
- If there are any additional SharePlex processes running, such as sp_ctrl, there is an additional Sp_Copsrv.exe process for each one.
If there are no active replication configurations, the SharePlex processes do not start when you start the service, and just the parent Sp_Copsrv.exe will be running.
To identify the parent Sp_Copsrv.exe process in the Windows Task Manager, look for the one that is using the largest amount of memory. The child Sp_Copsrv.exe processes consume less memory than the parent process.
To identify which replication process is associated with a child Sp_Copsrv.exe process, look in the SharePlex Event Log for the message stating when the replication process started. This entry provides the PID for that process and the PID of the associated Sp_copsvr.exe process.
Terminate SharePlex processes
You can terminate SharePlex processes on Windows systems as follows:
- Windows Task Manager: Terminate one SharePlex process at a time
- KillSharePlex.bat: Terminate all SharePlex processes at once with a batch file.
To terminate a process with Task Manager
- Press Control | Alt | Delete.
- Select Start Task Manager or Task Manager, depending on your Windows version.
- Select the Processes tab.
- (Optional) Sort the processes by name.
- Select the process that you want to kill.
- Click End Process.
To terminate all processes with KillSharePlex.bat
Run KillSharePlex.bat from the bin sub-directory of the SharePlex product directory.
Note: This tool terminates all SharePlex processes without displaying them. There are no user prompts or confirmation messages.