The following are instructions for starting SharePlex and the sp_ctrl command-line interface on Unix, Linux, and Windows systems. Start SharePlex on the source and target systems.
To start SharePlex on Unix and Linux systems
From the bin sub-directory of the SharePlex product directory ( productdir in the following syntax), run sp_cop and sp_ctrl.
$cd /productdir/bin
$./sp_cop &
$. /sp_ctrl
To start SharePlex on Windows systems
SharePlex gets its replication instructions from a configuration file, which defines the objects that are to be replicated. The file specifies following:
Note: This demonstration demonstrates replication from one database to another. It does not cover replication to a file or a messaging container.
Perform these steps on the source system. The demonstration objects are assumed to be in the schema named splex.
Run sp_ctrl.
Issue the following command to create a configuration file named sample_config in the default text editor.
sp_ctrl(source)> create config sample_config
In the text editor, build your configuration file based on the appropriate template, as shown in the Configuration templates. Allow no spaces between the characters in a component (source specification, target specification, routing map), and place at least one space between each component.
In sp_ctrl, verify that the configuration file will activate successfully.
sp_ctrl(source)>verify config sample_config
datasource:o.source_SID | ||
splex.demo_src |
splex.demo_dest |
target_system@o.target_SID |
where:
datasource:o.source_SID | ||
splex.demo_src |
splex.demo_dest |
target_system@r.database_name |
where:
Perform these steps on the source system. When you activate a configuration, SharePlex is ready to capture transactional changes that are made to the specified source data.
Activate the configuration.
sp_ctrl(source)> activate config sample_config
Note: Configuration names are case-sensitive.
Confirm that the configuration activated successfully. The name sample_config should appear under File Name, and the word Active should appear under State.
sp_ctrl(source)> list config
If your configuration activation fails, isue the view config sample_config command to view the file. Compare it to the template and make sure all of the information you entered is correct. Make certain you specified the correct database identifier. Check your syntax for extra spaces or missing components.
Because the configuration file is not active, you can edit it directly with the following command:
sp_ctrl(source)> edit config sample_config
Save the changes, then re-try the activation.
Note: To change an active configuration, you must copy it to a new file first, and then edit and activate the copy. For more information, see Add or change objects in an active configuration in the SharePlex Installation and Setup Guide.
This section demonstrates the speed and accuracy of SharePlex replication. It can also be used to verify that SharePlex was installed and configured correctly.
This test verifies that replication is working properly.
Perform these steps in the native SQL interface of the database.
On the source, TRUNCATE splex.demo_src to make certain it is empty.
truncate table splex.demo_src;
Insert and commit a record into splex.demo_src:
insert into splex.demo_src values (‘Jim’, ‘123 Main Street’, ‘123-456-7890’);
commit;
Verify that the record exists in splex.demo_dest on the target system:
select * from splex.demo_dest;
The query should show the replicated record, and only that record.
This test verifies that SharePlex replicates large volumes of data quickly and accurately.
Perform these steps in the native SQL interface of the database.
On the source, TRUNCATE splex.demo_src to make certain it is empty.
truncate table splex.demo_src;
Verify that all of the record exist in splex.demo_dest on the target system:
select count (*) from splex.demo_dest;
The count should match the number of records inserted by the Inserts script.
This test shows you how:
On the source, TRUNCATE splex.demo_src to make certain it is empty.
truncate table splex.demo_src;
On the target, shut down SharePlex to simulate that this system is unavailable.
sp_ctrl(source)> shutdown
On the source, issue the following command to show the status of the local SharePlex queues.
sp_ctrl(source)> qstatus
The output should show a backlog of messages.
Notes:
On the target, run sp_ctrl.
On the target, verify that the SharePlex processes started.
sp_ctrl(target)> status
On the target, verify that the records inserted by the script on the source system now exist in the target database.
select count (*) from splex.demo_dest;
The count should match the number of records inserted by the Inserts script.
This test shows how SharePlex recovers after an interruption to data capture.
On the source, TRUNCATE splex.demo_src to make certain it is empty.
truncate table splex.demo_src;
On the source, stop the Capture process.
sp_ctrl(source)> stop capture
On the source, run the Insert script to generate a transaction to splex.demo_src.
On the source, start the Capture process.
sp_ctrl(source)> start capture
On the source, verify that Capture is running and that it processed the data. Look at Capture state and Operations captured.
sp_ctrl(source)> status
On the target, use the native SQL interface to verify that all records inserted by the script on the source now exist in the target database.
select count (*) from splex.demo_dest;
This demonstration shows you how to use the SharePlex compare command to compare the source and target data, and then repair rows that are out of synchronization.
On the source, TRUNCATE splex.demo_src to make certain it is empty.
truncate table splex.demo_src;
On the target, verify that all of the data posted to splex.demo_dest. If the command shows that data is still in the queue, issue the command again.
sp_ctrl(target)>qstatus
On the source, issue the compare command in sp_ctrl.
sp_ctrl (source)>compare splex.demo_src
Note: The command determines the correct target table from the configuration file.
On the source, view the results of the comparison. There should be no rows out of synchronization.
sp_ctrl(source)>compare status
On the target, UPDATE splex.demo_dest to change the values of the NAME column in two or more rows. The UPDATE causes the source and target tables to be out of synchronization.
On the source, issue the compare command again. It should show that the rows you updated in splex.demo_dest are out of synchronization.
sp_ctrl(source)>compare splex.demo_src
On the source, issue the repair command to repair the rows that are out of synchronization.
sp_ctrl(source)> repair splex.demo_src
On the source, verify that the repair was performed.
sp_ctrl(source)>repair status
On the target, you can manually verify that the repair was accurate by using a SELECT statement to view all rows in both tables.
select * from splex.demo_src;
select * from splex.demo_dest;
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. 利用規約 プライバシー Cookie Preference Center