Wednesday 27 June 2018

Change the Apex user password using SQL and  apxchpwd.sql


If you have the APEX software available you can use the "apxchpwd.sql" script. Change to the directory with the APEX software, connect to SQL*Plus as the SYS user and run the "apxchpwd.sql" script, specifying the credentials when prompted.
SQL> CONN sys@pdb1 AS SYSDBA
SQL> @apxchpwd.sql

Using SQL

Change the current schema to the one relevant for your APEX version and find the admin user in the WWV_FLOW_FND_USER table.
ALTER SESSION SET CURRENT_SCHEMA = APEX_050100;

COLUMN user_id Format 99999999999999999
COLUMN first_name FORMAT A20
COLUMN last_name FORMAT A20
COLUMN default_schema FORMAT A30

SELECT user_id,
       first_name,
       last_name,
       default_schema
FROM   wwv_flow_fnd_user
WHERE  user_name = 'ADMIN'
ORDER BY last_update_date DESC;

           USER_ID FIRST_NAME           LAST_NAME            DEFAULT_SCHEMA
------------------ -------------------- -------------------- ------------------------------
  1830220964288167                                           APEX_050100

SQL>
Update the password in the user record you found previously.

UPDATE wwv_flow_fnd_user
SET    web_password = 'ApexPassword1'
WHERE  user_name = 'ADMIN'
AND    user_id = 1830220964288167;

COMMIT;

No comments:

Post a Comment