Link to home
Start Free TrialLog in
Avatar of Jim Youmans
Jim YoumansFlag for United States of America

asked on

DB2 Backups permissions

DB2 10.5 on Windows

OK, this is killing me.  It should be a simple thing but I have hit a wall and am not sure what is going on.  On my development database, I am issuing the following command.

db2 backup db Database1 online to z:\db2backups compress without prompting

Open in new window


But after a minute or so I get this.

The requested command or operation failed because the user ID does not have the authority to perform the requested command or operation:  User ID "MyUserID"

Open in new window


MyUserID should have SYSADM rights on that database.  It is a domain user and it is an Admin on the windows server.  So I don't understand what the issue is.  I also made sure MyUserID has full privileges on the Z: drive.  

How can I be sure MyUserID is SYSADM and what might I be missing?  This is really killing me because it should not be this hard to backup my db.  What am I doing wrong?  This works fine on my production server, but it uses a different user.

Thank you.

Jim
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Hi JIm,

This query should show you all users and their permissions:

SELECT * FROM SYSIBMADM.PRIVILEGES
 WHERE AUTHID = SESSION_USER AND AUTHIDTYPE = 'U'


Kent
Avatar of Jim Youmans

ASKER

When I run that I get 9,000 rows back.   They are all SELECT, ALTER, EXECUTE, DELETE, REFERENCE, etc .   What should I look for?
Oops.  :)

SELECT * FROM syscat.dbauth

The GRANTEE column is the user you want to query,   The DBADMAUTH column is administrator authority.

Kent
So when I run this query

SELECT * FROM syscat.dbauth
WHERE DBADMAUTH = 'Y' AND GRANTEE = 'MyUserID'
ORDER BY GRANTEE

Open in new window


There is one row returned where DBADMAUTH column has the value "Y".

So that user should have SysAdm rights and should be able to run the backup command, correct?

Jim
ASKER CERTIFIED SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Had to add the user and password to make it work.  Thank you so much!