Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2012
    Posts
    82

    Unanswered: db2profile issue with rights

    I have a db2 9.5 running on a linux server. I have created a new user for my self and given it sysadm role.

    The problem I am facing is that when I log into terminal I need to run the db2profile to get the db2 environment set.
    . /home/db2inst1/sqllib/db2profile

    The problem with this is when I execute a command the computer thinks the command is executed by db2inst1. for example when I take a backup the backup created has db2inst1 as its owner and only db2inst1 has the rights on it. Is there a way to enable the db2profile that any thing created by me has me as the owner.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by junaid377 View Post
    I have a db2 9.5 running on a linux server. I have created a new user for my self and given it sysadm role.

    The problem I am facing is that when I log into terminal I need to run the db2profile to get the db2 environment set.
    . /home/db2inst1/sqllib/db2profile

    The problem with this is when I execute a command the computer thinks the command is executed by db2inst1. for example when I take a backup the backup created has db2inst1 as its owner and only db2inst1 has the rights on it. Is there a way to enable the db2profile that any thing created by me has me as the owner.
    When you say only instance owner has rights to it, exactly what kind of rights are you looking for?

    You could set the primary group of your new id to the same primary group as the instance owner primary group (usually something like db2iadm), and that should give some authorities to the backup files, but not sure what you need.
    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
    Jan 2012
    Posts
    82
    I meant file rights.. in the linux environment. the issue is that I created a backup a db because i have to move it on to a different server. When I invoke the db2profile the backup being created doesn't have my user id as its owner. It has db2inst1 as its owner. So i can't do anything to the backup file because I don't have the rights.
    here is the output of ls -l on that file

    -rw------- 1 db2inst1 db2iadm1 Test.0.db2inst1.NODE0000.CATN0000.20120418144207.0 01

    as you can see the file has db2inst1 as its owner where it was created using my own user name. but when I invoke db2profile.. all the files created weather backups or datadump are created but owned by db2inst1

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by junaid377 View Post
    I meant file rights.. in the linux environment. the issue is that I created a backup a db because i have to move it on to a different server. When I invoke the db2profile the backup being created doesn't have my user id as its owner. It has db2inst1 as its owner. So i can't do anything to the backup file because I don't have the rights.
    here is the output of ls -l on that file

    -rw------- 1 db2inst1 db2iadm1 Test.0.db2inst1.NODE0000.CATN0000.20120418144207.0 01

    as you can see the file has db2inst1 as its owner where it was created using my own user name. but when I invoke db2profile.. all the files created weather backups or datadump are created but owned by db2inst1
    I don't think there is anything you do about ownership of backup files. What you can do, as I mentioned in my post above, is change the primary Linux group to db2iadm1 for your new user and see if that works. I admit that db2iadm1 does not seem to have any rights to your file above, but if you create the backup with your id set to the correct group it may work OK.
    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
    Jan 2012
    Posts
    82
    it is already set to that group but the group privileges are not given in the permission so can't do anything

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by junaid377 View Post
    it is already set to that group but the group privileges are not given in the permission so can't do anything
    I am not sure it has to do with db2profile. I think instance owner owns backups for the instance. You could run a cronjob every so often to change the permissions of the the backup directory, recurcive to all files underneath the directory.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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