I am getting the following error message (when trying to enable NOSQL
in DB2 10.5
, although I don't think that's really the issue):
Error code: -551 DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501,
SQLERRMC=DB2ADMIN;REPLACE FUNCTION; SYSTOOLS.JSON_VAL2, DRIVER=4.17.29An error occurred during database object creation, rolling back
The DB2ADMIN
user already has the following permissions:
grant DBADM, SECADM, ACCESSCTRL, DATAACCESS ON DATABASE TO USER db2admin
I cannot find the GRANT
command that I need to use to enable DB2ADMIN
to replace the function. Sorry, I'm not a DBA, so I just need the exact command I'd need to enter.
Best Answer
Apparently, whatever you are doing tries to
CREATE OR REPLACE
the functionSYSTOOLS.JSON_VAL2
. To replace any object the ID performing the operation must be the owner of that object, that is, the same ID that issued the very firstCREATE
statement.You have several options:
TRANSFER OWNERSHIP
statement to change the function owner.SECADM
can do that.SELECT OWNER FROM SYSCAT.ROUTINES WHERE ROUTINENAME = 'JSON_VAL2' AND ROUTINESCHEMA = 'SYSTOOLS'
) and perform your task while logged in as that user.DBADM
is sufficient, before performing your task.