I have as my developer station a laptop with OS Windows XP Professional Edition, Service Pack 3.
I have downloaded and installed IBM DB2 UDB 9.7 fix pack 4, of the Express-C edition.
I have a local Windows account called db2admin that I am using as my local database administrator for my local install of DB2 (developer purposes only).
I can run the following without issues when running the Command Window:
db2 attach to db2 user db2admin using xxxxxxxxxx
That allows me to attach to my instance called DB2.
I can run my create database commands.
I then attempt to connect to the database to grant all privileges for my db2admin account in DB2.
db2 CONNECT TO MYDB;
SET SCHEMA DB2ADMIN;
db2 GRANT DBADM,CREATETAB,BINDADD,CONNECT,CREATE_NOT_FENCED_ROUTINE,IMPLICIT_SCHEMA,LOAD,CREATE_EXTERNAL_ROUTINE,QUIESCE_CONNECT,SECADM ON DATABASE TO USER DB2ADMIN;
CONNECT RESET;
However when I run that, it DB2 tells me that my actual windows user account (synprgcma) does not have authority to grant authority to user db2admin.
So if I change the second script to the following:
db2 CONNECT TO MYDB USER db2admin USING xxxxxxxx;
SET SCHEMA DB2ADMIN;
db2 GRANT DBADM,CREATETAB,BINDADD,CONNECT,CREATE_NOT_FENCED_ROUTINE,IMPLICIT_SCHEMA,LOAD,CREATE_EXTERNAL_ROUTINE,QUIESCE_CONNECT,SECADM ON DATABASE TO USER DB2ADMIN;
CONNECT RESET;
Then DB2 tells me that db2admin cannot revoke or grant authority to itself (actually it tells me that an id cannot revoke or grant authority to itself).
So I am stumped. I did not have this problem with my previous install of DB2 (9.5, and I don't remember which fix pack I was at).
How do I grant the necessary authorities to the local admin account? I believe I need this in order to run a bind command that I need to do next:
db2 CONNECT TO MYDB;
db2 bind @db2cli.lst blocking all grant public sqlerror continue CLIPKG 20;
db2 CONNECT RESET;
Any help would be appreciated.
Edit: I've found some of the following links related to this. Still not sure yet how to get it working, but at least I've found some documentation.
- http://www.db2teamblog.com/2009/06/whats-new-in-db2-97.html
- http://lpetr.org/blog/archives/simplify-the-db2-9-7-security-model
- http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.ref.doc%2Fdoc%2Fr0000958.html
- http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14288459
- http://publib.boulder.ibm.com/infocenter/tivihelp/v4r1/index.jsp?topic=%2Fcom.ibm.tpc_V422.doc%2Ffqz0_t_preparing_to_install_db2_windows.html
- http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.sec.doc%2Fdoc%2Fc0055206.html
- http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.sec.doc%2Fdoc%2Fc0005479.html