How we can Migrate Oracle Users, roles and grants to Azure PAAS postgresql database

Velmurugan 1 Reputation point
2022-03-23T09:47:00.04+00:00

Hi Team,

Can you kindly let us know how we can migrate the on-premise Oracle database Users, roles and grants to Azure PAAS PostgreSQL database. Currently we are using Ora2pg tool to migrate the schemas/data. Kindly provide us any document to migrate the oracle users, roles and grants to Azure PAAS PostgreSQL, that would be greatly appreciated.

Thanks,

Velmurugan

Azure Database for PostgreSQL
0 comments No comments
{count} votes

11 answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,552 Reputation points Microsoft Employee Moderator
    2022-03-23T15:59:15.463+00:00

    Hi, @Velmurugan Welcome to Microsoft Q&A, Thanks for posting your query.
    As we understand the ask here is you want to know how to migrate Oracle users, roles, and grants to the Azure PAAS PostgreSQL database and also looking for documents.

    Oracle users, roles, and grants to the Azure PAAS PostgreSQL database will be done automatically by ora2pg, if you use ./export_schema.sh it will export the whole schema together with roles and grants.

    you can refer to these documents Ora2pg Moves database to PostgresSQL, Oracle to Azure Database for PostgreSQL: Migration guide | Microsoft Learn

    Please let us know if this information helps.

    Regards
    Geetha


  2. Velmurugan 1 Reputation point
    2022-03-28T09:31:43.363+00:00

    HI GeethaThatipatri-MSFT,

    My configuration file looks different than what you have shared, In my config file grant means it is just showing as Export grants but in yours it is showing as Export roles converted to Pg groups, users and grants on all objects.

    Can you please let us know where we are missing here. PFB

    Type of export. Values can be the following keyword:

    TABLE Export tables, constraints, indexes, ...

    PACKAGE Export packages

    INSERT Export data from table as INSERT statement

    COPY Export data from table as COPY statement

    VIEW Export views

    GRANT Export grants

    SEQUENCE Export sequences

    TRIGGER Export triggers

    FUNCTION Export functions

    PROCEDURE Export procedures

    TABLESPACE Export tablespace (PostgreSQL >= 8 only)

    TYPE Export user defined Oracle types

    PARTITION Export range or list partition (PostgreSQL >= v8.4)

    FDW Export table as foreign data wrapper tables

    MVIEW Export materialized view as snapshot refresh view

    QUERY Convert Oracle SQL queries from a file.

    KETTLE Generate XML ktr template files to be used by Kettle.

    DBLINK Generate oracle foreign data wrapper server to use as dblink.

    SYNONYM Export Oracle's synonyms as views on other schema's objects.

    DIRECTORY Export Oracle's directories as external_file extension objects.

    LOAD Dispatch a list of queries over multiple PostgreSQl connections.

    TEST perform a diff between Oracle and PostgreSQL database.

    TEST_COUNT perform only a row count between Oracle and PostgreSQL tables.

    TEST_VIEW perform a count on both side of number of rows returned by views

    TEST_DATA perform data validation check on rows at both sides.

    TYPE TABLE,COPY,VIEW,GRANT,SEQUENCE,TRIGGER,PROCEDURE


  3. GeethaThatipatri-MSFT 29,552 Reputation points Microsoft Employee Moderator
    2022-03-29T11:48:12.29+00:00

    Hi @Velmurugan , I have updated the 187840-oracle-to-postgres.txt step-by-step instructions in the attached document please follow the instructions and let us know if you have any further queries.
    Happy to assist you to resolve your issue.

    Regards
    Geetha`

    0 comments No comments

  4. Velmurugan 1 Reputation point
    2022-03-30T07:59:43.247+00:00

    Hi @GeethaThatipatri-MSFT

    I have tried the document which you have provided but in vain. I'm attaching the config file and grants file which generated for your reference.

    188278-ora2pg-conf.txt

    Grants output: (not able to attach more than one attachement, so pasting it)

    [root@databasepocserverrep grants]# cat grant.sql
    -- Generated by Ora2Pg, the Oracle database Schema converter, version 23.0
    -- Copyright 2000-2021 Gilles DAROLD. All rights reserved.
    -- DATASOURCE: dbi:Oracle:host=databasepocserver;sid=orapgdb;port=1521

    SET client_encoding TO 'UTF8';

    \set ON_ERROR_STOP ON

    -- Nothing found of type GRANT

    [root@databasepocserverrep grants]#

    0 comments No comments

  5. Velmurugan 1 Reputation point
    2022-03-30T08:01:49.16+00:00

    @GeethaThatipatri-MSFT

    188279-type-output.png

    Still I didn't receive the answer why my config file type is looking different than yours? if you look at the attachment, grans are showing just export grants.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.