The db2 internally compile and bind the SQL procedure into a package and it
uses /files/db2/db2inst1/sqllib/function/routine/sqlproc/<database_name>/<schema_name> under that you will also see a tmp directory and a file sr_path.
DB2 need to access that directory, I think the fence user. you should check the privilige, either grant it directly or put the fence user under the group owner of that directory. Check the security issue.