Destination Oracle #
The following steps refer the extracted Arcion self-hosted CLI download as the
I. Obtain the JDBC driver for Oracle #
Replicant requires Oracle JDBC Driver as a dependency. To obtain the appropriate driver, follow these steps:
- Go to the Oracle Database JDBC driver Downloads page.
- We recommend JDBC Driver 18c and Java 8 compatible driver. So navigate to the Oracle Database 18c Downloads section.
- From there, download the
- Put the
II. Set up shared directory #
Replicant uses the external directory feature in Oracle for efficient loading of data into target Oracle. You must specify the shared directory in the
stage section of the connection configuration file.
- Create a directory shared between Replicant host and Oracle host with
- You can use network file system (NFS) to create the shared directory. For more information, see About NFS and Configuring an NFS server.
The following steps use
/data/shared_fs as the shared directory.
III. Set up Oracle user permissions #
Follow these steps in an Oracle client to grant the necessary privileges to your Oracle user. The following steps provide these privileges to user
GRANT CREATE TABLE TO alex;
If you can’t provide this permission, you must manually create all the tables.
CREATE ANY DIRECTORYprivilege:
GRANT CREATE ANY DIRECTORY TO alex;
If you can’t provide this permission, you must manually create the following directories using
CREATE OR REPLACE:
CREATE OR REPLACE DIRECTORY csv_data_dir AS '/data/shared_fs'; CREATE OR REPLACE DIRECTORY csv_log_dir AS '/data/shared_fs';
ALTER ANY TABLEprivilege:
GRANT ALTER ANY TABLE TO alex;
Manually create user schema and a schema
io_replicate. Grant both of these schemas permission to access a tablespace.
You must make sure that the user you specify in the connection details has the preceding privileges:
CREATE ANY DIRECTORY
If the user does not have
CREATE SCHEMA privilege, then follow these steps:
- Create a schema manually with name
- Grant all privileges for the
io_blitzzschema to that user.
io_blitzz to maintain internal checkpoints and metadata.
IV. Set up connection configuration #
Specify our Oracle connection details to Replicant with a connection configuration file. You can find a sample connection configuration file
oracle_dst.yaml in the
You can store your connection credentials in a secrets management service and tell Replicant to retrieve the credentials. For more information, see Secrets management.
Otherwise, put your credentials in plain text YAML file like the following sample:
root-dir: /data/shared_fs #Enter the path of the shared directory
Replace the following:
HOSTNAME: the Oracle server hostname
PORT_NUMBER: the port number of Oracle host (defaults to
SERVICE_NAME: the database service name that contains the schema you want to replicate
USERNAME: the username to connect to Oracle
PASSWORD: the password associated with
Feel free to change the following parameter values as you need:
max-connections: the maximum number of connections Replicant opens in Oracle.
max-retries: number of times Replicant retries a failed operation.
retry-wait-duration-ms: duration in milliseconds Replicant waits between each retry of a failed operation.
Additional parameters #
- When you don’t specify the
--metadataflag, Replicant uses the target to store metadata. This parameter determines the connection pool size for metadata storage.
- The Unicode character set to use when transferring data. The character set you specify here must match the character set in the source connection configuration.
V. Set up Applier configuration #
To configure replication mode according to your requirements, specify your configuration in the Applier configuration file. You can find a sample Applier configuration file
oracle.yaml in the
snapshot mode replication
For operating in snapshot mode, specify your configuration under the
snapshot section of the conifiguration file. For example:
For more information about the general Applier parameters for
snapshot mode, see Snapshot mode.
The following parameters apply to Oracle for
snapshot mode replication:
Enables partition-wise load on target oracle.
truefor Oracle-to-Oracle pipeline.
If a mismatch occurs between the partitioning spec on source and target, Replicant throws error at runtime. If you set this parameter to
true, Replicant automatically falls back to multithreaded load without partition awareness in the next retry attempt.
Creates constraints and indexes after the snapshot completes.
To create views as views instead of as tables.
true, setting this parameter to
truecreates views after snapshot completes. If this parameter is
false, Replicant creates views before snapshot.
- Arcion can leverage underlying support of
FILE-based bulk loading into the target system. To configure bulk loading, configure the following parameters under
Enable or disable bulk loading.
- The type of bulk loading. Only
FILEtype is supported.
Specifies whether Replicant applies the generated files applied in serial or parallel fashion.
- Specifies the method of bulk loading. The following methods are supported:
- Instructs Replicant to not use a bulk loader.
- This method uses an external table to load intermediate CSV files that Replicant generates into the target Oracle. For this method to work, Replicant requires a shared directory between Replicant host machine and target Oracle.
- Uses Oracle’s
sqlldrutility for client side data loading into target Oracle.
SQLLDRdoesn’t require shared directory between Replicant host machine and target Oracle. However, you need to set the following three environment variables before starting Replicant. You can include them in
.bashrcfile as well.
export ORACLE_HOME=PATH_TO_DIRECTORY_CONTAINING_SQLLDR_BINARY export LD_LIBRARY_PATH="$ORACLE_HOME":$LD_LIBRARY_PATH export PATH="$ORACLE_HOME:$PATH"
PATH_TO_DIRECTORY_CONTAINING_SQLLDR_BINARYwith the location of the
sqlldrdoesn’t accept case-sensitive usernames. For example,
sqlldrdoesn’t accept the first command:
create user “test” identified by “Test#123” create user test identified by “Test#123”
- Defines the usage of Oracle Data Pump Import (
impdp) utility to load table data instead of JDBC. This allows Replicant to efficiently handle large-scale data. For more information, see Oracle Native Import.
Native loading is only supported for Oracle-to-Oracle pipeline.
Enables or disables native loading.
- The type of staging area. The following staging areas are supported:
- A shared directory.
- Oracle Automatic Storage Management (ASM).
- The Oracle directory object corresponding to the
stage-type. For more information, see Create directory object in source and target Oracle.
- Full path to the network file system (NFS) representing the shared directory between Replicant and Oracle.
Oracle Native Import #
For Oracle as both source and target system, Replicant uses Oracle’s native Data Pump Import (
impdp) utility to load data into the target. To set up Replicant and target Oracle to use this feature, follow these instructions:
Step 1: Set up
impdp in Replicant host machine
- Download the Oracle Instant Client Tools Package ZIP and extract the files.
- Copy the
impdpfile to the
- Download the Oracle Instant Client Basic package ZIP and extract the files in a directory.
- Copy the path to the directory where you’ve extracted the Instant Client Basic package ZIP archive.
- Set the
LD_LIBRARY_PATHenvironment variables in your
export ORACLE_HOME=instantClientBasicPath export LD_LIBRARY_PATH="$ORACLE_HOME":$LD_LIBRARY_PATH export PATH="$ORACLE_HOME:$PATH"
Step 2: Create directory object in source and target Oracle #
Replicant uses the external directory feature of Oracle for efficient loading of data into Target Oracle. To use this feature, create a directory shared between Replicant host and Oracle host with
WRITE access. You must create this directory in both source Oracle host and target Oracle host.
- Launch Oracle SQL Plus from the terminal.
- From the SQL Plus prompt, create a directory object that points to an operating system directory. The following creates the
SHARED_STAGEdirectory object that points to the
/shared-volumeoperating system directory:
create directory SHARED_STAGE as '/shared-volume';
WRITEprivileges to the directory object:
grant read,write on directory SHARED_STAGE to SYSTEM;
Step 3: Modify the Applier configuration file #
In Replicant’s Applier configuration file of target Oracle, specify the
snapshot.native-load parameter. This parameter defines the necessary parameters for Replicant to start using Oracle’s