12 Setting Up Replication

Oracle Clinical supports establishing a study—that is, designing and defining it—in one location, and then copying the study design and definition to other locations.

Each recipient, or sharing location, can conduct the study on its own set of patients. Data collected in sharing locations can be copied back to the location where the study originated, that is, the study-owning location. From there, data can be copied to any other location that has a copy of the study definition.

In this way, each location that participates in a study views an up-to-date set of collected data. Each location can modify only the data collected at its sites; all other data for this study is read-only. This process of distributing a read-only copy of study designs, definitions, and data to other locations in the environment is called replication.

This section includes:

Note:

This section discusses the tasks required for a system administrator to prepare Oracle Clinical databases for replication. It does not describe the procedures for actually performing those replications. For those instructions, see Chapter 13, "Using Replication."

12.1 Replication Concepts

The process of distributing a read-only copy of a study design, definition, and data to other locations in the environment is called replication.

This section describes the following replication concepts:

12.1.1 Locations in a Distributed Study Environment Installation

Replication occurs among multiple database instances. Each database instance in your distributed installation must use the same release of Oracle Clinical.

Each included database instance is referred to as a location. The locations in an installation share Oracle Clinical data or dictionaries with other databases via Oracle Clinical replication capabilities. A location can refer to a separate database on the same computer or to a database in a different physical location.

This set of locations, which shares the same Global Library and can replicate study designs, definitions, and data, is referred to as an installation.

Within a distributed Oracle Clinical installation, you must identify the following locations:

The following sections describe the role of each location.

12.1.1.1 Global Library-Owning Location

The Global Library-owning location, which is also referred to as the global management location, owns and manages all the objects that compose data collection definitions for clinical studies.

These objects include:

  • Global Library: questions, question groups, DVGs, standard affiliations, question categories, Global Library procedures, Global Library DCMs, and Global Library DCIs

  • Codelists: installation reference codelists

  • Global Lab: lab units and related information, lab panels, and textbook ranges

All other locations that are part of the distributed environment get read-only copies of information by replication. Keeping those copies up to date as things change in the Global Library-owning location requires planned follow-up replications.

12.1.1.2 Study-Owning Location

The study-owning location is the Oracle Clinical location where a particular study is designed and defined. Each study has only one owner. Different locations can be the study-owning locations for different studies.

The study-owning location:

  • Creates and modifies the study design and definition.

  • Controls the assignments of all patient positions to study-sharing locations.

  • Provides a central repository of all collected study data.

    This repository includes data the study-owning location creates and data replicated from other study locations. Once data is centralized at the study-owning location, the data can then replicated to sharing locations.

If the study-owning location is not the Global Library-owning location, then the study-owning location must replicate the Global Library before beginning study definition. While creating and refining the study definition, the study-owning location can then perform Global Library replication at regular intervals to keep the Global Library up to date.

12.1.1.3 Lab-Owning Location

A lab-owning location maintains information about the attributes and ranges of its lab. Each lab has only one owner. Lab names must be globally unique across the installation. Any location that uses lab data from a lab it does not own must first replicate the lab information from the lab-owning location.

12.1.2 What Can You Replicate?

You can replicate the following Oracle Clinical objects:

  • Global Library

  • Study design

  • Study definition

  • Data

  • Global Lab information

  • Local labs and ranges

  • Study randomization

12.1.3 What Methods of Replication Does Oracle Clinical Support?

Oracle Clinical supports the following methods of replication:

  • Standard replication

  • Disconnected replication

  • Symmetric replication

In your distributed study environment, you can use one method or a combination of methods to replicate data across all the locations in your installation.

12.1.3.1 Standard Replication

Standard replication is a retrieving operation, that is, the location that requires the information must request it from the source location. In addition, standard replication uses a network connection to copy information from one location to another location.

12.1.3.2 Disconnected Replication

Disconnected replication supports bi-directional replication between locations without relying on a network connection. Instead, disconnected replication creates an export file that contains the data from the source location to be transferred to the target location. You choose how to transport the export file to the target location. For example, you can choose disk media, tape media, E-mail, or local area network (LAN). The target location then imports (or loads) the data from the export file.

12.1.3.3 Symmetric Replication

Symmetric replication copies only the supporting study design information and replication happens automatically. You do not need to select any menu option.

12.1.3.4 Comparison of Standard and Disconnected Replication

The final result of a standard replication is indistinguishable from a disconnected replication. The following table lists the key differences between the standard replication process and the disconnected replication process.

Table 12-1 Comparison of Standard versus Disconnected Replication

Standard Replication Disconnected Replication

Requires a network connections to transfer information between locations.

Copies information between locations via file transfer. A network connection is not required.

The location requesting the data accesses the source database and copies the data.

The owner of the data is not aware that the data is being copied.

The source location extracts the data to an export file and determines when to transfer the file to target locations.

The owner of the data is actively involved in the process.

The study is marked as replicated only after the first replication successfully occurs.

The study is marked as replicated after the extract and export phase at the source location is complete, but before the import and load phase starts at the target locations.

