Tutorial 3: Migrate Directly to PostgreSQL
Now we know how to create ETL files, the next step is to migrate the schema from Oracle directly to PostgreSQL.
Use the
base.pypython script in thetutorialfolder.Modify the constant values as in step 2.
The
ETL_FILES,ORACLE_INSTANT_CLIENTand Oracle connection constants should all be given the same values as in Tutorial step 2.Modify the PostgreSQL connection constants, adding the specific server host details.
... PGSSCHEMA = 'scott' PGSDBASE = 'easyo2p_db' PGSUSER = 'easyo2p_user' PGSPASS = 'easyo2p_pwd' PGSPORT = '5432' PGSHOST = '<specific host>' ...
Run the script.
Run the script in the same as before. This time the scott schema will be created in PostgreSQL as well as the ETL scripts.
Note
If you wished to prevent the scripts being created, add the
ETL_FILESelement to the parameters dictionary in the modifiedbase.pyscript.... parameters = { easyo2p.ETL_FILES: False, ...
We should now understand how to use easyo2p to migrate an Oracle schema to PostgreSQL,
either directly or using ETL scripts.