When you install the Oracle 11g XE database the "Get Started" shortcut references an url to an APEX application (AppID=4950). If you upgrade your APEX version the application is not migrated to the new APEX release. Using some APEX tools and a few lines of codes we can move the XE Admin application to the new APEX version.
Before upgrading the APEX version we first need to export the XE Admin application using the APEX export command line utility.
REM *****************************************************************
REM * PARAMETERS TO MODIFY
REM *****************************************************************
set oracleSID=XE
set oracleSystemPass=oracle
set oraclePort=1521
set oracleHost=localhost
set XEOraclePath^
=C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar
set ApexUtilityPath=C:\apex\apex_4.0.2\apex\utilities
set JAVAPATH=C:\Program Files (x86)\Java\jre6\bin
REM *****************************************************************
set AppId=4950
cd %ApexUtilityPath%
set CLASSPATH=%CLASSPATH%;%XEOraclePath%;%ApexUtilityPath%
REM *****************************************************************
REM Export the application
REM *****************************************************************
"%JAVAPATH%\java" oracle.apex.APEXExport ^
-db %oracleHost%:%oraclePort%:%oracleSID% ^
-user system -password %oracleSystemPass% -applicationid %AppId%
pause
Using the above script, my resulting application script (f4950.sql), is in the APEX utilities directory.
After upgrading the APEX version we need to edit the application script file a make a few minor changes. Since I upgraded my APEX version from 4.0 to 4.1 I need my application to reference the new APEX schema. Change the line (~139) which sets the application owner:
p_owner => nvl(wwv_flow_application_install.get_schema,'APEX_040000'),
to
p_owner => nvl(wwv_flow_application_install.get_schema,'APEX_040100'),
Although not needed, let's also change the version shown (if in your export file):
p_flow_version=> '&PRODUCT_NAME. 4.0.2.00.09',
to
p_flow_version=> '&PRODUCT_NAME. 4.1.0.00.32',
My resulting application script can be downloaded here.
Log into the database as the SYS user and run the application script, f4950.sql
Execute the following grants to allow for some additional privileges which are needed for the new APEX schema owner.
grant select on dba_temp_files to APEX_040100;
grant select on v_$temp_extent_pool to APEX_040100;
grant select on v_$temp_space_header to APEX_040100;
grant select on v_$system_parameter to APEX_040100;
grant select on v_$session to APEX_040100;
We now have the XE Admin application in our upgraded APEX installation.
Download Links:
f4950.sql (4.1)
f4950_v420.sql
f4950_v424.sql