Therefore, existing restrictions about what can be done to a study once it has been replicated are imposed after the extract and export phase.

Supports full and incremental replication.

Supports full replication only.


12.2 Prerequisites to Setting Up Replication

Each database instance in your distributed installation must use the same release of Oracle Clinical.

In addition, the following replication-specific objects must be in place before you can set up and use replication in your Oracle Clinical installation:

  • The Oracle accounts required to set up and perform replication.

  • The tables that record each type of replication. The replication types are Global Library, study design, study definition, data, Global Labs, and local labs and ranges.

  • The seed number (unique sequence generators).

You already set up these items as part of creating the database.

This section reviews the prerequisites so you can check that your system meets the requirements before you begin the actual replication setup activities.

12.2.1 Oracle Accounts for Replication

When you install Oracle Clinical, the system creates the following accounts for managing and conducting studies in a distributed environment:

See "Changing the Password for a Schema or Role Using the SET_PWD Utility."

12.2.1.1 RXA_READ Account

Oracle Clinical uses the RXA_READ account for various read-only operations for standard replication. As part of the setup for standard replication, you create a public database link that connects to each of the other database locations as the RXA_READ account.

The RXA_READ account has SELECT privilege on the study design tables and UPDATE privilege on the CLINICAL_STUDY_STATES table.

12.2.1.2 RXC_REP Account

You use the RXC_REP account to replicate the Global Library, study definitions, study design, data, and labs (Global lab, local labs, and ranges). The RXC_REP account has the following privileges:

  • SELECT on all the journal tables; INSERT, UPDATE, and DELETE on some journal tables

  • SELECT, INSERT, UPDATE, and DELETE on all replicated tables

  • SELECT, INSERT, UPDATE, and DELETE on the following tables:

    • STUDY_REPLICATION_JOBS

    • LAB_REPLICATION_JOBS

  • SELECT, INSERT, and UPDATE on the following tables:

    • CLINICAL_STUDY_STATES

    • REPLICATION_TAB

Note:

The password of the RXC_REP account is used when creating database links at other locations. If it is modified, you must recreate the database links at those remote sites.

12.2.1.3 RXC_DISC_REP Account

Only disconnected replication uses the RXC_DISC_REP account. The RXC_DISC_REP account has the following privileges:

  • SELECT on all the journal tables; INSERT, UPDATE, and DELETE on some journal tables

  • SELECT, INSERT, and DELETE on all replicated tables

  • SELECT, INSERT, UPDATE, and DELETE on the STUDY_REPLICATION_JOBS table

  • SELECT, INSERT, and UPDATE on the following tables:

    • DESIGN_REPLICATION_JOBS

    • LAB_REPLICATION_JOBS

    • CLINICAL_STUDY_STATES

  • SELECT and INSERT on the REPLICATION_TAB table

12.2.2 Tables that Store Replication Information

The following table lists the tables that Oracle Clinical uses to record information about the execution of each type of replication. The information recorded, which varies from table to table, may include the date and time the replication started, the current status of the replication, and the date and time the replication completed.

Table 12-2 Oracle Clinical Tables that Store Information about Replication

Owner This Table… Stores Replication Information About…

RXC

REPLICATION_TAB

Global Library and study definition

RXC

STUDY_REPLICATION_JOBS

Data

RXA_DES

DESIGN_REPLICATION_JOBS

Study design

RXA_LR

LAB_REPLICATION_JOBS

Global labs, labs, and ranges

RXC_DISC_REP

DISCONNECTED_REPL_JOBS

Extracts and loads of the disconnected replication process


12.2.3 Seed Numbers for Databases Involved in Replication

Each database within an installation requires a unique start with value that seeds the internal numbers assigned to generated study objects (DCMs, Validation Procedures, and so on) so they are uniquely identified across all locations.

When you install Oracle Clinical, the Oracle Universal Installer prompts you for a unique starting number (from 1 to 99) for each database to be involved in replication. For information on the installation process, see the Oracle Clinical Installation Guide.

12.3 Setting Up Replication-Related Reference Codelist Values

The following table lists the reference codelists that Oracle Clinical uses to manage each method of replication. For more information, see Chapter 7, "Reference Codelists."

Table 12-3 Reference Codelists that Manage Replication

Codelist Name Standard Replication Symmetric Replication Disconnected Replication

SOURCE LOCATION CODE Installation Codelist

YES

YES

OCL_INSTALLATION Installation Codelist

YES

YES

OCL_STATE Local Codelist

YES

YES

DB_LINKS Local Codelist

YES

PUBLIC_DB_LINKS Local Codelist

YES

OCL_OPTIONS_TYPE_CODE Installation Codelist

YES


12.4 Setting Up the Database Links for Standard Replication

Standard replication is a retrieving operation; that is, the database location requesting the data must initiate the action. In addition, standard replication uses a network connection to copy information from one location to another location. As a result, you need to create links between the locations in your installation. (Note that disconnected replication is done by export and load, and does not rely on database links or a network connection.)

