Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: Privileges for SET PASSTHRU

    Hi,

    I have a question regarding PASSTHRU.
    My sysadm is user1 & using this I can issue the below command directly

    SET PASSTHRU SAMPLE;
    ALTER TABLE SAMPLE.User1.EMPLOYEE ADD COLUMN KID INTEGER NOT NULL WITH DEFAULT 0 ;
    SET PASSTHRU RESET;

    Now I have added one more user as user2 to my sysadm_group . But I can't able to issue the same command from the User2.
    I am unable to run SET PASSTHRU from User2.

    Can some one let me know, what are the privileges required to run the SET PASSTHRU command.

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    The answer is here (under the Authorisation section):
    http://www-01.ibm.com/support/knowle...-7-228&lang=en

  3. #3
    Join Date
    Jul 2014
    Posts
    294
    Thanks for the reply. I think i have to grant the passthru session. Below is my code, which is working with user1 & throwing an error with user2.


    error:
    DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=MEY7;ALTER TABLE;VRT.DC3_TEST, DRIVER=4.17.30
    Run of routine failed.
    - Roll back completed successfully.

    Kindly let me know what should i need to change here to grant passthru privilge for user2.
    Last edited by HABBIE; 01-22-15 at 08:23.

  4. #4
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    SQLCODE=-551
    SQLERRMC=MEY7;ALTER TABLE;VRT.DC3_TEST

    That -551 can be expressed as SQL0551N.
    The SQLERRMC tells us that a user MEY7 does not have ALTER TABLE permission on VRT.DC3_TEST

    In the command line you can type this (or you can lookup SQL0551N in the on-line docs for your db2 version)

    db2 "? SQL0551N"


    SQL0551N "<authorization-ID>" does not have the required authorization
    or privilege to perform operation "<operation>" on object
    "<object-name>"....
    ...snip lots of other information

    You need to ensure that the user has the correct rights on the object .

  5. #5
    Join Date
    Jul 2014
    Posts
    294
    thanks for the reply.
    User is trying to alter a federated table using passthru session which is failing.
    In my procedure , i want to grant the passthru session to the second user. How should I go with this.
    How to grant PASSTHRU privilege to the second user .

    Apart from SYSADm, how can i grant PASSTHRU role to a user in db2luw on windows?
    Last edited by HABBIE; 01-21-15 at 11:09.

Tags for this Thread

Posting Permissions

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