Octopus for Atlas

Version 1.1.2 (11/Apr/2008 at 16:33:55 CEST)


Overview

Octopus Replicator replicates SQL tables. It can work between different database backends as long as they contain equivalent schemas (e.g. Atlas Geometry Database, Tag database, etc.).

It is configured to replicate between Oracle, MySQL and SQLite, but other possibilities can be supported too:

  • Other database and files: Access, DB2, MSQL, Paradox, CJDBC, Excel, Informix, McKoi, PostgreSQL, Sybase, Csv, Hypersonic, Instantdb, MySQL, Oracle, SQLite, QED and XML.
  • Database backup/restore.
  • Database synchronisation.

Octopus contains default mapping rules, they can be customised if needed.

Octopus Replicator works in two steps:

  1. Generation of database schema description and conversions scripts (generate).
  2. Actual database replication itself (load).

Replication task is managed by three files:

  • build.xml - The definitions of tasks and their options (in Ant XML format). In general, a User doesn't have to touch this file.
  • build.properties - The replication parameters. This file has to be modified to describe requested databases.
  • map.properties - The definition of custom mapping. It is only needed when non-standard mapping is required (like different length of varibles, etc.).

Documentation

Octopus uses following files:
Octopus top level directory
Octopus/ant directory fr configuration files
Octopus/ant/build.xml Ant build file with instructions
Octopus/ant/build.properties Ant properties file
Octopus/ant/map.properties customisation mapping rules
Octopus/run working directory (all files here are generated by Octopus)
Octopus/run/LoaderJob.olj Loader task description
Octopus/run/sql directory for SQL scripts
Octopus/run/xml directory for auxiliary schema definitions
Octopus/run/doml directory database schema in DOML format
Octopus/run/GeneratorLog*.txtGenerator task log
Octopus/run/LoaderLog*.txt Loader task log

The package distribution is available here. Java 1.5+ and Ant 1.5+ is required to run.

Notes

Atlas Modifications to Octopus

  1. Atlas GeometriDB: Support for Oracle/varchar2 to MySQL/varchar, etc.: Standard Octopus doesn't support that because Atlas Oracle database contains things like varchar2(4000) while MySQL can't have varchar longer than varchar(255). (This is now supported by Atlas Patch to Octopus via map.properties file. Note, that those user-supplied rules can be highly unsecure.)
  2. Atlas GeometriDB: Support for Oracle small case column names: Standard Octopus doesn't support that. (This was a bug of Octopus. It has been fixed.)
  3. AtlasDD: Support for replication of all tables belonging to an Oracle Schema. (This was a missing feature in Octopus. It has been implemented and fed back to Octopus developers.)
  4. AtlasDD: Unique Index on multiple tables. (This was a bug of Octopus. It has been fixed.)
  5. AtlasCondDB: MySQL tables contain a Primary Index with the name "PRIMARY". (While some MySQL commands accept that, it is not generaly supported as MySQL identifier because "PRIMARY" is an MySQL reserved word.Atlas Octopus Patch now creates commands which accept "PRIMARY" as a Primary Index name. Note, that using reserved words as Identifiers is a bug in Database design.)
  6. Atlas GeometriDB: Support for SQLite: SQLite is not supported by Octopus as it introduces plaform-dependence (SQLite JDBC driver is a simple JNI wrapper over SQLite C++ native API). (SQLite JDBC driver has been installed and interfaced to Octopus (JDBC drivers are boycoted by LCG and the request for SQLite JDBC support has been refused).)
  7. Atlas TagDB: Support for type names with blanks. (Fixed in Octopus CVS and included.)
  8. Atlas TagDB: Support for Oracle Synonyms: Standard Octopus doesn't see Oracle Synonyms. (Fix has been made and fed to Octopus. (Indexes are unvisible for Synonyms.))
  9. Atlas GeometryDB: Skipping Oracle system tables.


HowTos

How To Install

  1. Install Java 1.5+ and Ant 1.5+. If you are on CERN AFS, you can use CERN Java Infrastructure by calling . /afs/cern.ch/sw/lcg/external/Java/bin/setup.sh
  2. Download Octopus and untar.
  3. Go to Octopus/lib/octopus, edit configure.properties to point to your Java home, run sh configure.
  4. Go to Octopus/ant.

How To Use



# Inside Octopus/ant,
# edit build.properties and map.properties to satisfy your requirements.
...

# Generate replication scripts.
# The work is being done in your Octopus/run directory.
# Octopus generates confguration files (top level one is LoaderJob.olj)
# and sql scripts (in sql subdiretory) to be used later for replication.
ant generate

# Replicate (create replica) using generated scripts.
ant load

# Do everything in one step (= clean, generate, load).
ant replicate

# Recompile Atlas modifications to Octopus.
# They are placed in src subdirectory and results in Octopus/lib/OctopusPatch.jar library.
# To do the recompilation, a User has to copy the whole OctopusReplicator package
# (not just its ant directory used to run).
# Other sources, which could be eventualy modified, can be downloaded
# from http://octopus.objectweb.org site and put into src directory.
ant patch

# Ask for help.
ant -projecthelp

Bugs/ToDos/Requests

Bugs:

ToDos:

Requests:


Release History


Presentations


J.Hrivnac, 11/Apr/2008 at 16:33:55 CEST