12.4.1 Configuring the DB_LINKS Codelist for Standard Replication

Each database location in the installation maintains the DB_LINKS local reference codelist, which has an entry in the Short Value field for each of the other database locations in the installation. The Long Value contains the name of the private database link to that database, owned by the RXC_REP or RXA_DES user.

To configure the DB_LINKS codelist for standard replication:

  1. Navigate to Admin, Reference Codelists, and then select Local Codelists.

  2. Query for the DB_LINKS local codelist.

    1. In the Short Value field, enter a name for each of the other locations (instances) in the installation. This name should be descriptive, such as "CRO-LONDON" or "HEADQUARTERS" or "PHILA-SITE."

    2. In the Long Value field, enter the database link name of the private link to that database.

Note the name of the private link you specify in the DB_LINKS codelist. You will need this information when you create the private database links for the RXC_REP and RXA_DES accounts later in this section.

12.4.2 Configuring the PUBLIC_DB_LINKS Codelist for Standard Replication

Each database in the installation also maintains the PUBLIC_DB_LINKS local reference codelist, which also has an entry in the Short Value field for each of the other database locations in the installation. The Long Value contains the name of the public database link to that database.

To configure the PUBLIC_DB_LINKS codelist for standard replication:

  1. Navigate to Admin, Reference Codelists, and then select Local Codelists.

  2. Query for the PUBLIC_DB_LINKS local reference codelist:

    1. In the Short Value field, enter the name for each of the other locations in the installation.

    2. In the Long Value field, enter the database link name of the public link to that database.

Note the name of the public link you specify in the PUBLIC_DB_LINKS codelist. You will need this information when you create the public database link for the RXA_READ account later in this section.

12.4.3 Creating the Private Database Links for the RXC_REP and RXA_DES Accounts

After you set up the DB_LINKS and the PUBLIC_DB_LINKS local reference codelists, you need to create the database links to the other locations in your installation

Note:

You use the password for the RXC_REP and RXA_DES accounts when creating database links at other locations. If you modify the password, you must recreate the database links at those other locations.

To create the private database links required for standard replication:

  1. Set environment variables for the database name and code environment; see "Setting Environment Variables on the Command Line."

  2. Create the private database link for the RXC_REP account:

    1. Connect to SQL*Plus as RXC_REP.

    2. Create a private database link to each of the other database locations:

      create database link linkname connect to rxc_rep identified by password using 'connectstring' ;

      where:

      • linkname is the name specified for your private database link in the DB_LINKS reference codelist.

      • password is the password of the RXC_REP account.

      • connectstring is the appropriate SQL*Net connect string.

        Make sure the connectstring has single quotes around it. Oracle recommends that the connectstring be the same as the linkname although it is possible for them to be different.

    3. Verify that you created the link correctly. The following command should return RXC_REP as the user:

      SELECT username FROM user_users@linkname ;

  3. Create the private database link for the RXA_DES account:

    1. Connect to SQL*Plus as RXA_DES.

    2. Create a private database link between the RXA_DES accounts in each instance:

      create database link linkname connect to rxa_des identified by password using 'connectstring' ;

      where:

      • linkname is the name specified for your private database link in the DB_LINKS reference codelist (and also matches the linkname value used for the same database in the previous step).

      • password is the password of the RXA_DES account.

      • connectstring is the SQL*Net alias of the database to which the link connects.

        Make sure the connectstring has single quotes around it.

    3. Verify that you created the link correctly. The following command should return RXA_DES as the user:

      SELECT username FROM user_users@linkname ;

  4. Exit from SQL*Plus.

12.4.4 Creating the Public Database Link for RXA_READ

To set up the public database link for standard replication:

  1. Connect to SQL*Plus as SYS.

  2. Create a public database link to each of the other database locations for the RXA_READ account:

    create public database link linkname connect to rxa_read identified by password using 'connectstring' ;

    where:

    • linkname is the name specified for your database link in the PUBLIC_DB_LINKS reference codelist.

    • password is the password of the RXA_READ account.

    • connectstring is the SQL*Net alias of the database to which the link connects.

      Make sure the connectstring has single quotes around it. Oracle recommends that the connectstring be the same as the linkname, although it is possible for them to be different, if Global Naming is not enabled for the database.

  3. Verify that you created the link correctly. The following command should return RXA_READ as the user:

    SELECT username FROM user_users@linkname ;

  4. Exit from SQL*Plus.

12.5 Creating the Study Design Replication Packages

The following table lists the scripts that you must run if you are using:

  • Standard replication to replicate study-specific designs

  • Symmetric replication to replicate data related to study design, but not specific to a study

These scripts, which are located in the RXC_INSTALL directory, create the study design replication packages required by standard and symmetric replication.

Table 12-4 Scripts Required to Use Standard Replication for Replicating Study Design

Script Name You Run this Script …

RXASRALL.SQL

At every location/for every location.

The RXASRALL.SQL script automatically calls the following scripts:

  • RXAOCLRP.SQL

  • RXARELRP.SQL

  • RXASTMRP.SQL

