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;
This demonstration shows you how to use named post queues to process different tables through different, parallel Post processes to improve performance.
NOTE: The demonstration objects are assumed to be in the schema named splex.
If you ran previous demonstrations, do the following:
On the source and target, run sp_ctrl and issue the following command to shut down sp_cop.
sp_ctrl(source)shutdown
sp_ctrl(target)shutdown
On the source, TRUNCATE the splex.demo_src. SharePlex replicates the TRUNCATE to the target.
truncate table splex.demo_src;
Perform these steps on the source system. The demonstration objects are assumed to be in the schema named splex.
You will configure the following:
Run sp_ctrl.
Issue the following command to create a configuration file named postq_config in the default text editor.
sp_ctrl(source)>create config postq_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 postq_config
datasource:o.source_SID | ||
splex.demo_src |
splex.demo_dest |
target_system:q1@o.target_SID |
splex.demo_dest |
splex.demo_src |
target_system:q2@o.target_SID |
where:
datasource:o.source_SID | ||
splex.demo_src |
splex.demo_dest |
target_system:q1@r.database_name |
splex.demo_dest |
splex.demo_src |
target_system:q2@r.database_name |
where:
Important! Make certain you created the scripts described in Prework for the demonstrations.
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 postq_config
Note: Configuration names are case-sensitive.
Confirm that the configuration activated successfully. The name postq_config should appear under File Name, and the word Active should appear under State.
sp_ctrl(source)>list config
On the source, run the following scripts to insert data into the two local demonstration tables (in this demonstration, the demo_dest table is used as a source):
On the target, issue the show post command with the detail option. This command shows statistics about the number of messages processed and the queues that were used.
sp_ctrl(target)> show post detail
In the output, the Queue field shows the name of each post queue, in this case q1 and q2, and the Operations Posted field shows the number of operations that were posted. Each queue should show 500 operations posted.
Prework for the demonstrations
Configure, activate, and verify replication
Demonstration of horizontally partitioned replication
Demonstration of vertically partitioned replication
Demonstration of transformation
This chapter demonstrates selected features of SharePlex. These exercises can be run on Unix and Linux and Windows systems to demonstrate:
Perform these tasks before you start the demonstrations.
On the source, verify that the SP_OCT_REPLICATE_DDL parameter is set to the default of 3. This parameter controls basic DDL replication, including the TRUNCATE command.
sp_ctrl(source)>list param modified capture
The SP_OCT_REPLICATE_DDL parameter should not be listed in the output. If it is, issue the following command:
sp_ctrl(source)>reset param SP_OCT_REPLICATE_DDL
The p2p.sql and od.sql scripts install the demonstration objects that you will use during these demonstrations. These scripts are stored in the util sub-directory of the SharePlex product directory.
To run the scripts
The scripts prompt for the following items:
od_employee | ||
---|---|---|
Name ---------------------------- |
Null? --------------- |
Type ------------- |
EMP_NO | NOT NULL | NUMBER |
EMP_FIRST_NAME | VARCHAR2 | |
EMP_LAST_NAME | VARCHAR2 | |
EMP_DOB | DATE | |
EMP_DEPT_NO | NUMBER | |
EMP_TIMESTAMP | DATE |
od_timesheet | ||
---|---|---|
Name ---------------------------- |
Null? --------------- |
Type ------------- |
TS_EMP_NO | NUMBER | |
TS_IN_TIME | DATE | |
TS_OUT_TIME | DATE | |
TS_MOD_TIME | DATE |
od_department | ||
---|---|---|
Name --------------------------- |
Null? --------------- |
Type ------------- |
DEPT_NO | NOT NULL | NUMBER |
DEPT_NAME | VARCHAR2 | |
DEPT_CODE | VARCHAR2 |
od_salary | ||
---|---|---|
Name --------------------------- |
Null? --------------- |
Type ------------- |
SALE_EMP_NO | NUMBER | |
SAL_VALUE | NUMBER | |
SAL_CHANGED | DATE |
od_sales_emp_data | ||
---|---|---|
Name ------------------------------ |
Null? --------------- |
Type ------------- |
EMP_NO_KEY | NOT NULL | NUMBER |
EMPLOYEE_NAME | VARCHAR2 (70) | |
SALARY | NUMBER | |
DEPARTMENT | VARCHAR2 (50) |
oxc_table | ||
---|---|---|
Name ----------------------------- |
Null? -------------- |
Type ------------- |
EXC_NO | NOT NULL | NUMBER |
EXC_TYPE | VARCHAR2 (6) | |
EXC_TARGET_TABLE | VARCHAR2 (66) | |
EXC_FIXED | VARCHAR2 (3) | |
EXC_INFO | VARCHAR2 (500) | |
EXC_TIMESTAMP | DATE |
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center