Knowledge Center / Oracle to PostgreSQL

From translation output to production

Life after Cortex

The Last Mile turns Cortex output into an accepted, running PostgreSQL database. It covers development setup, testing and acceptance, production cutover, and data migration choices.

Last Mile as part of our overall approach Picture 1: Last Mile as part of our overall approach

The last mile

We are at the point where Cortex has done its job and everything used and produced in Cortex is made available outside Cortex. This is the point where we leave Cortex behind and move on to the so-called Last Mile.

Cortex output and different Last Mile phases as part of our overall approach Picture 2: Cortex output and different Last Mile phases as part of our overall approach

What is available outside of Cortex after export?

Once Cortex has completed its task and everything has been exported “outside” the Cortex environment, a GIT repo will be available that contains

  • the Oracle references,
  • the objects transformed to PostgreSQL,
  • all reports as produced by Cortex,
  • the population files for Jira and Azure DevOps, and
  • the dump of the database translated to PostgreSQL.

What does Last Mile stand for?

In the Last Mile, there are a number of phases to ultimately arrive at a working PostgreSQL database that is accepted by the end user.

Development phase

Based on the output from Cortex, a development environment must be set up in which the GIT repo and the Jira or DevOps environment are initiated and a PostgreSQL database is built.

Once the environments are ready, the intention is that all issues and tasks (available in Jira or DevOps) are resolved or executed. Engineers should do this with expertise in both Oracle and PostgreSQL.

Once all issues and tasks have been resolved/processed, testing of the PostgreSQL database can begin. Of course, attention must also be paid to the application, which still needs to be made compatible with PostgreSQL. Keep this in mind when initiating the Oracle to PostgreSQL migration project.

Test / Acceptance test phase(s)

An environment must be set up in which a PostgreSQL database comes available that is “filled” with the content of the PostgreSQL database created in development. In addition, the application that has been made suitable for PostgreSQL must be made available.

Once the PostgreSQL database and the application are available, the PostgreSQL database must be loaded with test data. Normally, this test data is available in an Oracle database. Splendid Data provides scripting that can be used to transfer this test data from Oracle to PostgreSQL.

Of course, there are also solutions available on the market for migrating data from an Oracle database to PostgreSQL. The choice is yours as to which you want to use. Findings during testing (including acceptance/performance tests) are recorded in Jira or DevOps and then resolved. Our advice is to use the migration_syncher to keep the PostgreSQL database structurally in sync with the GIT repository so that it is up to date and reflects “the single source of truth”.

Cutover phase

The previous phase has been successfully completed. The user has accepted the to PostgreSQL migrated database and the associated application. Now the production environment can be set up.

The setup of the production environment depends entirely on how and where the deployment is to take place. PostgreSQL is open source and gives you complete freedom to decide for yourself whether to deploy in the cloud, managed or unmanaged, on-premise, on bare metal infrastructure, virtualized, etc.

An important part of the cutover phase is the migration of production data stored in Oracle to the PostgreSQL database. This is a subject in itself. In fact, the storage structures in PostgreSQL are (almost) identical to those in Oracle, and mapping them is relatively simple. What is more important is how much data is involved and how much downtime is available during cutover. Our advice is to use a solution that fits the situation.

Suppose the Oracle database contains 2TB of data and the available downtime is 1 hour. In that case, it is best to use a solution that supports Change Data Capture (CDC) to minimize downtime. There are even solutions on the market that, once the cutover from Oracle to PostgreSQL has been completed, are able to keep the Oracle database in sync with the PostgreSQL database for a period of time.

FAQs about Life after Cortex

Is there any documentation available for Last Mile?

We have a document called “Life after Cortex” that describes what needs to be done to set up the various environments (such as development, testing, Jira/DevOps, etc.).

Why do engineers need to have knowledge of both Oracle and PostgreSQL?

Oracle and PostgreSQL have a lot in common, but there are also differences. In addition, there are multiple ways to program the business logic (functions, procedures etc.) in Oracle, and this also applies to PostgreSQL. As a result, Cortex may not be able to translate everything within the given context. Anything that Cortex cannot translate syntactically / semantically correct needs to be adjusted manually.

That is why Jira or DevOps is used for issue management. If Cortex cannot resolve something, an issue is created that refers to the relevant Oracle object (e.g., a function) and the object migrated to PostgreSQL, and provides instructions on what is wrong.

An engineer with knowledge of both Oracle and PostgreSQL will quickly recognize what is wrong and what needs to be adjusted so that the object migrated to PostgreSQL is syntactically and semantically correct for PostgreSQL.

Why is it good to keep the GIT repo in sync?

The GIT repo contains the truth when it comes to code (functions, procedures, views, etc.) and the versions of the code.

It is therefore important, especially when multiple engineers are working on issues, which often means that the code is being modified, to use something like a GIT repo, but also a mechanism that keeps the GIT repo in sync with the PostgreSQL database(s).

By using a structured approach in combination with tools that support this approach, you remain in control of everything that needs to be done (resolving issues and performing tasks) during the Last Mile.