RXASRAVW_CUSTOM.SQL

At every location/for every location;
rename to RXASRAVW.SQL.

RXASVSRA.SQL

At each location.

DYNA_RXAPKIRP.SQL

At each location, for each remote location from which data will be retrieved.


12.5.1 Using the rxasrall.sql Script

The rxasrall.sql script is the driver script that automatically calls the following three scripts to create the study design replication packages:

  • rxaoclrp.sql

  • rxarelrp.sql

  • rxastmrp.sql

The rxasrall.sql script accepts the name of the remote (that is, shared) database and the name of the database link to that database, and then passes the information to the other three scripts. The study design replication packages replicate all the study-specific design details for the selected study as well as study design supporting information.

12.5.1.1 About Running the rxasrall.sql Script for Each Location

You run the rxasrall.sql script in each location, once for each of the remote (shared) locations in the installation. For example, if you have databases A, B, and C, you need to run the rxasrall.sql script six times:

  • First, you run the script on database A passing in the database name and database link for database B, and then you run the script again on database A passing in the database name and database link for database C.

  • Next, you run the script on database B passing in the database name and database link for database A, and then you run the script again on database B passing in the database name and database link for database C.

  • Finally, you run the script on database C passing in the database name and database link for database A, and then you run the script again on database C passing in the database name and database link for database B.

12.5.1.2 Running the rxasrall.sql Script

To run the rxasrall.sql script:

  1. Change to the RXC_INSTALL directory.

  2. Connect to SQL*Plus as RXA_DES.

  3. Run the rxasrall.sql script in each location, once for each of the shared locations in the installation:

    start rxasrall
    Name of the Remote Oracle Clinical Database: location_code
    Name of db Link to Remote Oracle Clinical Database Name: db_link
    

    where:

    • location_code is the identifying code stored for this database in the SOURCE LOCATION CODE reference codelist. If the location_code has spaces, replace them with underscores.

    • db_link is the database link stored for this database in the PUBLIC_DB_LINKS codelist.

  4. Exit from SQL*Plus.

12.5.2 Creating the Views and Synonyms Required to Replicate Study Design

The rxasravw_custom.sql script creates the ALL_name views on the design tables, and the AVAILABLE_CLINICAL_STUDIES view. The rxasvsra.sql script creates synonyms to all the views.

You need to run these scripts if you are using:

  • Standard replication to replicate study-specific designs

  • Symmetric replication to replicate data related to study design, but not specific to a study

To create the views and synonyms required for study design replication:

  1. Copy the rxasravw_custom.sql script to the rxasravw.sql script, overwriting the default version. (The default version is for non-replicated installations only.) The custom version creates the views required for design replication.

    The rxasravw.sql script assumes there are two locations remote from any given installation (total of three locations in your replication installation).

    • If you have three or fewer locations, you can use the script as is. Copy it to each of the other one or two locations and proceed to Step 2.

    • If you have more than three locations edit rxasravw.sql, adding a clause for each remote location. If your installation has n locations, your script should contain n-1 clauses. Copy your edited script to each location.

    Tip:

    If you have more than one environment in the same code area, save more than one copy of rxasravw.sql with a name that indicates the environment to which it applies. For example, rxasravw_prod for your production database.
  2. Connect to SQL*Plus as RXA_DES.

  3. Run the rxasravw.sql script at each location. For example:

    Name of the Current Oracle Clinical Database: example_mexico
    Name of Remote Oracle Clinical Database 1: example1_jersey
    Name of db Link to Remote Oracle Clinical Database 1: to_example1
    Name of Remote Oracle Clinical Database 2: example2_york
    Name of db Link to Remote Oracle Clinical Database 2: to_example2
    

    You do not need to replace spaces in the location codes with underscores.

  4. Run the rxasvsra.sql script at each location. This script creates synonyms to all the views created by the rxasravw.sql script.

12.5.3 Creating the Package for Replicating Investigators and Sites

The dyna_rxapkirp.sql script creates the REPLINVSITE_remote_location package, which replicates the investigators and sites used in a study from the specified source location.

Only standard replication uses the REPLINVSITE_remote_location package. Therefore, you run the dyna_rxapkirp.sql script only if you are using standard replication.

As RXC_REP, you need to run the dyna_rxapkirp.sql script at each location, for each remote location from which data will be retrieved.

To run the dyna_rxapkirp.sql script:

  1. Change to the RXC_INSTALL directory.

  2. Connect to SQL*Plus as RXC_REP.

  3. Run the dyna_rxapkirp.sql script at each location, once for each of the source locations in the installation:

    start dyna_rxapkirp.sql

    The script prompts for the following information:

    Enter value for source_location: location_code
    Enter value for link: database_link

    where:

    • location_code is the code for the remote location from which data will be retrieved to the current database. The value you specify should match the identifying code stored for this database in the SOURCE LOCATION CODE reference codelist. Be sure to replace any spaces in the location_code with underscores.

    • database_link is the name of the database link to the source database. The value you specify should match a record in the DB_LINKS reference codelist.

  4. Exit from SQL*Plus.

