If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2profile issue with rights

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-12, 02:32
junaid377 junaid377 is offline
Registered User
 
Join Date: Jan 2012
Posts: 52
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.
Reply With Quote
  #2 (permalink)  
Old 04-19-12, 02:50
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,482
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
Reply With Quote
  #3 (permalink)  
Old 04-19-12, 03:24
junaid377 junaid377 is offline
Registered User
 
Join Date: Jan 2012
Posts: 52
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
Reply With Quote
  #4 (permalink)  
Old 04-19-12, 03:38
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,482
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
Reply With Quote
  #5 (permalink)  
Old 04-19-12, 03:44
junaid377 junaid377 is offline
Registered User
 
Join Date: Jan 2012
Posts: 52
it is already set to that group but the group privileges are not given in the permission so can't do anything
Reply With Quote
  #6 (permalink)  
Old 04-19-12, 03:52
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,482
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On