Results 1 to 8 of 8

Thread: Db2 Roles

  1. #1
    Join Date
    Dec 2007
    Posts
    49

    Unanswered: Db2 Roles

    Can I Create a ROLE in DB2 with a validity as in PostgreSQL

    Here is the CREATE role syntax in PostGreSQL

    CREATE ROLE XX LOGIN PASSWORD 'xxx'
    NOINHERIT CREATEDB CREATEROLE
    VALID UNTIL 'infinity';

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Roles have been implemented in DB2 V9.5 which was recently released.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Dec 2007
    Posts
    49
    Hi Marcus

    Thanks alot for the reply

    I am using IBM UDB DB2 9.1 version. Please let me know if i can create only in 9.5 version? If it is so , can you please let me know from where i can Download it ?

    And I am trying to create role in my local system. I am not connected to anyt server. Is it so that i need SYSADM and SYSCTRL authorities.

    I was issuing the comand as CREATE ROLE {ROLENAME}

    I have one more question as

    In PosteGreSQL I was issuing the command as

    CREATE ROLE ROLE2 LOGIN PASSWORD 'XXX'
    INHERIT
    VALID UNTIL 'infinity'
    IN ROLE ROLE1;

    So even in UDB DB2 as well can i create one role in another role ?

    My Criteria is i am migrating my .NET application DB from PostgreSQL to IBM UDB Db2. I faced this ROLES problem

    Thanks in Anticipation

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Check out the SQL Reference Vol 2 manual for DB2 9.5.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Dec 2007
    Posts
    49

    Post

    Hi I installed Db2 9.5 on my system and trying to create the ROLE in the local database it gives me an error saying :

    ------------------------------ Commands Entered ------------------------------
    CREATE ROLE ROLE1;
    ------------------------------------------------------------------------------
    CREATE ROLE ROLE1
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0552N "ADMINISTRATOR" does not have the privilege to perform operation
    "CREATE ROLE". SQLSTATE=42502

    SQL0552N "ADMINISTRATOR" does not have the privilege to perform operation "CREATE ROLE ".

    How can i check the Privileges of administrator ?
    Can i grant the privilege of Creating ROLE SECADM authority to administrator?

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    To determine your authorizations you have, run the GET AUTHORIZATIONS command.

    SECADM is an authorization - not a privileges. (Privileges are for database objects.)
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  7. #7
    Join Date
    Dec 2007
    Posts
    49
    Where does the roles which are created will be listed in the Control center. I dont find them in Tree view listing of control view.

    Can someone please let me know

  8. #8
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You can query the catalog view SYSCAT.ROLES directly.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •