Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  DMC - wich grants to use on a restricted Db2 DB

    Posted Thu August 24, 2023 04:56 AM

    Hi folks!

    Is there a sql grant script to grant all the needed rights to a technical user on a restricted Db2 DB? That means, there are no public grants at all in the system.

    The only DBAUTH right is connect grantet to a role where the technical user is assigned to. Also the technical user is not in one of the DBM SYS groups.

    If there is no script, where can I find the infromation, wich grants are needed?

    regards

    Joerg



    ------------------------------
    Jörg Burdorf
    ------------------------------


  • 2.  RE: DMC - wich grants to use on a restricted Db2 DB

    Posted Thu August 24, 2023 05:06 AM

    Hi Joerg,

    perhaps you find some useful script in <dmc_home>/dsutil/bin/pre_req_script directory

    grant_mondb_min.sh
    verify_mondb_min.sh

    Best regards,

    Joachim



    ------------------------------
    Joachim Müller
    ------------------------------



  • 3.  RE: DMC - wich grants to use on a restricted Db2 DB

    Posted Thu August 24, 2023 05:58 AM

    Hi Joachim!

    That look good to me. I'll try it out.

    Viele Grüße

    Jörg



    ------------------------------
    Jörg Burdorf
    ------------------------------



  • 4.  RE: DMC - wich grants to use on a restricted Db2 DB

    Posted Thu August 24, 2023 10:19 AM

    "all the needed rights" is a bit vague, but if you're looking for a broad set of permissions, here's a script that provides extensive rights (though it's crucial to adjust it based on your actual needs):

    -- Grant CONNECT privilege GRANT CONNECT ON DATABASE TO USER technical_user; -- Grant data access rights on all tables in a schema GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema_name TO USER technical_user; -- Grant rights to execute all stored procedures in a schema GRANT EXECUTE ON ALL PROCEDURES IN SCHEMA schema_name TO USER technical_user; -- Grant USAGE on all sequences in the schema GRANT USAGE ON ALL SEQUENCES IN SCHEMA schema_name TO USER technical_user; -- If the technical user needs to create objects (tables, indexes, etc.) GRANT CREATETAB, BINDADD, CREATE_NOT_FENCED, IMPLICIT_SCHEMA ON DATABASE TO USER technical_user; -- If the technical user needs administrative rights (use cautiously) -- GRANT DBADM ON DATABASE TO USER technical_user; COMMIT;


    ------------------------------
    Youssef Sbai Idrissi
    Software Engineer
    ------------------------------