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
Jim YoumansSr Database AdministratorAsked:
Who is Participating?
 
Kent OlsenData Warehouse Architect / DBACommented:
Correct.

DB2 defaults to OS authentication, so the username that you used to connect to the server should be the one in play.

You might include the user authentication on the command line, at least for a test

 
db2 backup db Database1 USER MyUserID USING MyUserPW online to z:\db2backups compress without prompting

Open in new window


Kent
0
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi JIm,

This query should show you all users and their permissions:

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


Kent
0
 
Jim YoumansSr Database AdministratorAuthor Commented:
When I run that I get 9,000 rows back.   They are all SELECT, ALTER, EXECUTE, DELETE, REFERENCE, etc .   What should I look for?
0
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
Kent OlsenData Warehouse Architect / DBACommented:
Oops.  :)

SELECT * FROM syscat.dbauth

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

Kent
0
 
Jim YoumansSr Database AdministratorAuthor Commented:
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
0
 
Jim YoumansSr Database AdministratorAuthor Commented:
Had to add the user and password to make it work.  Thank you so much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.