Prerequisites
The following section describes the prerequisites for working with the Qlik Replicate Oracle endpoint.
Install the required driver
Support for the XMLTYPE data type requires the full Oracle Client.
Replicate On Windows
Install Oracle Instant Client for Microsoft Windows (x64) Version 19.0 or later.
Replicate On Linux
-
Stop the Replicate service and optionally confirm that it has stopped as described in Replicate server procedures.
- Install Oracle Instant Client for Linux (x86-64) Version 19.0 or later.
-
In addition, if not already included in your system, create a symbolic link in the $Oracle_Home\lib directory. Name the link libclntsh.so, and point it to a specific version of this file.
Example:
lrwxrwxrwx 1 oracle oracle 63 Oct 2 14:16 libclntsh.so -> /u01/app/oracle/home/lib/libclntsh.so.19.1
-
Change the working directory to <Replicate-Install-Dir>/bin.and append the LD_LIBRARY_PATH environment variable to the Oracle instant client directory and to the Replicate lib directory. Do this by copying the driver location to the site_arep_login.sh file:
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/oracle/instantclient_<version>:/opt/attunity/replicate/lib/" > site_arep_login.sh -
Optionally, confirm that the driver location was copied:
cat site_arep_login.sh
-
Start the Replicate service and optionally confirm that it has started as described in Replicate server procedures.
Provide Oracle account access
You must provide Oracle account access to the Qlik Replicate user. This user must have read/write privileges on the Oracle database. For information on setting up access to the Oracle account, see Permissions.
Ensure that ARCHIVELOG mode is on
Oracle can be run in two different modes: the ARCHIVELOG mode and the NOARCHIVELOG mode. To use the Oracle logs with Qlik Replicate, run the database in ARCHIVELOG mode. If the log is not set to ARCHIVELOG mode, then execute the following query:
ALTER database ARCHIVELOG
Note that if your Oracle database instance is on Amazon RDS, a different command needs to be executed. For more information, see Enabling automatic backups and Setting up archiving in Working with Amazon RDS for Oracle.
Set up supplemental logging
Supplemental logging must be enabled for the Oracle database.
When replicating from an Oracle standby environment, supplemental logging must be set up in the primary Oracle instance (as described below), not in the standby instance.
Set up supplemental logging as described in the steps below.
Step 1: Check that supplemental logging is enabled for the database
-
Run the following query:
SELECT name, value, description FROM v$parameter WHERE name = 'compatible';
The returned result should be from GE to n.n.n where n.n.n is the Oracle database version (e.g. 10.0.0).
Information noteFor Replicate to work, the parameter value must match the real version of the database.
-
Run the following query:
SELECT supplemental_log_data_min FROM v$database;
The returned result should be YES or IMPLICIT.
Enable supplemental logging by executing the following query:
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA
Information noteIf your Oracle database instance is on Amazon RDS, a different command needs to be executed. For more information, see Working with Amazon RDS for Oracle.
Step 2: Make sure that the required supplemental logging is added for all columns on each table
- If a Primary Key exists, supplemental logging must be added for the Primary Key either by using the format to add supplemental logging on the Primary Key, or by adding supplemental logging on the Primary Key columns.
- If no Primary Key exists and the table has a single Unique Index, then all of the Unique Index’s columns must be added to the supplemental log. Using SUPPLEMENTAL LOG DATA (UNIQUE INDEX) COLUMNS does not add the Unique Index columns to the log.
- If no Primary Key exists and the table has multiple Unique Indexes, Qlik Replicate will select the first Unique Index. Qlik Replicate will use the first index in an alphabetically ordered ascending list. Supplemental logging must be added on the selected index's columns. Using SUPPLEMENTAL LOG DATA (UNIQUE INDEX) COLUMNS does not add the Unique Index columns to the log.
-
If there is no Primary Key and no Unique Index, supplemental logging must be added on all columns.
Information noteWhen the target table Primary Key/Unique Index is different than the source table Primary Key/Unique Index, the user needs to add supplemental logging manually on the source table columns that comprise the target table Primary Key/Unique Index.
- If you change the target table primary key, the supplemental logging must be added on the selected index's columns instead of the columns of the original primary key/unique index.
Step 3: If a filter or transformation is defined for the table, additional logging might be necessary
If ALL COLUMNS supplemental logging has been added to the table, there is no need to add any additional logging.
If the table has a Unique Index or a Primary Key, you also need to add supplemental logging on each column that is involved in a filter or transformation (if those columns are different than the Primary Key or Unique Index columns).
If a transformation uses only one column, this column may not be added to a supplemental logging group. For example, "A+B" needs both columns to be added, whereas substring(A, 10) does not need "A" to be added.
One method of setting up both Primary Key/Unique Index supplemental logging and supplemental logging on specific columns is to add USER_LOG_GROUP supplemental logging only on the Primary Key/Unique Index columns and on the columns that are filtered or transformed.
For example, to replicate a table named EXAMPLE.TABLE with Primary Key ID and filter by column NAME, you can run a command similar to the one below to create the log group supplemental logging:
ALTER TABLE EXAMPLE.TABLE ADD SUPPLEMENTAL LOG GROUP example_log_group (ID,NAME) ALWAYS;
Step 4: Supplemental logging when the "Insert the missing target record" Apply Conflicts option is selected
When the Insert the missing target record Apply Conflicts option is selected, supplemental logging must be enabled for ALL the source table columns.
GoldenGate requirements
To use the Oracle XStream endpoint in a replication task, you must have a GoldenGate license. In addition, the user defined in the Oracle XStream endpoint settings must be a GoldenGate administrator.
When the Oracle XStream endpoint is configured to create the XStream Server, the user specified in the endpoint settings must also be an XStream administrator. For more information, see Prerequisites for Configuring XStream Out
Permissions
When replicating from Oracle for Amazon RDS, see Required Amazon RDS for Oracle permissions instead.
General permissions
To use the Oracle XStream endpoint in a replication task, the user defined in the Oracle XStream endpoint settings must be granted the following privileges in the Oracle database.
If any of the required privileges cannot be granted to a V$xxx, then grant them to the V_$xxx.
- CREATE SESSION
- SELECT on V_$PARAMETER
- SELECT on V_$NLS_PARAMETERS
- SELECT on V_$TIMEZONE_NAMES
- SELECT on GV_$TRANSACTION
- SELECT on V_$CONTAINERS
- SELECT on ALL_INDEXES
- SELECT on ALL_OBJECTS
- SELECT on ALL_TABLES
- SELECT on ALL_USERS
- SELECT on ALL_CATALOG
- SELECT on ALL_CONSTRAINTS
- SELECT on ALL_CONS_COLUMNS
- SELECT on ALL_TAB_COLS
- SELECT on ALL_IND_COLUMNS
- SELECT on SYS.DBA_REGISTRY
- If views are exposed: SELECT on ALL_VIEWS
Permissions when replicating explicitly selected tables
Grant the following additional privilege (for each replicated table) when you are using an explicit table list:
- SELECT on <any-replicated-table>;
Permissions when replicating tables that match a pattern
Grant the following additional privilege when using a pattern for the table list:
- SELECT ANY TABLE;
Permission for accessing an Oracle standby database
- SELECT on V$STANDBY_LOG
Permissions for accessing nested tables
- SELECT on all_nested_tables
- SELECT on all_nested_table_cols