12.6 Setting Up Symmetric Replication

With standard replication, study design replication copies the supporting design information (not study-specific information) as well as the study-specific design details. You must select a menu option to replicate data for a specific study. Only the data related to that study is replicated.

Symmetric replication copies only the supporting study design information (not study-specific information). In other words, symmetric replication replicates data related to study design, but not data specific to a study. However, with symmetric replication, all data potentially or actually related to study design is replicated automatically. You do not need to select any menu option.

Symmetric replication offers the following advantages:

  • Design elements are defined in one location then automatically replicated to other database locations, reducing input time and risk of error.

  • After initial replication, changes to design elements are automatically replicated to the other locations.

  • The database system checks for changes at regularly scheduled intervals of your choosing.

  • Self-referencing information is replicated: information about regions within regions, what strata are part of what combined strata, and what single treatment regimens are part of what combined treatment regimen.

To replicate study design elements between databases, Oracle Clinical requires that the databases share the same Global Library. That is, you must perform a full Global Library replication before you perform the first design replication at a sharing location.

12.6.1 Setting Up Symmetric Replication

To successfully complete symmetric replication, you should have a firm understanding of managing multi-master replicated databases. A complete description of this topic is beyond the scope of this documentation. If you choose to perform symmetric replication, see the following Oracle database manual for details about advanced replication and for references to related documentation:

Oracle Database Advanced Replication 11g Release 2 (11.2)
Part Number: E10706-05

Note:

If you are using the Oracle Thesaurus Management System (TMS) with Oracle Clinical in a distributed environment, you must set up Oracle Clinical to run symmetric replication. Oracle Clinical handles symmetric replication for both itself and TMS.

12.6.1.1 Installing Symmetric Replication

This section describes the tasks that you must complete before you perform the Oracle Clinical-specific tasks described in the following sections. For detailed information about symmetric replication, see your Oracle documentation.

  1. Install the database image with symmetric replication.

  2. Check that the initdbname.ora file contains the following specifications:

    • JOB_QUEUE_PROCESSES — At least 10.

    • SHARED_POOL_SIZE — See Oracle Database Reference 11g Release 2 (11.2) for details on setting this parameter.

    • GLOBAL_NAMES — TRUE.

    • DISTRIBUTED_LOCK_TIMEOUT — At least 30.

    • OPEN_LINKS — Number of symmetrically replicated sites.

    See Oracle Database Reference 11g Release 2 (11.2), Part Number E17110-05, for more information about these parameters.

12.6.1.2 Running the Symmetric Replication Scripts Required for Oracle Clinical

The following table lists the scripts that you run to set up Oracle Clinical to use symmetric replication. These scripts complete the appropriate setup activities for each of the locations.

Before you run these scripts, you must have installed symmetric replication. For details, see "Installing Symmetric Replication".

Execute the following prepared scripts in the order listed after you have performed the general tasks described in the previous section.

Table 12-5 Scripts to Run to Set Up Symmetric Replication

Script Order Run from Account Script Name Locations to Run Script Purpose, Parameters, and Notes

1

SYSTEM

CATREP.SQL

Run at each location.

NOTE: This script is automatically executed when the Oracle database is created or upgraded. If it was run previously, you do not need to run the script again.

2

SYSTEM

OPASRC01.SQL

Run at each location.

The OPASRC01.SQL script:

  • Creates REPSYS accounts and grants privileges required for replication.

  • Registers REPSYS as the replication propagator and receiver.

  • Schedules a job to purge pushed trans­actions from the deferred transaction queue.

This script prompts you to enter the:

  • Name of the local database (that is, the current location).

  • Name of the remote database. You can press Enter for this prompt. The OPASRC01.SQL script does not require the name of the remote database instance.

  • Password for local SYSTEM account.

  • Password for local REPSYS account.

Verify your progress at this point by entering the following SQL command:

SELECT * FROM user_users@dbname
.domain

The REPSYS account should be open.

3

SYSTEM

OPASRC02.SQL

Run at each location, for each remote location.

The OPASRC02.SQL script:

  • Creates public and private database links to the remote location.

  • Connects to remote location and schedules a job to push the deferred transaction queue to the master location.

This script prompts you to enter the:

  • Name of the local database (that is, the current location).

  • Name of the remote database (that is, the complete connect string for the remote database).

  • Password for local SYSTEM account.

  • Password for local REPSYS account.

  • Password for REPSYS account at remote location.

NOTE: When the script finishes processing, you will receive the error message:

ERROR at line 1: ORA-02011: duplicate database link name

Ignore this message. The public database link was already created when you set up standard replication.

4

RXA_DES

RXASRCPK.SQL

Run at each location.

Creates primary keys in each table.

CAUTION: If you have existing data, you must reconcile data in all tables symmetrically replicated at all locations before you go any farther. See "Reconciling Data" for details.

5

SYSTEM

COMPILE_ALL_INVALID.SQL

