Showing posts with label Postgres. Show all posts
Showing posts with label Postgres. Show all posts

Monday, April 17, 2023

Migrating from Oracle 19c to Postgres



Migrating from Oracle 19c to Postgres involves a number of steps. Here's a rough outline of the process along with some commands you can use:

  1. Install Postgres on the target server.

  2. Create a new database in Postgres:

    createdb mynewdatabase
  3. Install the Ora2Pg tool on the source server:

    arduino
    sudo apt-get install ora2pg
  4. Generate the Ora2Pg configuration file:

    css
    ora2pg --init_project myproject
  5. Edit the configuration file to match your Oracle database:

    bash
    vi myproject/ora2pg.conf
  6. Convert the Oracle database schema to Postgres:

    bash
    ora2pg -t EXPORT_SCHEMA -c myproject/ora2pg.conf -o schema.sql
  7. Convert the Oracle database data to Postgres:

    bash
    ora2pg -t EXPORT -c myproject/ora2pg.conf -o data.sql
  8. Transfer the schema and data files to the target server.

  9. Load the schema and data into Postgres:

    graphql
    psql mynewdatabase < schema.sql psql mynewdatabase < data.sql
  10. Verify that the data has been migrated correctly.

  11. Update any application code that accesses the database to use Postgres instead of Oracle.

Note that this is a high-level overview and there may be additional steps or variations depending on the specific needs of your migration. It's also important to thoroughly test the new system before cutting over to it in production.



Looking forward for your suggestions.. please feel free to write to me.. Your help would definitely help to improve our blog. Chetan Yadav