We're here to help!

Oracle to MySQL Replication Setup Example 02 - using Swingbench

Follow

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

Setup Wizard Example

This example shows an Oracle-to-MySQL one-way replication using the following information.

Server/DatabaseName
Source databaseXE (Oracle)
Source serversource (Linux)
Target databaseMySQL
Target servertarget (Linux)
TNS alias for source database   ttorcl_src
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 Replicate 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_mysql                                          
(LICENSE_KEY) - Please enter your license key: [(trial)]                                                                                                         
Which Replicate edition do you want to trial (LTD/XTD/MAX): [MAX]                                                                                                
(SETUP_SCRIPT_PATH) - Please enter a directory for location of configuration scripts on this machine: [/u01/app/oracle/repoe_mysql]                              

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

Now we are going to add another database. This time it will be MySQL. For MySQL only the target host name and root user and password are needed. Note that the mysql client is needed to make the connection to MySQL:

Enter the number of the database to modify it, or "add", or "done": [add]                                                                                        
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] MySQL                                                               
Please enter database hostname: [localhost] target                                                                                                               
Please enter user name of an administrator: [root]                                                                                                               
Please enter password for this user: [] ****
Enter the user to log into apply database: [root]                                                                                                                
Please enter password for this user: [password] ****
Enter the database (schema) to use for Dbvisit Replicate internal data (will be created in the script): [dbvrep]                                                 

