The fenced user id exists for routines that are being created to run in fenced mode (outside of the DB2 address space). Very few people write such fenced routines.
- All SQL SP's and UDF's are "not fenced" (they run inside DB2 address space).
- C/C++ routines can be fenced or not fenced, at user option
- Java routines are always fenced.
Since almost all DB2 customers create SQL routines, the fenced id is rarely ever used. Therefore it can be shared among instances.
Some routines that are shipped with DB2 are written in C and are fenced (such as the administrative stored procedures), but since they are already created the fenced user id is not used.
Running a routine in fenced mode means it will be slower than if it ran in "not fenced" mode, but the advantage of fenced mode is that if there is a bug or memory addressing error in the routine, it will not crash DB2.