Got an "ORA-06502: numeric or value error" during installation of APEX 2.2.x?

I ran into this Oracle APEX installation problem a few months ago and just got a call from one of our customers hitting the same problem. So I thought it might be a good idea to share the reason and the workaround for that problem.

Does your installation log files contain the following errors?

Error creating button name="REFRESH" id="181590632003554484" ORA-06502: PL/SQL:
numeric or value error: character string buffer too small
ORA-06512: at
"FLOWS_020200.WWV_BIU_STEP_BUTTONS", line 24
ORA-04088: error during execution

or

Error page=190 item="F4000_P190_QUICKPICK" id="5224728991502726"
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 323
ORA-06512: at "SYS.HTP", line 860
ORA-06512: at "SYS.HTP", line 975
ORA-06512: at "SYS.HTP", line 993
ORA-06512: at "FLOWS_020200.WWV_FLOW_API", line 4005
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "FLOWS_020200.WWV_BIU_STEP_ITEMS", line 63
ORA-04088: error during execution of trigger 'FLOWS_020200.WWV_BIU_STEP_ITEMS'
ORA-06512: at line 4

I’m pretty sure that your database parameter NLS_LENGTH_SEMANTICS is set to CHAR.

Workaround

In your SQL*Plus session execute

ALTER SESSION SET NLS_LENGTH_SEMANTICS=BYTE;

before you run the APEX installation scripts.

See also the related OTN thread Version 2.2 installation fails.