Adding APEX 23.1 to your Database Free VM

Posted by

With so much excitement about the release 23c Database Free, there is a good chance you have raced out, downloaded the Database Developer VM that delivers you a full virtual machine with the database, Application Express (APEX), SQL Developer, ORDS and all the goodies you need to kickstart your learning of the new release and the latest tools.

Of course, if you’re a database developer you’re probably also an avid fan of APEX, and you’ll know release 23.1 of APEX has hit the airwaves just after the release of the VM mentioned above.. So if you want to upgrade your VM to have the latest APEX release, here’s a quick guide to walk you through the process.

First, head over to apex.oracle.com, which is always your one-stop-shop for all things APEX.

image

Scroll down to the “Learn” section where you can see the Download APEX link.

image

This will take you to the software download page for APEX, which will have a “latest” version.

image

No need to download the software here – just copy the link to the latest release and keep it for later. We’ll get the software directly within the VM. As of time of writing, the link will be:

https://download.oracle.com/otn_software/apex/apex-latest.zip

Fire up your Database Developer VM, and on launch it should look like something like this:

image

Notice the terminal window behind the Desktop panel. Click on that to bring it to the front. Then run

ps -ef | grep ords

to get the process ID’s of the currently running ORDS server.

image

Stop your ORDS server by killing off the “ords” process and the associated “java” executable. In my case, the process IDs were 3663 and 3720

kill 3663 3720

And now make sure ORDS is no longer running.

image

Now we can download APEX 23.1 from within the VM to a temporary location.

cd /tmp
wget https://download.oracle.com/otn_software/apex/apex-latest.zip

Once the download has completed, we can move our existing installation so we can just drop in the new version of APEX. The VM shipped with APEX 22.2, so I’ll use that for my backup names.

cd /home/oracle
mv apex apex.222
mv apex_images apex_images.222

Now we just unzip the new version into place, and copy the new set of APEX image libraries to the right spot.

cd /home/oracle
unzip /tmp/apex-latest.zip
mkdir apex_images
cd apex/images
cp -pr * /home/oracle/apex_images

Now its time to upgrade the database definitions for APEX 23.1. Change into the ‘apex’ directory and then launch SQL*Plus or SQLcl. Check to see what pluggable databases are present. It should look like below

cd /home/oracle/apex
sqlplus / as sysdba
select name from v$pdbs;

image

APEX is installed at the PDB level, so we need to change into the FREEPDB1 pluggable.

alter session set container = freepdb1;

Although not mandatory, I prefer each APEX installation to go into its own new tablespaces, which helps keep the SYSAUX tablespace from growing too large. (Once SYSAUX gets too big, you might run into the space limits on Database Free which can leave you stuck).

Using the existing file naming conventions, I’ll create an APEX231 tablespace

SQL> create tablespace apex231
2  datafile ‘/opt/oracle/oradata/FREE/FREEPDB1/apex231.dbf’
3  size 100m autoextend on next 100m;

And then I will install the new APEX version into this tablespace.

SQL> @apexins apex231 apex231 temp /i/

That is going to take a few minutes, and assuming all things run successfully, you’ll end up with a screen like the following:

image

Exit out of SQL*Plus or SQLcl by typing “exit” and then we’re ready to start ORDS again.

/home/oracle/bin/ordsstart

which will give its normal start up messages in /tmp/ordslog as it creates the necessary database pools and connections

image

Launch the browser in your VM and head to URL

https://localhost:8080/ords

Confirm that your new APEX is ready to go!

image

At a time convenient to you, you can now drop the old APEX installation to reclaim that space by heading back into SQL*Plus or SQLcl as SYSDBA and dropping the relevant objects

alter session set container = freepdb1;
alter session set “_oracle_script”=true;
drop user apex_220200 cascade;
drop package sys.wwv_dbms_sql_apex_220200;

image

It’s likely that as time goes on, the base VM will be updated to pick up fresher versions of the database, the tools and APEX as they become available, so always check to see what versions are present before doing any upgrades.

7 comments

  1. Hi Connor,

    Regarding your advice to put APEX in its own tablespace instead of SYSAUX, I half-remember seeing that advice (or at least something about SYSAUX on XE filling up) from you before, did you write a separate blog post about that sometime? If so, do you have a link to it?

    Also, there do seem to be wildly different opinions on this, see this APEX forum discussion thread for example: https://forums.oracle.com/ords/apexds/post/usage-of-sysaux-tablespace-for-apex-4123

    Maybe time to write a definitive blog post about it, if one doesn’t already exist? 🙂

    1. I’ve done a video on the risks of APEX and SYSAUX *on Express Edition* that is not yet published (coming soon).
      For me, my default is
      a) express edtiion / database free => use my own tablespace because SYSAUX filling can leave you stuck (as we’ve discussed before)
      b) on any other environment, where there is essentially no limit on SYSAUX, then I’ve no issue with having APEX in there.

  2. Hi Connor, thank you very much for the instructions. Clear and concise.

    I’ve just installed the free 23c database and didn’t know there are limits to SYSAUX. Earlier today I tried to move some online datafiles and got a ‘feature not implemented’ message.

    I think I better check all the limitations before starting to use it… I intend to migrate a really simple application we use today (it literally uses two small tables and that’s all), make the users use it for a while , and if they don’t like it, just insert the records back onto the old tables.

    If they like it, which I suspect they will…move on to a full APEX instance on a production database, and start thinking about the BIG projects lol!

    Thanks!

  3. Also, one last question , can I drop also the SYS.WWV_UTIL_APEX_220200 package at the end too? Thanks!

    1. Sorry, it seens I’ve erased by mistake my original post. Here it goes:

      Hi Connor, thank you very much for the instructions. Clear and concise.

      I’ve just installed the free 23c database and didn’t know there are limits to SYSAUX. Earlier today I tried to move some online datafiles and got a ‘feature not implemented’ message.

      I think I better check all the limitations before starting to use it… I intend to migrate a really simple application we use today (it literally uses two small tables and that’s all), make the users use it for a while , and if they don’t like it, just insert the records back onto the old tables.

      If they like it, which I suspect they will…move on to a full APEX instance on a production database, and start thinking about the BIG projects lol!

      Thanks!

Got some thoughts? Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.