WORKAREA_SIZE_POLICY should be AUTO and MEMORY_TARGET should be at least 300M.
If you are following best practice and NOT using AMM, but you are using ASMM and APMM then the sum of SGA_TARGET and PGA_AGGREGATE_TARGET should be at least 300M.
export APXVER=21.2
mkdir -p /u01/img/apex/${APXVER}
Download to /u01/img/apex
unzip /u01/img/apex/apex_${APXVER}.zip -d /u01/img/apex/${APXVER}
rm /u01/img/apex/apex_${APXVER}.zip
Create a Guaranteed Restore Point (or ensure you have another method to backout if necessary).
CREATE RESTORE POINT apexupgrade GUARANTEE FLASHBACK DATABASE;
If this is an initial install or you are enabling the version of APEX shipped with the database then choose how you want to connect to APEX (ORDS/OHS/Embedded PL/SQL gateway) and click the appropriate links to configure.
If this is an Upgrade then temporarily prevent access to APEX (again using the appropriate links).
ORDS is the recommended technology for production workloads.
The Embedded PL/SQL Gateway may be suitable for a non-production environment (but standalone ORDS would be a better choice, if your platform supports it... e.g Linux does, AIX doesn't). With later versions of APEX (20.2+), support for the Embedded PL/SQL Gateway has been withdrawn.
OHS is desupported since APEX 20.2.
If the first or second digit of the version will change as a result of this upgrade (e.g. 4.1 to 4.2) then you need a full install of APEX. If only the third digit will change (e.g. 4.2.2 to 4.2.6) then you just need a patch...
export APXVER=21.2
This should match the version number in your download location path (e.g. for /u01/img/apex/18.1 APXVER is 18.1)cd /u01/img/apex/${APXVER}/apex
sqlplus / as sysdba @apexins.sql SYSAUX SYSAUX TEMP /i/
If you want APEX to live in a different tablespace update the tablespace names accordingly.The tablespace names relate to "apex", "files", and "temp" segment storage.Homing APEX in SYSAUX is generally appropriate.This usually takes approximately 15 minutes to complete.cd /u01/img/apex/${APXVER}/patch
sqlplus / as sysdba @apxpatch.sql
Review apxpatch.log for errorsAs 'ohs'...
cd $ORACLE_HOME/Apache/modplsql/conf
Add the following two lines to the dads.conf file (if they are not there already)...
PlsqlPathAlias r
PlsqlPathAliasProcedure wwv_flow.resolve_friendly_url
Stop & Restart OHS
cd /u01/img/apex/${APXVER}/apex
sqlplus / as sysdba @apxldimg /u01/img/apex/${APXVER}
As 'ohs'...
cp -R /u01/img/apex/${APXVER}/apex/images/* /u01/app/ohs/product/10.1.0/Apache/images/
The destination directory is defined in $ORACLE_HOME/Apache/modplsql/conf/dads.confRemember to drop any Guaranteed Restore Point (be sure you don't need to backout first)
Start ORDS, EPG or OHS as necessary