On Windows, the SharePlex groups are created in the Windows User Accounts control panel by the SharePlex installer. To assign users to these groups, use that control panel after you install SharePlex.
Users can verify their authorization levels by issuing the authlevel command in sp_ctrl.
This chapter demonstrates SharePlex replication using the sp_ctrl command-line interface. This demonstration can be run on Unix, Linux, or Windows systems.
Warning! These demonstrations are intended to introduce you to the SharePlex software. All of the demonstration components were created specifically for demonstration purposes, not deployment in a production environment. Do not use these demonstrations as the basis for establishing replication. To properly implement replication in your environment, use the SharePlex Administrator’s Guide.
Tip: The commands used in these demonstrations are described in more detail in the SharePlex Reference Manual.
These demonstrations assume that SharePlex is installed on one source system and one target system.
The tables used in these demonstrations are source table demo_src and target table demo_dest, both of which are installed in the SharePlex schema when SharePlex is first installed. The demo tables are installed empty. In order to insure that each demo is started from a fresh state, please truncate the tables prior to beginning the demonstration.
You will replicate demo_src from a source instance on the source system (described as sysA) to demo table demo_dest in a target instance on another system, the target system (described as sysB).
For this documentation, the owner of the demo tables is assumed to be “splex,” which is the default name for the SharePlex Oracle user. If you assigned SharePlex a different user name, use that one.
You need to know the ORACLE_SID of your source and target instances. On Unix and Linux systems, the SID can be found by viewing the oratab file in the /etc directory (/var/opt/ oracle directory on Solaris platforms). You will see a display similar to this:
In the example, qa12 is the ORACLE_SID.
On Windows systems, the ORACLE_SID is in the Oracle entry in the Windows Registry.
|Column Name||Data Type||Null?|
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
Log onto the system as a SharePlex Administrator (a member of the SharePlex Admin group).
From the bin sub-directory of the SharePlex product directory (the one containing the binaries, represented by the productdir variable in the following syntax), run sp_cop and sp_ctrl.
To start SharePlex on Windows systems
SharePlex gets its replication instructions from “configurations,” which are user-defined specifications that tell SharePlex what to do. For each group of objects that you want to replicate, you create a configuration file. Configurations reside on the source system and define:
To create the demonstration configuration
Create a replication configuration named sample_config by issuing the create config command in sp_ctrl on the source system. This opens the default text editor, which is vi for Unix and Linux systems and WordPad for Windows systems.
Refer to Template 1 below as you construct your configuration.
Template 1: Basic demonstration configuration sample_config
On the first non-commented line of the file, type the following, leaving no space between any of the items.
(Substitute the ORACLE_SID of the source instance for source_SID.) This tells SharePlex where to find the table whose data will be replicated. The o. tells Share- Plex that Oracle data is being replicated.
On the next line, enter the owner name (splex) and table name (demo_src) of the source table, separating the two items with a dot (.) but no spaces. Using the owner’s name with a table name ensures that SharePlex replicates the correct table, since different tables in different schemas in a database could have the same name.
In the second column, enter the owner name (splex) and table name (demo_dest) of the target table, separating the two items with a dot (.) but no spaces.
Type a few spaces or a tab to create a third column. Do not press Enter.
In the third column, type the following items with no space between them. This creates the routing map for your configuration, telling SharePlex where to put the replicated data.
[OPTIONAL] To view the configuration, issue the view config command in sp_ctrl on the source system:
Activate the configuration in sp_ctrl on the source system. Configuration names are case-sensitive.
To confirm that your configuration is active, type the following sp_ctrl command on the source system to display a list of all configurations. The sample_config configuration should appear under “File Name,” and the word “Active” should appear under “State.”
Tip: If your configuration activation fails, use the view config sample_config command in sp_ctrl to view the file. Compare it to Template 1 on page 95 and make sure all of the information you entered is correct. For example, check for extra spaces that are not supposed to be there, or for missing components, such as the o. before the SID. For other configuration troubleshooting tips, refer to Chapter 3 of the SharePlex Reference Manual.
To correct mistakes in the configuration file:
Use the edit config sample_config command in sp_ctrl to correct mistakes in the configuration file before you activate it (or if the activation failed). This command opens the file in the text editor, and you can make the changes by editing the file. Save the changes, and re-try the activation. To change an active configuration, you must copy it to a new file first with the copy config command, and then edit and activate the copy. For more information about the copy config command, see the SharePlex Reference Manual.