Run at each location.

Compiles objects rendered invalid by the RXASRCPK.SQL script.

6

REPSYS

RXASRC03.SQL

Run at the master definition location.

Creates empty, quiesced master replication group RXA_DES.

7

REPSYS

RXASRC03A.SQL

Run at the master definition location.

Indicates that each object in the Design sub­system is a replicated object in the RXA_DES schema.

Makes column groups for conflict resolution.

8

REPSYS

RXASRC04.SQL

Run at the master definition location.

Sets update resolution to latest time-stamp method.

9

REPSYS

RXASRC04A.SQL

Run at the master definition location, for each remote location.

Adds each remote location to the replication environment as another master group.

This scripts prompts for the fully qualified database name of the remote location.

10

REPSYS

RXASRC05.SQL

Run at the master definition location.

Generates triggers and packages needed to support replication, at all locations.

Wait while the packages generate at all locations.

To monitor progress, enter the following SQL command from each location:

SELECT * FROM dba_repcatlog WHERE gname = 'RXA_DES';

When the generation process is done, the DBA_REPCATLOG has no records. Once the count is zero, enter the following SQL command from each location:

SELECT COUNT(*) FROM dba_repobject WHERE sname = 'RXA_DES';

The count should be 138.

11

REPSYS

RXASRC06.SQL

Run at the master definition location.

Resumes normal replication activity on RXA_DES (quiesced by the RXASRC03.SQL script).


12.6.1.3 Verifying Data Is Replicating

To check whether data is replicating correctly:

  1. Modify the description of a region at each location.

  2. Verify that the change replicates to the other locations.

Caution:

Do not change the description of the same record at two different locations unless the first change is replicated. Otherwise, you may cause a data conflict. See "Problems During Installation of Symmetric Replication" for more information.

12.6.2 Enabling Symmetric Replication

To activate symmetric replication in each location:

  1. Log in at the Global Library-owning location.

  2. Navigate to Admin, Reference Codelists, and then select Installation Codelists.

  3. Query for the OCL_OPTIONS_TYPE_CODE installation codelist.

  4. Set the Long Value of the SR_INSTALLED parameter to Y.

  5. Save your changes.

  6. Perform Global Library replication.

You cannot change this codelist setting manually at other sites.

12.6.3 Reconciling Data

This section outlines one approach for reconciling data at different locations. A description of Oracle Clinical's management of conflict resolution follows.

Execute all scripts from the RXA_DES account at the master definition location, with the current or default directory being the install directory.

Note:

Use the OCL_MENU_ACCESS local reference codelist to specify which types of data can be maintained at each location. You can set this reference codelist at any time.

To reconcile data:

  1. Make sure that the database is active, but that no study design entries are being made.

  2. Enter the following command from the SYS account of each database:

    GRANT EXECUTE ON DBMS_RECTIFIER_DIFF TO RXA_DES;

  3. Pick a reconciliation master location.

    Once the reconciliation process is completed, all data will be copied from the master location to the remote location.

  4. Set the SQL*Plus environment before running the scripts:

    SET ARRAYSIZE 1

  5. Make sure the RXA_DES account is assigned a default tablespace in which it has quota.

  6. Log in as RXA_DES. Run the diffwsetup.sql script. This script creates the tables that will be populated when you run the diffwgo.sql script.

  7. Run the command:

    @diffremote.sql remote_db_link

    where remote_db_link is the database link to the remote database. For example:

    @diffremote hp73x1.world
    
  8. Run the diffwgo.sql script. For each table, this script:

    • Empties DIFFtablename and DIFFRtablename.

    • Uses the Oracle DBMS_RECTIFIER_DIFF.DIFFERENCES function to compare the tablename table with the like table in the remote database and populates the DIFFtablename and DIFFRtablename tables based on the comparison.

      These tables are used for later steps.

    • Inserts any records from the remote location that are missing at the master location into the master location.

    • Creates the COMPtablename comparison table.

      This table contains two records for each record at the master location that matches a record in the remote location based on primary keys, but differs from the remote location on one or more field values.

    • Creates the COMP2 tablename comparison table similar to the COMP tablename table, but eliminates duplicate master location records when that same record is compared to multiple remote locations.

  9. Look at the COMP2tablename tables created when you ran the diffwgo.sql script. The following tables will probably show differences:

    COMP2OCL_INVESTIGATORST
    COMP2OCL_SITEST
    COMP2TREATMENT_REGIMENS

    COMP2OCL_INVESTIGATORST and COMP2OCL_SITEST will show differences for the XDUMMY1 investigator and site because of differences in the times these dummy records were created. These records are created at installation.

    COMP2TREATMENT_REGIMENS will show differences for previously replicated treatment regimens because of differences in the PM_ID field. Before V3.1, the PM_ID field was not correctly replicated.

    For values that are different, decide whether the value from the remote location or the master location is more accurate. If the value from the remote location is more accurate, update the table corresponding to that comparison table to have the appropriate value. If the master location is more accurate, no action is necessary. Delete all records from COMP2tablename (or only those that have reconciled, if you do not look at all of them).

    Caution:

    Before executing the diffwpropagate.sql script in the next step, back up your data. The script copies all tables involved in symmetric replication to the remote location. Set the SQL*Plus environment again (Step 4), if necessary.
  10. Run the diffwpropagate.sql script.

    This script propagates data involved in symmetric replication from the master location to the remote location. The script automatically uses the remote database link that you specified with the diffremote.sql command (Step 7).

  11. Repeat Step 6 through Step 10 for each remote location.

  12. Run diffwdrop.sql to drop all tables used for comparison.

