Results 1 to 5 of 5
  1. #1
    Join Date
    May 2013
    Posts
    25

    Unanswered: Run db2 commands as root on AIX

    I mainly want this in order to simplify some scripting operations.

    I have ran the instance user profile on root (. /blahblah/sqllib/db2profile) and I can run commands like listing db directory etc succesfully. But I cannot run commands like deactivate for example.

    What I get is:
    SQL1092N "ROOT" does not have the authority to perform the requested command
    or operation.
    Any help?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Root has no special powers with respect to the DB2 authorizations or object and command privileges. If you insist on running certain commands as root, you will have to grant root appropriate privileges and permissions. A better idea though would be to use the appropriate non-root user, e.g. the instance owner, to perform DB2-related tasks using "su -c".
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    In your script do this beforehand:
    su - blahblah

    Or put root in one of the group authorities like db2maint, etc (check the manual for authority level required).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    May 2013
    Posts
    25
    Quote Originally Posted by n_i View Post
    A better idea though would be to use the appropriate non-root user, e.g. the instance owner, to perform DB2-related tasks using "su -c".
    I am already doing that (running commands with su - user -c) but it's not so versatile if you want to run many commands which -most of the times- occupy more than one line.

    Quote Originally Posted by Marcus_A View Post
    Or put root in one of the group authorities like db2maint, etc (check the manual for authority level required).
    That's what I did. I placed root to the db2inst group. Now everything works

    Thanks for the replies guys

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    not the best way - you can always create a new user and create for this user a db2 client instance
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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