This example shows a one-to-many replication where the source is Oracle and it is replication real time to both Oracle and MySQL targets.
This replication is going to use Swingbench as an Order-Entry simulation system replicating from Oracle to MySQL. Swingbench can be found here: http://www.dominicgiles.com/swingbench.html
This replication will use the Dbvisit LOAD function to create and load all the data into the target database and ensure the data is completely in sync before the replication is started.
Click here for prerequisite checklist.
Some data types cannot be replicated from Oracle to MySQL. Please see supported data types.
For the Swingbench tables, the following columns will be excluded from the replication because these data types cannot be replicated from Oracle to MySQL:
REPOE.PRODUCT_INFORMATION.WARRANTY_PERIOD INTERVAL YEAR TO MONTH REPOE.ORDER_ITEMS.CONDITION CONDITION IS A MYSQL KEYWORD REPOE.ORDERS.ORDER_DATE TIMESTAMP(6) WITH LOCAL TIME ZONE
These tables can be replicated to Oracle, but for consistency in this example, they will also be excluded from the Oracle to Oracle replication.
Setup Wizard Example
This example shows an Oracle-to-MySQL one-way replication using the following information.
Server/Database | Name |
---|---|
Source database | XE (Oracle) |
TNS alias for source database | ttorcl_src |
Source server | source (Linux) |
Target database 1 | Oracle |
Target server | target (Linux) |
TNS alias for target database | ttorcl_trg |
Target database 2 | MySQL |
Target server | target (Linux) |
Name of the replication (ddcfile) | repoe_mysql |
Throughout the wizard, defaults are shown in [brackets]. Just press enter to accept them. The replication name in this example is "repoe_mysql".
Setup Swingbench
The command line version of Swingbench is used in this example. Please follow the instruction to download and configure swingbench here.
Ensure Swingbench is configured and has an initial data setup loaded in the source database before continuing to the next step.
Start the setup wizard
First of all start the Dbvisit Reporting command line console:
[oracle@source ~]$ ./dbvrep Initializing.....done Dbvisit Replicate Copyright (C) Dbvisit Software Limited. All rights reserved. No DDC file loaded. Run "setup wizard" to start the configuration wizard or try "help" to see all commands available. dbvrep>
Then start the setup wizard and follow the instructions. Most of the defaults can be chosen. Choose Oracle as the first database to be setup:
dbvrep> setup wizard This wizard configures Dbvisit Replicate. The setup wizard creates configuration scripts, which need to be run after the wizard ends. No changes to the databases are made before that. The progress is saved every time a list of databases, replications, etc. is shown. It will be re-read if wizard is restarted and the same DDC name and script path is selected. Run the wizard now? [yes] Accept end-user license agreement? (view/yes/no) [view] yes Before starting the actual configuration, some basic information is needed. The DDC name and script path determines where all files created by the wizard go (and where to reread them if wizard is rerun) and the license key determines which options are available for this configuration. (DDC_NAME) - Please enter a name for this replication (suggestion: use the name of the source database): [] repoe_2 (LICENSE_KEY) - Please enter your license key: [(trial)] Which Replicate edition do you want to trial (LTD/XTD/MAX): [MAX] <tory for location of configuration scripts on this machine: [/u01/app/oracle/repoe_2] Network configuration files were detected on this system in these locations: /u01/app/oracle/product/11.2.0/xe/network/admin (TNS_ADMIN) - Please enter TNS configuration directory for this machine: [/u01/app/oracle/product/11.2.0/xe/network/admin] Step 1 - Describe databases ======================================== The first step is to describe databases used in the replication. There are usually two of them (source and target). Store SYSDBA and DBA passwords? Passwords only required during setup and initialization? (yes/no) [yes] Let's configure the database, describing it's type, connectivity, user names etc. What type of database is this? (Oracle/MySQL/SQL Server/Oracle AWS RDS/CSV/Hadoop): [Oracle] Please enter database TNS alias: [] ttorcl_src Please enter SYSDBA user name: [SYS] Please enter password for this user: [change_on_install] Please enter user with DBA role: [SYSTEM] Please enter password for this user: [manager] Connecting to database ttorcl_src as SYSTEM to query list of tablespaces and to detect ASM (by looking whether any redo logs or archived logs are stored in ASM). Enter the Dbvisit Replicate owner (this user will be created by this script): [dbvrep] Please enter password for this user: [dbvpasswd] Permanent tablespaces detected on the database: REPOE_DATA, USERS. Please enter default permanent tablespace for this user: [REPOE_DATA] Temporary tablespaces detected on the database: TEMP. Please enter default temporary tablespace for this user: [TEMP] Following databases are now configured: 1: Oracle ttorcl_src, SYS/***, SYSTEM/***, dbvrep/***, REPOE_DATA/TEMP, dbvrep/, ASM:NO, TZ: +00:00