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, ojdbc14.jar, 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 following command:
If the publication server is running and you wish to restart it, run script /etc/init.d/edb-xdbpubserver with the restart option.
Run the script as the operating system user that you chose during installation in the Publication/Subscription Service Account screen in Step 18 of Section 3.1. (For an xDB Replication Server installation done at the time of Advanced Server installation, use operating system user enterprisedb for Oracle compatible configuration mode and use postgres for PostgreSQL compatible configuration mode.)
If the publication server is not running, run the edb-xdbpubserver script with the start option as shown by the following:
For Windows only: Open Control Panel, Administrative Tools, and then Services. The publication server runs as a service named Publication Service.
services_pub
Step 2: Register the publication server. Open the xDB Replication Console from the system’s application menu.
repconsole_appmenu
repconsole_1
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.5.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. Database superuser name that the publication server uses to connect to the xDB Control database. This is the user name you specified on the Postgres Installation Details screen in Step 15 of Section 3.1.
Password. Password of the database superuser 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 user name and password in the xDB Replication Configuration file residing on the host with the IP address you enter in the Host field.
pubserver_dialog_box
pubserver_reptree
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.3.
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.8 for information on using SSL connections.
pubserver_add_database_dialog_box_ssl
Step 4: Click the Test button. If Test Result: Success appears, click the OK button, then click the Save button.
pubserver_add_database_test_ssl
pubserver_database_reptree
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.
Select All. Check this box if you want to include all tables and views in the Available Tables list in the publication.
pubserver_create_pub_dialog_box
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.
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.
pubserver_create_pub_filter_1
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.
pubserver_create_pub_filter_2
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.
pubserver_create_pub_filter_3
Step 4: Click the Create button. If Publication Created Successfully appears, click the OK button, otherwise investigate the error and make the necessary corrections.
pubserver_create_pub_filter_4
pubserver_pub_reptree
A schema named _edb_replicator_pub is created in the xDB Control database with metadata database objects that are used to manage the publication.
For Oracle only: The metadata database objects are created in the publication database user’s schema as shown in the following output:
Note: The RREP_SYNCID_ARRAY collection type is found only in an Oracle publication database.
For SQL Server only: Most of the metadata database objects are created in the schema you chose in Step 5 of Section 5.1.3.2 as shown by the following:
Finally, some jobs are created in the msdb database as shown by the following:
For Postgres only: The metadata database objects are created in the schema _edb_replicator_pub as shown in the following:

5 Single-Master Replication Operation : 5.2 Creating a Publication

Table of Contents Previous Next