Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Location
    Atlanta GA, USA
    Posts
    9

    Unanswered: How to Disable login during End Of Day?

    Hello, All,

    Is there a way to stop DB2 from accepting connection request? I would like to do this during certain part of an End Of Day process that I am running.

    Also, does anyone have a clever way of knocking users off that may have attached in an inopportune time?

    Thanks for your help.

    BTW, I am running DB2 7.2.8 EE and some clients on 8.x UDB. All installations are Windows.

    William

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    William,

    To knock off the users:

    db2 force applications all

    To prevent further connections:

    for each group you want to prevent:
    REVOKE CONNECT ON DATABASE FOR GROUP myGroup BY ALL

    When you are ready to let them connect again:

    GRANT CONNECT ON DATABASE TO GROUP myGroup

    HTH

    Andy

  3. #3
    Join Date
    Aug 2003
    Location
    Atlanta GA, USA
    Posts
    9
    Thanks, Andy. That sounds like that will do it.

    Originally posted by ARWinner
    William,

    To knock off the users:

    db2 force applications all

    To prevent further connections:

    for each group you want to prevent:
    REVOKE CONNECT ON DATABASE FOR GROUP myGroup BY ALL

    When you are ready to let them connect again:

    GRANT CONNECT ON DATABASE TO GROUP myGroup

    HTH

    Andy

  4. #4
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    35
    A way to implement this and make sure that it keep updated (especially in the case you have many GROUP or USER) would be to implement in a script the results of the following sql:

    -- For the groups

    select 'REVOKE CONNECT ON DATABASE FROM GROUP' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'G'
    and GRANTEE NOT IN ('<listofgroup>' , ... ); -- not to revoke

    select 'GRANT CONNECT ON DATABASE TO GROUP ' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'G'
    and GRANTEE NOT IN ('<listofgroup>' , ... ); -- not to revoke


    -- For the users

    select 'REVOKE CONNECT ON DATABASE FROM USER' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'U'
    and GRANTEE NOT IN ('<listofuser>' , ... ); -- group not to revoke

    select 'GRANT CONNECT ON DATABASE TO USER ' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'U'
    and GRANTEE NOT IN ('<listofuser>' , ... ); -- user not to revoke

  5. #5
    Join Date
    Aug 2003
    Location
    Atlanta GA, USA
    Posts
    9
    Thanks for the information. I will give that a try.

    Originally posted by dlafreni
    A way to implement this and make sure that it keep updated (especially in the case you have many GROUP or USER) would be to implement in a script the results of the following sql:

    -- For the groups

    select 'REVOKE CONNECT ON DATABASE FROM GROUP' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'G'
    and GRANTEE NOT IN ('<listofgroup>' , ... ); -- not to revoke

    select 'GRANT CONNECT ON DATABASE TO GROUP ' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'G'
    and GRANTEE NOT IN ('<listofgroup>' , ... ); -- not to revoke


    -- For the users

    select 'REVOKE CONNECT ON DATABASE FROM USER' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'U'
    and GRANTEE NOT IN ('<listofuser>' , ... ); -- group not to revoke

    select 'GRANT CONNECT ON DATABASE TO USER ' || grantee || ';'
    from SYSCAT.DBAUTH
    where GRANTEETYPE = 'U'
    and GRANTEE NOT IN ('<listofuser>' , ... ); -- user not to revoke

Posting Permissions

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