12.6.3.1 Conflict Resolution

Updates to the same record at more than one location before the updates are replicated creates a conflict. For example, if two locations tried to change the code associated with a particular investigator this could cause a conflict when replication is invoked. Handling this type of conflict is one of the management tasks Oracle Clinical performs as part of the replication process. This section describes how Oracle Clinical manages this conflict resolution.

Oracle advanced replication offers several methods for resolving this conflict, while keeping the data synchronized and creating no additional entries in the error queue. Oracle Clinical implements the latest time-stamp method, that is, the update with the most recent time stamp overrides updates at other conflicting locations.

For example, an update to a record in New York has a time stamp of 10:00, Boston updates the same record with a time stamp of 10:02, and the updates are not propagated between the two updates. In this case, the Boston update overrides the New York update.

This does mean that in the case of update conflicts locations in a later (more eastern) time zone will usually prevail, as the latest time-stamp method is not sensitive to differences in time zones. However, these conflicts should occur rarely in Oracle Clinical because the data chosen to be symmetrically replicated is not updated frequently and the replication is scheduled to occur every 2 to 3 minutes.

Without an update conflict resolution method, when update conflicts occur an entry is added to the error queue and neither update is propagated. The error queue can be difficult to manage, so keeping it as clean as possible is important. Additionally, further updates to the same record would automatically create conflicts because symmetric replication requires the pre-update value of all fields exactly match.

Other types of conflicts can occur, such as two locations inserting exactly the same record or a record with the same key values. If some data that is symmetrically replicated is part of clinical study replication (which could occur if the data had not yet been symmetrically replicated), then when symmetric replication occurred, a unique key (insert) conflict would occur. However, having SR_INSTALLED set to Y in the OCL_OPTIONS_TYPE_CODE Installation Codelist avoids this type of conflict. When this option is enabled, symmetrically replicated data is not inserted when a user replicates a clinical study from the menu between symmetric replications.

12.6.3.2 Non-study-specific Tables Replicated

The following table lists the set of tables containing non-study-specific information that is replicated between all locations when you run the RXASRALL.SQL script.

The OCL_MENU_ACCESS local reference codelist determines which of the non-study-specific tables can be updated at your site. When you set up this access, coordinate the sites. You probably do not want one site responsible for all updating, but if too many sites have update privileges, you risk creating conflicts. Other considerations include how frequently these tables are replicated and time zone differences.

Table 12-6 Non-study-specific Tables Replicated

CLINICAL_SUBJECTS

OCL_PRODUCT_MASTERS

PATTERNS

COMBINED_TREATMENT_COMPONENTS

OCL_PROGRAM_PRODUCT_MASTERS

REGION_COMPONENTS

DAILY_DOSES

OCL_PROGRAMS

REGIONS

FACTORS

OCL_PROJECTS

STRATA

OCL_DOSAGE_FORMS

OCL_SITES

STRATUM_COMPONENTS

OCL_INVESTIGATORS

OCL_SITEST

TITRATION_STEPS

OCL_INVESTIGATORST

OCL_STUDIES

TREATMENT_REGIMENS

OCL_ORGANIZATION_UNITS

OCL_UOM_CONVERSIONS

TREATMENT_REGIMEN_BY_RANGES


12.6.4 Troubleshooting Symmetric Replication

Symmetric replication provides much desirable capability to sites using it, but it requires monitoring that takes some regular time and education. This section provides some guidelines to stay abreast of issues that affect the monitoring of Oracle Clinical on systems with symmetric replication enabled.

You should be familiar with Oracle Server advanced replication concepts. The most relevant items in the documentation set are the Replication and Replication API Reference manuals. Significant chapters include:

  • Using Multimaster Replication

  • Administering a Replicated Environment

  • Using Deferred Transactions

This section is not intended to be comprehensive, but offers some guidance in diagnosing symmetric replication problems. The first two sections cover the two stages when most problems arise: while installing Oracle Clinical with symmetric replication, and during routine use. The last section provides some ideas for disaster recovery.

12.6.4.1 Problems During Installation of Symmetric Replication

If problems arise in replication during the installation process, check the parameters listed in this section.

Parameters in the init.ora File

The following table lists the parameters in the init.ora file that:

  • Are used in testing Oracle Clinical and required at installation

  • Are known to have an impact on performance

Table 12-7 Parameters to Check in the init.ora File for Symmetric Replication

Parameter Value    These Parameters …

