After Upgrade 11.2.0.4.4 ORA-01031 DBMS_UTILITY.get_parameter_value (Doc ID 1939079.1)

Last updated on NOVEMBER 14, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.

Symptoms

On : 11.2.0.4 version, Database Security

When attempting to use DBMS_UTILITY.get_parameter_value ('db_name', intval, db_name);
the following error occurs.

ERROR
-----------------------
ORA-01031: insufficient privileges

STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. sqlplus / as sysdba

2 create user MARC identified by "pippo123!" quota unlimited on USERS ;

CREATE or replace FUNCTION "MARC"."F_GET_USER_SERVICE_NAME" (A_USER VARCHAR2 DEFAULT USER)
RETURN VARCHAR2 IS
intval BINARY_INTEGER;
partyp BINARY_INTEGER;
returnparm VARCHAR2 (255);
db_name VARCHAR2 (30);
db_domain VARCHAR2 (255);
BEGIN
partyp := DBMS_UTILITY.get_parameter_value ('db_name', intval, db_name);
partyp := DBMS_UTILITY.get_parameter_value ('db_domain', intval, db_domain);
returnparm := A_USER || '.' || db_name;

IF db_domain IS NOT NULL THEN
returnparm := returnparm || '.' || db_domain;
END IF;

RETURN returnparm;
END f_get_user_service_name;
/


3) select MARC.F_GET_USER_SERVICE_NAME from dual;
      *
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_UTILITY", line 140
ORA-06512: at "MARC.F_GET_USER_SERVICE_NAME", line 16
ORA-06512: at line 1

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms