Table of Contents Previous Next


5 Single-Master Replication Operation : 5.2 Creating a Publication

Step 1: Start the publication server if it is not already running.
Note: If you are using Oracle publication or subscription databases, and the publication server has not been restarted since copying the Oracle JDBC driver to the lib/jdbc subdirectory of your xDB Replication Server installation, you must restart the publication server.
For Linux only: You can verify the publication server is running by using the systemctl command for CentOS 7 or RHEL 7, and the service command for previous Linux versions.
Similarly, use the stop option to stop the publication server.
For Windows only: Open Control Panel, System and Security, Administrative Tools, and then Services. The publication server runs as a service named Publication Service for xDB Replication Server.
Step 2: Register the publication server. Open the xDB Replication Console from the system’s application menu. For xDB Replication Server installed from an xDB RPM package, the xDB Replication Console is started by invoking the script XDB_HOME/bin/runRepConsole.sh.
repconsole_appmenu
Step 3: Select the top level Replication Servers node. From the File menu, choose Publication Server, and then choose Register Server. Alternatively, click the secondary mouse button on the Replication Servers node and choose Register Publication Server. The Register Publication Server dialog box appears.
Host. Network IP address of the host running the publication server. This is the network IP address used for pub_ipaddr in the pg_hba.conf file in Section 5.1.6.3. (Do not use localhost for this field.)
Port. Port number the publication server is using. This is the port number you specified on the Publication Server Details screen in Step 16 of Section 3.1.
User Name. Admin user name that is used to authenticate your usage of this publication server. This is the user name you specified on the xDB Admin User Details screen in Step 15 of Section 3.1.
Password. Password of the admin user given in the User Name field.
Save login information. Check this box if you do not want to re-register the publication server each time you open the xDB Replication Console. See Section 4.2 for additional information on the advantages and disadvantages of saving server login information.
Note: The user name and password combination you enter is authenticated against the admin user name and password in the xDB Replication Configuration file residing on the host with the IP address you enter in the Host field.
Step 1: Make sure the database server in which the publication database resides is running and accepting client connections.
Step 2: Select the SMR type node under the Publication Server node. From the Publication menu, choose Publication Database, and then choose Add Database. Alternatively, click the secondary mouse button on the SMR type node and choose Add Database. The Publication Service – Add Database dialog box appears.
Step 3: Fill in the following fields:
Database Type. Select Oracle, SQL Server, PostgreSQL, or Postgres Plus Advanced Server for the type of publication database. For an Advanced Server Oracle compatible installation, select the Postgres Plus Advanced Server option. For PostgreSQL or an Advanced Server PostgreSQL compatible installation, select the PostgreSQL option.
Host. IP address of the host on which the publication database server is running.
Port. Port on which the publication database server is listening for connections.
User. The publication database user name created in Step 1 of Section 5.1.4.
Password. Password of the database user.
Service ID (For Oracle). Enter the Oracle System Identifier (SID) of the Oracle instance running the publication database if the SID radio button is selected. Enter the net service name of a connect descriptor as defined in the TNSNAMES.ORA file if the Service Name radio button is selected.
Database (For Postgres or SQL Server). Enter the Postgres or SQL Server database name.
URL Options (For SSL connectivity). Enter the URL options to establish SSL connectivity to the publication database. See Section 7.10 for information on using SSL connections.
Changeset Logging (For Postgres). Select Table Triggers to use the trigger-based method of synchronization replication. Select WAL Stream to use the log-based method of synchronization replication. See Section 2.2.9 for information on the trigger-based method. See Section 2.2.10 for information on the log-based method.
Note: If the controller database is an Oracle or a SQL Server publication database, then a second Oracle or SQL Server publication database cannot be added to create a second single-master replication system. In order for xDB Replication Server to run more than one single-master replication systems consisting of Oracle or SQL Server publication databases, a Postgres publication database must be designated as the controller database. See Section 2.3.1.12 for information on the controller database.
Step 4: Click the Test button. If Test Result: Success appears, click the OK button, then click the Save button.
For Oracle only: Multiple Oracle databases can be added as publication databases by completing the Add Database dialog box for each database. It is also permissible to add the same Oracle database as two or more distinct publication database definitions if you use different publication database user names for each publication database definition.
For Postgres or SQL Server: Multiple Postgres or SQL Server databases can be added as publication databases by completing the Add Database dialog box for each database. However, unlike Oracle, a given Postgres or SQL Server database can only be added once as a publication database definition.
Step 1: Select the Publication Database node. From the Publication menu, choose Create Publication. Alternatively, click the secondary mouse button on the Publication Database node and choose Create Publication. The Create Publication dialog box appears.
Step 2: Fill in the following fields under the Create Publication tab:
Publication Name. Enter a name that is unique amongst all publications.
Snapshot-only replication. Check the box if replication is to be done by snapshot only. Tables included in a snapshot-only publication do not require a primary key. Tables included in publications on which synchronization replication is to be used must have primary keys.
Publish. Check the boxes next to the tables that are to be included in the publication. If the Snapshot-Only Replication box is checked, then views appear in the Publish list as well. Alternatively or in addition, click the Use Wildcard Selection button to use wildcard pattern matching for selecting publication tables.
Select All. Check this box if you want to include all tables and views in the Available Tables list in the publication.
Use Wildcard Selection. Click this button to use the wildcard selector to choose tables for the publication. See Section 7.1 for information on the wildcard selector.
Step 3 (Optional): Table filters consist of a set of filter rules that control the selection criteria for rows replicated to the subscription tables during a snapshot or a synchronization replication.
Note: See Section 2.2.11.3 for table setup requirements for a log-based replication system as well as general restrictions on the use of table filters.
A filter rule consists of a filter name and a SQL WHERE clause (omitting the WHERE keyword) called the filter clause, which you specify for a table or view that defines the selection criteria for rows that are to be included during a replication.
In the following example a filter rule is defined on the DEPT table so only rows where the deptno column contains 10, 20, or 30 are included in replications. All other rows are excluded from replication.
The following shows a rule added to the EMP table by choosing EDB.EMP from the Table/View drop-down list and then entering the selection criteria for only rows with deptno containing 10 in the Filter dialog box.
Repeating this process, additional filter rules can be added for the EMP table. The following shows the complete set of available filter rules defined for the DEPT and EMP tables.
Step 4: Click the Create button. If Publication Created Successfully appears, click the OK button, otherwise investigate the error and make the necessary corrections.
The tables named according to the convention RRST_schema_table from the SELECT statement on user_tables are found only for synchronization publications. In this example, these tables are RRST_EDB_DEPT and RRST_EDB_EMP.
The triggers named according to the convention RRPD_schema_table, RRPI_schema_table, and RRPU_schema_table from the SELECT statement on user_triggers are found only for synchronization publications. In this example, these triggers are RRPU_EDB_DEPT, RRPI_EDB_DEPT, RRPD_EDB_DEPT, RRPI_EDB_EMP, RRPU_EDB_EMP, and RRPD_EDB_EMP.
Note: The RREP_SYNCID_ARRAY collection type is found only in an Oracle publication database.
Most of the control schema objects are created in schemas _edb_replicator_pub, _edb_replicator_sub, and _edb_scheduler. Additional control schema objects are created in the schema you chose in Step 5 of Section 5.1.4.2. The following examples assume the schema of your choosing is pubuser. The publication tables are dept and emp located in the edb schema.
Finally, some jobs are created in the msdb database after the subscription is created as shown by the following:
The control schema objects are created in three schemas named _edb_replicator_pub, _edb_replicator_sub, and _edb_scheduler.
The control schema objects contained in _edb_replicator_pub are shown by the following:
The control schema objects contained in _edb_replicator_sub are shown by the following:
The control schema objects contained in _edb_scheduler are shown by the following:
These triggers are used to support synchronization replication of the TRUNCATE command when the log-based method is used.

5 Single-Master Replication Operation : 5.2 Creating a Publication

Table of Contents Previous Next