Following databases are now configured:
1: Oracle ttorcl_src, SYS/***, SYSTEM/***, dbvrep/***, REPOE_DATA/TEMP, dbvrep/, ASM:NO, TZ: +00:00
2: MySQL host=target, root/***, root/***, root/***, /, dbvrep/, ASM:n/a, TZ: 
Enter the number of the database to modify it, or "add", or "done": [done]                                                                                       

Choose which is the source database (Oracle) and which is the target database (MySQL):

Step 2 - Replication pairs
========================================
The second step is to set source and targets for each replication pair.
Let's configure the replication pair, selecting source and target.
Following databases are described:
1: ttorcl_src (Oracle)  
2: host=target (MySQL) (cannot be source, is not Oracle) 
Select source database: [1]                                                                                                                                      
Select target database: [2]                                                                                                                                      
Will limited DDL replication be enabled? [yes]                                                                                                                   
Use fetcher to offload the mining to a different server? (yes/no) [no]                                                                                           
Would you like to encrypt the data across the network (yes or no) [no]                                                                                           
Would you like to compress the data across the network (yes or no) [no]                                                                                          
How long do you want to set the network timeouts. Recommended range between 60-300 seconds [60]                                                                  

Choose how the data will be initially loaded. Choose single-scn to lock the data. Choose load to load the initial data, and choose create to create the tables on the MySQL target database:

Lock and copy the data initially one-by-one or at a single SCN?
one-by-one : Lock tables one by one and capture SCN
single-scn : One SCN for all tables
ddl-only   : Only DDL script for target objects
resetlogs  : Use SCN from last resetlogs operation (standby activation, rman incomplete recovery)
no-lock    : Do not lock tables. Captures previous SCN of oldest active transaction. Requires pre-requisite running of pre-all.sh script                         
(one-by-one/single-scn/ddl-only/resetlogs/no-lock) [single-scn]                                                                          

What data instantiation script to create?
ddl_file       : DDL file created (APPLY.sql)
ddl_run        : DDL is automatically executed on target
load           : All replicated data is created and loaded automatically 
none                                                                                                                                                             
(ddl_file/ddl_run/load/none) [ddl_file] load
Do you want to (re-)create the tables on target or keep them (they are already created)? (create/keep) [create]
Following replication pairs are now configured:
1: ttorcl_src (Oracle) ==> host=target (MySQL), DDL: yes, fetcher: no, process suffix: (no suffix), compression: no, encryption: no, network timeout: 60,
prepare type: single-scn, data load: load_create
Enter number of replication pair to modify it, or "add", or "done": [done]                                                                                       

Choose the tables to be replicated. In this case we are going to select the whole swingbench schema: REPOE. Do not choose any of the advanced features:

Step 3 - Replicated tables
========================================
The third step is to choose the schemas and tables to be replicated. If the databases are reachable, the tables are checked for existence, datatype support,
etc., schemas are queried for tables. Note that all messages are merely hints/warnings and may be ignored if issues are rectified before the scripts are
actually executed.

Following tables are defined for replication pairs:
1: ttorcl_src (Oracle) ==> host=target (MySQL), DDL: yes, suffix: (no suffix), prepare: single-scn
  No tables defined.
Enter number of replication pair to modify it, or "done": [1]                                                                                                    

Please enter list of all individual tables to be replicated. Enter schema name(s) only to replicate all tables in that schema. Use comma or space to delimit the
entries.
Enter the tables and schemas: [] REPOE                                                                                                                           
Selected schemas: REPOE
Add more tables or schemas? (YES/NO) [NO]  

You can also specify some advanced options:
1. Exclude some tables from schema-level replication
2. Rename schemas or tables.
3. Specify filtering conditions.
4. (Tables only) Configure Change Data Capture; this does not maintain a copy of the source table, but logs all operations as separate entries. This is useful
for ETL or as an audit trail. This usually requires adding of new columns (timestamps, old/new values etc.) to the target table.
Specify rename name or filter condition for any of the specified schemas (YES/NO): [no]                                                                          
(PREPARE_SCHEMA_EXCEPTIONS) - Specify tables to exclude from PREPARE SCHEMA, if any: []                                                                          

Following tables are defined for replication pairs:
1: ttorcl_src (Oracle) ==> host=target (MySQL), DDL: yes, suffix: (no suffix), prepare: single-scn
  REPOE(tables)
Enter number of replication pair to modify it, or "done": [done]                                                                                                                       

Specify the server names of where the Mine process and the Target process will run. Leave the rest as defaults:

Step 4 - Process configuration
========================================
The fourth step is to configure the replication processes for each replication.

Following processes are defined:
1: MINE on ttorcl_src
  Not configured.
2: APPLY on host=target
  Not configured.
Enter number of process to modify it, or "done": [1]                                                                                                             
Fully qualified name of the server for the process (usually co-located with the database, unless mine is offloaded using fetcher): [source]                      
Server type (Windows/Linux/Unix): [Linux]                                                                                                                        
Enable email notifications about problems (yes/no)? [no]                                                                                                         
Enable SNMP traps/notifications about problems (yes/no)? [no]                                                                                                    
Directory with DDC file and default where to create log files etc. (recommended: same as global setting, if possible)? [/u01/app/oracle/repoe_mysql]             

Following settings were pre-filled with defaults or your reloaded settings:
----------------------------------------
[MINE_REMOTE_INTERFACE]: Network remote interface: source:7901 
[MINE_DATABASE]: Database TNS: ttorcl_src 
[TNS_ADMIN]: tnsnames.ora path: /u01/app/oracle/product/11.2.0/xe/network/admin 
[MINE_PLOG]: Filemask for generated plogs: /u01/app/oracle/repoe_mysql/mine/%S.%E (%S is sequence, %T thread, %F original filename (stripped extension), %P
process type, %N process name, %E default extension)
[LOG_FILE]: General log file: /u01/app/oracle/repoe_mysql/log/dbvrep_%N_%D.%E 
[LOG_FILE_TRACE]: Error traces: /u01/app/oracle/repoe_mysql/log/trace/dbvrep_%N_%D_%I_%U.%E 

Checking that these settings are valid...
Do you want change any of the settings? [no]                                                                                                                     

Following processes are defined:
1: MINE on ttorcl_src
  Host: source, SMTP: no, SNMP: no
2: APPLY on host=target
  Not configured.
Enter number of process to modify it, or "done": [2]                                                                                                             
Fully qualified name of the server for the process (usually co-located with the database, unless mine is offloaded using fetcher): [target]                      
Server type (Windows/Linux/Unix): [] Linux                                                                                                                       
Enable email notifications about problems (yes/no)? [no]                                                                                                         
Enable SNMP traps/notifications about problems (yes/no)? [no]                                                                                                    
Directory with DDC file and default where to create log files etc. (recommended: same as global setting, if possible)? [/u01/app/oracle/repoe_mysql]             

Following settings were pre-filled with defaults or your reloaded settings:
----------------------------------------
[APPLY_REMOTE_INTERFACE]: Network remote interface: target:7902 
[APPLY_DATABASE]: Database MySQL connection string: database=dbvrep;host=target 
[TNS_ADMIN]: tnsnames.ora path: /u01/app/oracle/product/11.2.0/xe/network/admin 
[APPLY_SCHEMA]: Dbvisit Replicate database (schema): dbvrep 
[APPLY_STAGING_DIR]: Directory for received plogs: /u01/app/oracle/repoe_mysql/apply 
[LOG_FILE]: General log file: /u01/app/oracle/repoe_mysql/log/dbvrep_%N_%D.%E 
[LOG_FILE_TRACE]: Error traces: /u01/app/oracle/repoe_mysql/log/trace/dbvrep_%N_%D_%I_%U.%E 

Checking that these settings are valid...
Do you want change any of the settings? [no]                                                                                                                     

Following processes are defined:
1: MINE on ttorcl_src
  Host: source, SMTP: no, SNMP: no
2: APPLY on host=target
  Host: target, SMTP: no, SNMP: no
Enter number of process to modify it, or "done": [done]                                                                                                          

Now all the configuration files will be created:

Created file /u01/app/oracle/repoe_mysql/repoe_mysql-APPLY.ddc.
Created file /u01/app/oracle/repoe_mysql/repoe_mysql-MINE.ddc.
Created file /u01/app/oracle/repoe_mysql/config/repoe_mysql-setup.dbvrep.
Created file /u01/app/oracle/repoe_mysql/config/repoe_mysql-dbsetup_ttorcl_src_dbvrep.sql.
Created file /u01/app/oracle/repoe_mysql/config/repoe_mysql-dbsetup_database_dbvrep_host_target_root.sql.
Created file /u01/app/oracle/repoe_mysql/config/repoe_mysql-grants_ttorcl_src_dbvrep.sql.
Created file /u01/app/oracle/repoe_mysql/config/repoe_mysql-grants_database_dbvrep_host_target_root.sql.
Created file /u01/app/oracle/repoe_mysql/config/repoe_mysql-onetime.ddc.
Created file /u01/app/oracle/repoe_mysql/start-console.sh.
Created file /u01/app/oracle/repoe_mysql/repoe_mysql-run-source.sh.
Created file /u01/app/oracle/repoe_mysql/repoe_mysql-run-target.sh.
Created file /u01/app/oracle/repoe_mysql/Nextsteps.txt.
Created file /u01/app/oracle/repoe_mysql/repoe_mysql-all.sh.
===============================================================================================================================================================

Dbvisit Replicate wizard completed
Script /u01/app/oracle/repoe_mysql/repoe_mysql-all.sh created. This runs all the above created scripts. Please exit out of dbvrep, review and run script as
current user to setup and start Dbvisit Replicate.
===============================================================================================================================================================
Optionally, the script can be invoked now by this wizard.
Run this script now? (yes/no) [NO]        
dbvrep>                                                                                                                       

Exit out of dbvrep by typing exit

Excluding columns

Edit the .dbvrep file and add the columns to be excluded:

cd /u01/app/oracle/repoe_mysql/config
vi repoe_mysql-setup.dbvrep

Add the following lines after the line "PROCESS SWITCH_REDOLOG"

EXCLUDE COLUMN OFFLINE REPOE.PRODUCT_INFORMATION.WARRANTY_PERIOD
EXCLUDE COLUMN OFFLINE REPOE.ORDER_ITEMS.CONDITION
EXCLUDE COLUMN OFFLINE REPOE.ORDERS.ORDER_DATE

Save the file and quit the vi editor.  OFFLINE keyword is nessesary since the replication is not yet running.

Initialize the Replication and loading the initial data

Run the "repoe_mysql-all.sh" script to initialize the replication. This will also create the tables on the target database.

[oracle@source repoe_mysql]$ ./repoe_mysql-all.sh
Setting up Dbvisit Replicate configuration
Configure database ttorcl_src...
This check fails if the DBID is not the expected one...


Ok, check passed.
Configure database database=dbvrep
Object grants for database ttorcl_src...
Object grants for database database=dbvrep
Setting up the configuration
Initializing......done
WARN-1850: No DDC DB available, dictionary table does not exist.
DDC loaded from database (0 variables).
Dbvisit Replicate version 2.8
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /u01/app/oracle/repoe_mysql/config/repoe_mysql-onetime.ddc
loaded.
MINE: Cannot determine Dbvisit Replicate dictionary version. (no
dictionary exists)
APPLY: Cannot determine Dbvisit Replicate dictionary version. (no
dictionary exists)
dbvrep> #clear the no-DDC-DB-available warning
dbvrep> process clear previous warnings
dbvrep> set ON_WARNING SKIP
Variable ON_WARNING set to SKIP for process *.
dbvrep> set ON_ERROR EXIT
Variable ON_ERROR set to EXIT for process *.
dbvrep> 
dbvrep> # Configuring default processes
dbvrep> choose process MINE
Process type MINE set to: MINE.
dbvrep> choose process APPLY
Process type APPLY set to: APPLY.
dbvrep> PROCESS SWITCH_REDOLOG
dbvrep> PROCESS SETUP MINE DROP DICTIONARY
0 dictionary objects dropped.
dbvrep> PROCESS SETUP MINE CREATE DICTIONARY
dbvrep> PROCESS SETUP MINE LOAD DICTIONARY
Oldest active transaction SCN: 7614151 (no active transaction)
Supplemental logging on database set.
Loading dictionary table DBRSCOL$
Loading dictionary table DBRSIND$
Loading dictionary table DBRSOBJ$
Loading dictionary table DBRSTAB$
Loading dictionary table DBRSUSER$
Loading dictionary table DBRSV_$DATABASE
dbvrep> PROCESS SETUP APPLY DROP DICTIONARY
0 dictionary objects dropped.
dbvrep> PROCESS SETUP APPLY CREATE DICTIONARY
dbvrep> PROCESS SETUP APPLY LOAD DICTIONARY
dbvrep> PROCESS SETUP PAIR MINE AND APPLY
Applier SCN set (start=7614160, current=7614160).
dbvrep> SET APPLY.INSTANTIATE_SCN NOW
Variable INSTANTIATE_SCN set to NOW for process APPLY.
dbvrep> EXCLUDE CREATE TABLE %.DBMS_TABCOMP_TEMP_UNCMP #Ignore tables
created by Compression Advisor
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.DBMS_TABCOMP_TEMP_CMP #Ignore tables
created by Compression Advisor
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.SCHEDULER$_% #Ignore tables created by
Oracle scheduler (also used by schema/full expdp/impdp)
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.CMP1$% #Ignore tables created by
Compression Advisor since 11.2.0.4
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.CMP2$% #Ignore tables created by
Compression Advisor since 11.2.0.4
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.CMP3$% #Ignore tables created by
Compression Advisor since 11.2.0.4
Exclude rule created.
dbvrep> EXCLUDE CREATE TABLE %.CMP4$% #Ignore tables created by
Compression Advisor since 11.2.0.4
Exclude rule created.
dbvrep> memory_set IGNORE_APPLY_DDL_DIFFERENCES YES
Variable IGNORE_APPLY_DDL_DIFFERENCES set to YES for process *.
dbvrep> SET PREPARE_SCHEMA_EXCEPTIONS none
Variable PREPARE_SCHEMA_EXCEPTIONS set to none for process *.
dbvrep> PROCESS SUPPLEMENTAL LOGGING SCHEMA "REPOE" ENABLE PRIMARY KEY
dbvrep> PROCESS SWITCH_REDOLOG
dbvrep> PROCESS WAIT_SCN_FLIP
Waited 2 seconds until scn_to_timestamp changed.
dbvrep> #single-scn instantiation: lock all tables and schemas
dbvrep> PROCESS LOCK SCHEMAS "REPOE"
Locking all schemas.
...locked 13 of 13 tables from REPOE schema.
Lock done.
dbvrep> #single-scn instantiation: unlock all tables and schemas, but
keep the SCN
dbvrep> PROCESS LOCK RELEASE LOCKS
dbvrep> 
dbvrep> #prepare the tables (we use OFFLINE as neither MINE nor APPLY
is running; with OFFLINE we won't wait on network timeout)
dbvrep> PREPARE OFFLINE SCHEMA "REPOE"
Table REPOE.ADDRESSES instantiated at SCN 7615611
Table REPOE.AVI02 instantiated at SCN 7615611
Table REPOE.CARD_DETAILS instantiated at SCN 7615611
Table REPOE.CUSTOMERS is special: has system-generated column names. 
Table REPOE.CUSTOMERS instantiated at SCN 7615611
Column SYS_NC00017$ is special: virtual column. Excluding.
Column SYS_NC00017$ is special: hidden column. Excluding.
Column SYS_NC00017$ is special: system-generated column. Excluding.
Column SYS_NC00017$ is special: virtual column. Excluding.
Column SYS_NC00018$ is special: virtual column. Excluding.
Column SYS_NC00018$ is special: hidden column. Excluding.
Column SYS_NC00018$ is special: system-generated column. Excluding.
Column SYS_NC00018$ is special: virtual column. Excluding.
Table REPOE.INVENTORIES instantiated at SCN 7615611
Table REPOE.LOGON instantiated at SCN 7615611
Table REPOE.ORDERENTRY_METADATA instantiated at SCN 7615611
Table REPOE.ORDERS instantiated at SCN 7615611
Table REPOE.ORDER_ITEMS instantiated at SCN 7615611
Table REPOE.PRODUCT_DESCRIPTIONS instantiated at SCN 7615611
Table REPOE.PRODUCT_INFORMATION instantiated at SCN 7615611
Table REPOE.SALES instantiated at SCN 7615611
Table REPOE.WAREHOUSES instantiated at SCN 7615611
dbvrep> 
dbvrep> #single-scn instantiation: unlock all tables and schemas,
forget the SCN (so it does not affect any further PREPARE statements)
dbvrep> PROCESS LOCK CLEAR SCN
dbvrep> PROCESS SWITCH_REDOLOG
dbvrep> EXCLUDE COLUMN OFFLINE REPOE.PRODUCT_INFORMATION.WARRANTY_PERIOD
Exclude Column OFFLINE [REPOE.PRODUCT_INFORMATION.WARRANTY_PERIOD] set.
dbvrep> EXCLUDE COLUMN OFFLINE REPOE.ORDER_ITEMS.CONDITION
Exclude Column OFFLINE [REPOE.ORDER_ITEMS.CONDITION] set.
dbvrep> EXCLUDE COLUMN OFFLINE REPOE.ORDERS.ORDER_DATE
Exclude Column OFFLINE [REPSOE.ORDERS.ORDER_DATE] set.
dbvrep> #prepare script for instantiation
dbvrep> DDL DROP REPLICATE "REPOE"
dbvrep> DDL CREATE_FROM_DICT REPLICATE "REPOE"
dbvrep> PROCESS LOAD_REQUEST SCHEMA "REPOE" AT INSTANTIATE SCN
Table REPOE.ADDRESSES will be loaded using SCN 7615611.
Table REPOE.AVI02 will be loaded using SCN 7615611.
Table REPOE.CARD_DETAILS will be loaded using SCN 7615611.
Table REPOE.CUSTOMERS will be loaded using SCN 7615611.
Table REPOE.INVENTORIES will be loaded using SCN 7615611.
Table REPOE.LOGON will be loaded using SCN 7615611.
Table REPOE.ORDERENTRY_METADATA will be loaded using SCN 7615611.
Table REPOE.ORDERS will be loaded using SCN 7615611.
Table REPOE.ORDER_ITEMS will be loaded using SCN 7615611.
Table REPOE.PRODUCT_DESCRIPTIONS will be loaded using SCN 7615611.
Table REPOE.PRODUCT_INFORMATION will be loaded using SCN 7615611.
Table REPOE.SALES will be loaded using SCN 7615611.
Table REPOE.WAREHOUSES will be loaded using SCN 7615611.
dbvrep> create ddcdb from ddcfile
DDC loaded into database (366 variables).
dbvrep> set ON_WARNING SKIP
Variable ON_WARNING set to SKIP for process *.
dbvrep> set ON_ERROR SKIP
Variable ON_ERROR set to SKIP for process *.
OK-0: Completed successfully.
Some apply tables were (re)created by the .dbvrep script; now we run the grant scripts again.
Object grants for database ttorcl_src...
Object grants for database database=dbvrep
These steps are required after the repoe_mysql-all.sh script runs:

1) Create the necessary directory(ies) on the servers:
target: /u01/app/oracle/repoe_mysql

2) Copy the DDC files to the server(s) where the processes will run:
target: /u01/app/oracle/repoe_mysql/repoe_mysql-APPLY.ddc
source: /u01/app/oracle/repoe_mysql/repoe_mysql-MINE.ddc

3) Review that path to dbvrep executable is correct in the run scripts:
/u01/app/oracle/repoe_mysql/repoe_mysql-run-source.sh
/u01/app/oracle/repoe_mysql/repoe_mysql-run-target.sh

4) Copy the run script to the server(s) where the processes will run:
source: /u01/app/oracle/repoe_mysql/repoe_mysql-run-source.sh
target: /u01/app/oracle/repoe_mysql/repoe_mysql-run-target.sh

5) Ensure firewall is open for listen interfaces 0.0.0.0:7902, 0.0.0.0:7901 used by the processes.

6) Ensure firewall is open for remote access to mysql (usually port 3306) on target.

7) Make sure the data on apply are in sync as of time when setup was run.

8) Start the replication processes on all servers:
source: /u01/app/oracle/repoe_mysql/repoe_mysql-run-source.sh
target: /u01/app/oracle/repoe_mysql/repoe_mysql-run-target.sh

9) Start the console to monitor the progress:
/u01/app/oracle/repoe_mysql/start-console.sh

The above list is stored in /u01/app/oracle/repoe_mysql/Nextsteps.txt.
[oracle@source repoe_mysql]$ 

As per the instructions above:

1. On the target server (called target in this example) create the following directory:

mkdir /u01/app/oracle/repoe_mysql

2. Copy the DDC files to the server(s) where the processes will run:

scp /u01/app/oracle/repoe_mysql/repoe_mysql-APPLY.ddc oracle@target:/u01/app/oracle/repoe_mysql/repoe_mysql-APPLY.ddc

3. Copy the run script to the server(s) where the processes will run:

scp /u01/app/oracle/repoe_mysql/repoe_mysql-run-target.sh oracle@target:/u01/app/oracle/repoe_mysql/repoe_mysql-run-target.sh

4. Start the replication process on the source server:

cd /u01/app/oracle/dbvrep_mysql
./dbvrep_mysql-run-source.sh
Initializing......done
DDC loaded from database (366 variables).
Dbvisit Replicate version 2.8
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /u01/app/oracle/dbvrep_mysql/dbvrep_mysql-MINE.ddc loaded.
Starting process MINE...Created directory /u01/app/oracle/repoe_mysql/ddc_backup
Created directory /u01/app/oracle/repoe_mysql/log/trace/
Created directory /u01/app/oracle/repoe_mysql/mine/
started

5. Start the replication on the target server:

cd /u01/app/oracle/dbvrep_mysql
./repoe_mysql-run-target.sh 
Initializing......done
DDC loaded from database (367 variables).
Dbvisit Replicate version 2.8 
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /u01/app/oracle/repoe_mysql/repoe_mysql-APPLY.ddc loaded.
Starting process APPLY...Created directory /u01/app/oracle/repoe_mysql/ddc_backup
Created directory /u01/app/oracle/repoe_mysql/log/
Created directory /u01/app/oracle/repoe_mysql/log/trace/
Created directory /u01/app/oracle/repoe_mysql/apply
started

6. On the source server, start the console to view the replication:

- Dbvisit Replicate 2.8(MAX edition) - Evaluation License expires in 30 days
MINE IS running. Currently at plog 341 (LOAD table REPOE.LOGON at 7624081) and SCN 7624080 (02/09/2016 21:55:22).
APPLY IS running. Currently at plog 341 and SCN 7624076 (02/09/2016 21:55:19).
Progress of replication repoe_mysql:MINE->APPLY: total/this execution
--------------------------------------------------------------------------------------------------------------------------------------------
REPOE.CUSTOMERS:              ---%  Mine:660791/660791   Unrecov:0/0         Applied:0/0         Conflicts:0/0       Last:--/--
REPOE.ADDRESSES:              ---%  Mine:923685/923685   Unrecov:0/0         Applied:0/0         Conflicts:0/0       Last:--/--
REPOE.CARD_DETAILS:           ---%  Mine:910791/910791   Unrecov:0/0         Applied:0/0         Conflicts:0/0       Last:--/--
REPOE.INVENTORIES:            ---%  Mine:900131/900131   Unrecov:0/0         Applied:0/0         Conflicts:0/0       Last:--/--
--------------------------------------------------------------------------------------------------------------------------------------------
4 tables listed.

As can be seen above on the second line, the LOAD function is running to create and load the tables on the target database.

The LOAD function may take some time to load. 

The LOAD is completed when all the % show 100%:

| Dbvisit Replicate 2.8 (MAX edition) - Evaluation License expires in 29 days
MINE IS running. Currently at plog 345 and SCN 7782366 (02/10/2016 07:00:26).
APPLY IS running. Currently at plog 345 and SCN 7782354 (02/10/2016 07:00:24).
Progress of replication repoe_mysql:MINE->APPLY: total/this execution
--------------------------------------------------------------------------------------------------------------------------------------------
REPOE.CUSTOMERS:              100%  Mine:660791/660791   Unrecov:0/0         Applied:660791/660791 Conflicts:0/0     Last:09/02/2016 22:46:37/OK
REPOE.ADDRESSES:              100%  Mine:923685/923685   Unrecov:0/0         Applied:923685/923685 Conflicts:0/0     Last:09/02/2016 22:23:08/OK
REPOE.CARD_DETAILS:           100%  Mine:910791/910791   Unrecov:0/0         Applied:910791/910791 Conflicts:0/0     Last:09/02/2016 22:36:52/OK
REPOE.WAREHOUSES:             100%  Mine:1000/1000       Unrecov:0/0         Applied:1000/1000   Conflicts:0/0       Last:10/02/2016 00:35:12/OK
REPOE.ORDER_ITEMS:            100%  Mine:3280768/3280768 Unrecov:0/0         Applied:3280768/3280768 Conflicts:0/0   Last:10/02/2016 00:35:09/OK
REPOE.ORDERS:                 100%  Mine:1143025/1143025 Unrecov:0/0         Applied:1143025/1143025 Conflicts:0/0   Last:09/02/2016 23:47:44/OK
REPOE.INVENTORIES:            100%  Mine:900131/900131   Unrecov:0/0         Applied:900131/900131 Conflicts:0/0     Last:09/02/2016 22:59:22/OK
REPOE.PRODUCT_INFORMATION:    100%  Mine:1000/1000       Unrecov:0/0         Applied:1000/1000   Conflicts:0/0       Last:10/02/2016 00:35:11/OK
REPOE.LOGON:                  100%  Mine:2369089/2369089 Unrecov:0/0         Applied:2369089/2369089 Conflicts:0/0   Last:09/02/2016 23:29:47/OK
REPOE.PRODUCT_DESCRIPTIONS:   100%  Mine:1000/1000       Unrecov:0/0         Applied:1000/1000   Conflicts:0/0       Last:10/02/2016 00:35:10/OK
REPOE.ORDERENTRY_METADATA:    100%  Mine:4/4             Unrecov:0/0         Applied:4/4         Conflicts:0/0       Last:09/02/2016 23:29:47/OK
--------------------------------------------------------------------------------------------------------------------------------------------
11 tables listed.

Start Swingbench 

Swingbench can now be started and the swingbench tables will be replicated with Dbvisit Replicate. 

Start swingbench in a different oracle session:

/u01/app/oracle/swingbench/bin/charbench -v users,tps,trans -cs //source/XE  -u repoe -p repoe -uc 5 -min 1 -max 200 -rt 0:10 -a 

The output of Swingbench will be similar to the following:

Author  :	 Dominic Giles
Version :	 2.5.0.932

Results will be written to results.xml.

Time		Users	TPS	NCR	UCD	BP	OP	PO	BO	SQ	WQ	WA
08:12:10	[0/5]	0	0	0	0	0	0	0	0	0	0
08:12:11	[5/5]	0	0	0	0	0	0	0	0	0	0
08:12:12	[5/5]	7	0	0	5	0	2	0	0	0	0
08:12:13	[5/5]	6	0	0	8	3	2	0	0	0	0
08:12:14	[5/5]	5	0	0	10	6	2	0	0	0	0
08:12:15	[5/5]	8	2	0	14	8	2	0	0	0	0
08:12:16	[5/5]	6	2	0	17	11	2	0	0	0	0
08:12:17	[5/5]	7	3	0	21	12	3	0	0	0	0
08:12:18	[5/5]	7	3	1	24	15	3	0	0	0	0
08:12:19	[5/5]	18	11	3	27	17	4	2	0	0	0
08:12:20	[5/5]	10	13	6	30	19	4	2	0	0	0

Once swingbench is running, the Replicate console will show the progression of the replication:

/ Dbvisit Replicate 2.8 (MAX edition) - Evaluation License expires in 29 days
MINE IS running. Currently at plog 345 and SCN 7785688 (02/10/2016 08:15:11).
APPLY IS running. Currently at plog 345 and SCN 7785555 (02/10/2016 08:15:04).
Progress of replication repoe_mysql:MINE->APPLY: total/this execution
--------------------------------------------------------------------------------------------------------------------------------------------
REPOE.CUSTOMERS:               99%  Mine:660813/660813   Unrecov:0/0         Applied:660810/660810 Conflicts:0/0     Last:10/02/2016 08:15:05/OK
REPOE.ADDRESSES:               99%  Mine:923707/923707   Unrecov:0/0         Applied:923704/923704 Conflicts:0/0     Last:10/02/2016 08:15:05/OK
REPOE.CARD_DETAILS:            99%  Mine:910812/910812   Unrecov:0/0         Applied:910809/910809 Conflicts:0/0     Last:10/02/2016 08:15:05/OK
REPOE.WAREHOUSES:             100%  Mine:1000/1000       Unrecov:0/0         Applied:1000/1000   Conflicts:0/0       Last:10/02/2016 00:35:12/OK
REPOE.ORDER_ITEMS:             99%  Mine:3280919/3280919 Unrecov:0/0         Applied:3280874/3280874 Conflicts:0/0   Last:10/02/2016 08:15:14/OK
REPOE.ORDERS:                  99%  Mine:1143143/1143143 Unrecov:0/0         Applied:1143109/1143109 Conflicts:0/0   Last:10/02/2016 08:15:14/OK
REPOE.INVENTORIES:             99%  Mine:900278/900278   Unrecov:0/0         Applied:900228/900228 Conflicts:0/0     Last:10/02/2016 08:15:11/OK
REPOE.PRODUCT_INFORMATION:    100%  Mine:1000/1000       Unrecov:0/0         Applied:1000/1000   Conflicts:0/0       Last:10/02/2016 00:35:11/OK
REPOE.LOGON:                   99%  Mine:2369230/2369230 Unrecov:0/0         Applied:2369191/2369191 Conflicts:0/0   Last:10/02/2016 08:15:14/OK
REPOE.PRODUCT_DESCRIPTIONS:   100%  Mine:1000/1000       Unrecov:0/0         Applied:1000/1000   Conflicts:0/0       Last:10/02/2016 00:35:10/OK
REPOE.ORDERENTRY_METADATA:    100%  Mine:4/4             Unrecov:0/0         Applied:4/4         Conflicts:0/0       Last:09/02/2016 23:29:47/OK
--------------------------------------------------------------------------------------------------------------------------------------------
11 tables listed.

This completes the replication setup of Swingbench from Oracle to MySQL. 

 

Have more questions? Submit a request

Comments