ORA-20987 Error When Using APEX_UTIL.create_user In APEX5 (Doc ID 2210311.1)

Last updated on DECEMBER 05, 2016

Applies to:

Oracle Application Express (formerly HTML DB) - Version 5.0.4.00.12 and later
Information in this document applies to any platform.

Symptoms

On 5.0.4.00.12 version, Administration

When attempting to use APEX_UTIL.create_user that changes apex users (like reset pwd) the following error occurs:

ERROR
-----------------------
ORA-20987: APEX - User requires ADMIN privilege to perform this operation. - Contact your application administrator.

STEPS
-----------------------
The issue can be reproduced with the following steps:

1. From APEX GUI sql*workshop execute something like:
  create or replace PROCEDURE "USER_RESET_PW" (ps_username VARCHAR2) AS
pragma AUTONOMOUS_TRANSACTION;
BEGIN
 SELECT workspace_id
 INTO n_security_group
 FROM apex_workspaces
 WHERE workspace = 'my_worspace_name';
 
wwv_flow_api.set_security_group_id(n_security_group );

--Unlock account
--apex_util.UNLOCK_ACCOUNT(ps_user_name);

....
pn_user_id := apex_util.get_user_id (UPPER(ps_username));


-- Fetch user information from
-- wwv_flow_fnd_user, wwv_flow_fnd_group_users and wwv_flow_developers table.
apex_util.fetch_user ( ....)
...

2. Get the error:

ORA-20987: APEX - User requires ADMIN privilege to perform this operation. - Contact your application administrator.

BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot change anymore apex users unless the user connected is an Administrator

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