tags:

views:

20

answers:

1

Hello,

I'd like to create event monitor on DB2 z/OS 9.2 i have spent a lot of time trying resolve this problem.

So i suggest this link: http://www.ibm.com/developerworks/data/library/techarticle/0303kolluru/0303kolluru.html

and trying to make this steps:

db2 => connect to dbname user username using password 
db2 => update monitor switches using statement on 
db2 => create event monitor rkmon for statements write to file '/tmp' 
db2 => set event monitor rkmon state=1 

but when I put command: create event monitor rkmon for statements write to file '/tmp' Db2 throw me an error:

"DB2ADMIN" does not have the privilege to perform operation "CREATE EVENT MONITOR".. SQLCODE=-552, SQLSTATE=42502, DRIVER=3.58.81

so, then i try add some privilege to my db2admin user:

grant DBADM to db2admin

but get another error:

The name "DBADM" cannot be used because the specified identifier is reserved for system use.. SQLCODE=-707, SQLSTATE=42939, DRIVER=3.58.81

Now, I don't have any idea what shoould i do to resolve this problem.

Maybe, there is some othere way to logs sql queries sends to my db2 ?

(I develop some java apps using hibernate and db2, and sometimes quickest way to resolve some problem is see what sql queries is send to db).

Any ideas ?

Thanks

A: 

I think the "ON DATABASE" clause is mandatory in the GRANT statement. Try:

grant DBADM on database to user db2admin
Leons
Good tip.I open command line and without connect to db trying grant privileges:
chris
But I got this error: `A database connection does not exist.`and this is logical, so I connect to my database with:`connect to mydatabase user db2admin password xxx`and then try grant, but db2 error is: `DB2ADMIN.MYDATABASE is an undefined name. SQLSTATE=42704`And this is also logical, i connected to database and be inside, therefore my database doesn't see this path.I have only one user, created when installed my db2. Any idea how to resolve this problem?
chris
Oops, I gave the LUW syntax. The DB2 for z/OS syntax is different. Try GRANT DBADM ON DATABASE mydatabase TO db2admin . http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db29.doc.sqlref/db2z_sql_grantdatabaseprivileges.htm
Leons