Wednesday, June 30, 2010

Upgrading APEX to V4

Not posted for a while, been a bit busy.

Oracle Application Express (APEX) V4 was released recently, and I have a couple of Apps that I've written so decided to upgrade.

Needless to say, I took a backup of the repository database (and an export for good measure). The APEX file is only 89Mb, downloadable from the OTN web site (http://www.oracle.com/technology/products/database/application_express/index.html).

The upgrade is fairly easy, although there are a couple of 'gotchas'. The instructions work well, until you get to the point of upgrading the images directory. This is a well-known 'documentation bug' but I'll repeat it here. The instructions infer that you need to run this:

@apxldimg.sql /u01/app/oracle/product/11.1.0/db_1/apex/v4.0/apex

which is the path is to the extracted directory. However, if you do that you'll get this error:

declare
*
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
No such file or directory
ORA-06512: at "SYS.XMLTYPE", line 296
ORA-06512: at line 15

What you should run is this:

@apxldimg.sql /u01/app/oracle/product/11.1.0/db_1/apex/v4.0

So drop off the trailing "apex".

That's gotcha 1.

After installation when I tried to log in to the Admin page I got this error:

"application=4050 workspace=10 Error ERR-1014 Application not found."

There are lots of Google results for this error, but they all seem to go round in circles. The actual fix is on the Metalink site (Note 814858.1).

This was my fault, instead of running the "apexins.sql" script, I copied and pasted the run-time one from the instructions and ran that (apxrtins.sql).

The fix is to simply run another script to upgrade the run-time version to the development one. The script is called 'apxdvins.sql'.

After running this, run the script to change the Admin password, apxchpwd.sql, then connect to the Admin page as you would normally (http://servername:port/apex/apex_admin) and it will allow you to continue. The first screen is a password change screen for the admin user, so you will need to go through that.

There is also a apxconf.sql script if you need to change the port.

I've not had a chance to play with V4 yet, but will try to over the next few weeks.