JOB_QUEUE_PROCESSES

1

   Are used in testing Oracle    Clinical and required at    installation

JOB_QUEUE_INTERVAL

600

SHARED_POOL_SIZE

At least 60 MB

GLOBAL_NAMES

TRUE

DISTRIBUTED_LOCK_TIMEOUT

30 or greater

   Are known to have an    impact on performance

OPEN_LINKS

Number of symmetrically replicated sites


Advanced Replication Option Is Installed

SELECT * FROM v$option;

The value of the Advanced replication parameter should be TRUE.

Invalid Replication Objects

SELECT sname,oname FROM dba_repobject WHERE status != 'VALID'

DBA_REPCATLOG Is Empty

SELECT timestamp, sname, oname, message FROM dba_repcatlog;

12.6.4.2 Problems During Routine Use of Symmetric Replication

If you encounter problems after you have successfully initiated symmetric replication, checking for the following situations may provide clues or answers.

Broken Jobs

SELECT job,broken,interval,what FROM user_jobs;

The PSUB job that executes symmetric replication is set to run every few minutes. After 16 consecutive failed attempts to connect to a location, its status becomes BROKEN. Broken job can occur, for example, if a database went down halfway through a replication.

You must stop and restart the broken jobs.

Scheduled Jobs Executing

SELECT job,dblink,last_date FROM defschedule;

The last date should have a value for the job in question.

Unavailable Queues

If you get an error message that a queue is not available for enqueueing, enter the following statement from the SYSTEM account in the master database:

EXECUTE dbms_aqadm.start_queue (
   queue_name => 'queue_name_from_message');

followed by a commit.

Errors in DEFERROR

SELECT * FROM deferror;

DEFTRAN queue emptying after sufficient time has elapsed

SELECT COUNT(*) FROM deftran;

Pending Calls

SELECT * FROM defcall;

Invalid Objects in RXA_DES, SYS, SYSTEM, and REPSYS

SELECT owner,object_name,object_type FROM dba_objects
WHERE owner IN ('RXA_DES','SYS','SYSTEM');

Incorrect Links

SELECT username,global_name FROM user_users@link,
global_name@link;

  • From SYS, the user name should be REPSYS.

  • From RXA_DES, the user name should be RXA_DES.

  • From RXC_REP, the user name should be RXC_REP.

  • From anyuser, the user name should be RXA_READ.

Error and Transaction Queues Not Processing Correctly

First, force the transactions to occur.

  • From location 1:

    EXECUTE DBMS_DEFER_SYS.EXECUTE('location 2 link');

  • From location 2:

    EXECUTE DMBS_JOB.EXECUTE('location 1 link');

Then, check the error queue and transaction queue. If these queues are working, the problem is probably the job scheduling.

Deadlocks or Other Database Errors

Examine the Oracle trace files.

Differences in Data at Different Locations

See "Reconciling Data" and follow the procedure to see if there are differences in the data at disparate locations. You may want to eliminate the last step that propagates data from one location to another.

12.6.4.3 Problems after a Failure when Using Symmetric Replication

Oracle Clinical uses several different techniques to replicate data and the underlying database model is very complex. This section is not intended to be the definitive guide to data recovery; it provides some idea of the issues specific to Oracle Clinical replication.

Note:

This section assumes you have already established a backup and recovery plan as described in the Oracle Backup and Recovery Guide.

With most failures, standard Oracle recovery methods are sufficient. For example, if there were an instance failure during replication, Oracle Clinical would recover cleanly and resume from where it left off (with the possible exception of "broken" jobs, see above). In the event of a disaster, the primary concern is the Global Library.

Following are some scenarios of possible disasters and how to recover from them. They assume that generic database recovery has been completed but was unable to fully restore the database. Recovering from a real disaster will probably involve several different scenarios.

Damage to the Global Library at a Non-Global Library Location

Once Oracle Clinical is available for normal use, you can recover the Global Library at a non-Global Library location by performing a full replication from the Global Library-owning location.

Note:

The global library is a logical collection of data within Oracle Clinical. The actual tables also contain study definitions. Depending upon the cause of the disaster, you may also need to recover study definitions.

Damage to the Global Library at the Global Library-owning Location

To repair damage to the Global Library at the Global Library-owning location:

  1. Restore the Global Library-owning location.

    1. Identify the most recent copy of the global library.

    2. Open the OCL_INSTALLATION installation reference codelist.

    3. Set the Long Value of the GLIB_LOCATION parameter to that site.

    4. Perform a full replication at the Global Library-owning location.

    5. Return to the OCL_INSTALLATION codelist and set GLIB_LOCATION back to its original Long Value.

  2. Recover the data entered into the Global Library between the time of the original replication and the actual disaster. This orphaned data can exist only at the Global Library-owning location.

    1. Test for Study Questions, Question Groups, DCMs, DCIs, and DVGs where the corresponding library object is missing.

    2. Either delete the orphaned study records or reconstruct the Global Library records. This process requires altering internal IDs from SQL*Plus.