prosync
prosync — utility to replay changes to a source database on a destination database of a different type
Synopsis
prosync config generate [option...]
prosync init [option...]
prosync run [option...]
prosync complete [option...]
Description #
prosync is a utility to perform the change data capture (CDC) of a source database and replay the changes on a destination database of a different type.
prosync is not responsible for:
Database schema transfer.
Transferring data that is missing from log files.
Data verification after the data transfer.
Supported Operations #
DML:
INSERT,UPDATE,DELETEDDL:
TRUNCATE
Usage #
Migrating the Database #
prosync participates in the hot DB migration (see Section 4.5 for more details).
Preparing for a Migration of a Hot DB #
To prepare for the migration of a hot DB, perform the following steps:
Prepare and set up the destination DB for the migration:
Create the necessary schemas and tables.
Remove or turn off triggers.
Generate the configuration file:
prosync config generate -o
filenameUpdate the configuration file with appropriate values.
Get
CURRENT_SCNfrom the source DB and updateprosync_options.start_scnin the configuration file accordingly:prosync init -f
filename-uThe
-uoption will do it automatically, but it makes sense to double-check that the value in the configuration file is the same as the value on the screen.
Performing the Migration of a Hot DB #
Perform the migration as follows:
Launch the procopy load:
procopy load -f
filenameWhen it finishes, launch the prosync replay of changes:
prosync run -f
filenameWait until the difference between
Parsing SCNandOracle latest SCNdecreases to an admissible value. For the migration of a hot DB, it is critical for this difference to decrease:Parsing SCN 3671057 Oracle latest SCN 4995972
Disable the load on the source DB and wait until
Parsing SCNandOracle latest SCNvirtually stop changing. Stop prosync.Note
Changes always occur in Oracle even if nobody changes the data, so
Oracle latest SCNis continuously growing. Therefore, the difference betweenParsing SCNandOracle latest SCNnever reaches zero.
Excluding Columns from Tasks of the Table Type #
When executing tasks of the TABLE type (see the section called “Types of Tasks” for details) during data migration involving prosync, do not exclude (through exclude_columns or include_columns) columns that are used by LogMiner as a row key. Otherwise, executing DELETE or UPDATE commands can change more than one row.
For tables without keys (heap), do not exclude any columns as LogMiner uses the whole row for identification.
Note
These rules do not apply for data migrations that are only performed by procopy.
Notes for PostgreSQL/Postgres Pro Sources #
When migrating the PostgreSQL/Postgres Pro DB, a replication slot is needed for running prosync replay of changes. Therefore:
Command-Line Reference #
This section describes prosync commands. Optional parameters are enclosed in square brackets.
config generate #
prosync config generate [-f|--formatjson|yaml] [-o|--outputfilename] [-c|--source_config]
Generates a prosync configuration file.
-fjson|yaml--formatjson|yamlSpecifies the format of the configuration file: JSON or YAML. The default is YAML.
-ofilename--outputfilenameSpecifies the filename of the configuration file. By default, the configuration file will be output to stdout.
-c--source-configUse the procopy configuration file as the basis of the prosync configuration file and add missing options there.
init #
prosync init -f|--file filename [-u|--update-config]
Gets the current SCN from the source database.
-ffilename--filefilenameName of the configuration file, where the connection options are specified.
-u--update-configUse the procopy configuration file as the basis and add missing options there.
run #
prosync run -f|--filefilename[--log-levelerror|warn|info|debug] [--dry-run|--read-only] [-c|--clear] [--with-table-stats]
Launches the replay of changes to the source DB on the destination DB.
If the value of prosync_options.start_scn in the configuration file is less than that of the oldest accessible log file in the source DB, the command outputs an error message that contains the minimum accessible scn.
-ffilename--filefilenameName of the configuration file, where the connection options are specified.
--log-levelerror|warn|info|debugLogging level. The default is
info.--dry-runTurns off writing to the destination. prosync will perform all the operations except writing. This flag is useful for checking the performance of writing.
--read-onlyTurns off all the prosync logic except reading from the source. This flag is useful for checking the performance of reading.
-c--clearClear the screen before each next output of the statistics. When enabled, it is recommended to output logs to a file, as follows:
prosync run ... -c 2>prosync.log
--with-table-statsOutput the extended statistics on tables.