My Oracle Support Banner

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

Last updated on AUGUST 04, 2018

Applies to:

Oracle Application Express (APEX) - 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';
 
apex_util.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

To view full details, 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 a vibrant support community of peers and Oracle experts.