Geek Talk: Application Express


Time for some good ol’ fashion geek talk. What I’m going to explain today is something rather specific. It could be that only few of you will have use for it. But I’ll explain anyway, because it really can come in handy.

A while ago I told you about databases, how data is stored and what the very basic principles there are. As you probably know, there are multiple database vendors (oracle, microsoft, ibm, …). And today I would like to explain something very specific about the oracle database.

There is a “plugin” for this database which allows you to create small applications (also large ones if you’re very good) without having to know all to much about SQL.
It is called Oracle APEX (application express).

APEX is an application which is build mostly on PL/SQL code (don’t worry too much about it). It contains a GUI which guides you through the creation of your application.
Even if you are not that technical, you can still create some small applications which can be very usefull.

I created a security management tool for instance, a very simple application that allows someone to create a user and add this user to a specific group (these users and groups where used in another application later).

As I said before, APEX is something that is plugged in an Oracle database. So if you want to try it, I’m afraid there is no other way than to install an Oracle database.

Now there are 2 basic ways to get APEX up and running. An easy way and a less easy way. Since the release of the Oracle 11g database, apex is delivered with the default installation of the database. However, running an Oracle 11g database requires quite a lot of resources. Since this database is meant to run on a server.
In 11g all you need to do is run 1 sql script (which is delivered with the installation as well) and apex is up and running. Nothing more. No need to say that this is the easy way.

It is very understandable if you do not want to install such a performance demanding database on your client PC so the nice developers of Oracle created a light version of the Oracle Database. Which is called Oracle XE. This is a database meant to run on client PCs (which can be used for demos, etc). This database run much much lighter than the 11g or 10g database but doesn’t not have APEX delivered with the installation.
In other words, you will have to install it yourself on the XE database. In a moment I’ll briefly describe how you can deploy APEX on both databases.

Before I do that I want to show you one last thing. If you just want to try APEX (for fun or so), you can request an online workspace at oracle. They have an apex environment up and running for the public to use. Only thing you need to do is register and the workspace + a user will be available for you. Like this you can create some test application and see what is can do without destroying your own computer.

The link to this online environment is http://apex.oracle.com/pls/apex/. Just click “request a workspace” and you’ll be set for a while.

Good, now just in case there are a few hardcore IT guys who really want to try this on their own computer I’ll briefly explain how to deploy APEX on your computer.
Before we start keep in mind that I assume that you’ve installed either an 11g database or a 10g/XE database.

For the 11g database:

  • Open a command box (start >> run >> cmd)
  • Navigate to the apex folder on your pc. This folder is typically in the installation folder of your database in the subfolder APEX  (in my case this is C:\app\SHARP\product\11.1.0\db_1\apex). Use the command CD to switch to the correct directory
  • If the command prompt shows that you are located in the correct directory type the command sqlplus / as sysdba
  • You’ll see that your command prompt has changed, it now says SQL in front. That’s okay, no need to worry!
  • Now type the command @apxconf . This will launch a script which is located in the APEX folder you just navigated to. A few questions will be asked, you should reply to all of them (you can leave the port by default if you like, which is 8080). Don’t forget to note the password you entered for the ADMIN user!

    SQL> @apxconf

    PORT
    ———-
    8080

    Enter values below for the XDB HTTP listener port and the password for the Application Express ADMIN user.
    Default values are in brackets [ ].
    Press Enter to accept the default value.
    Enter a password for the ADMIN user              [] FancyPasswordHere
    Enter a port for the XDB HTTP listener [      8080]
    …changing HTTP Port

    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Session altered.

    …changing password for ADMIN

    PL/SQL procedure successfully completed.
    Commit complete.

  • Great, almost there. One more thing you need to do. Run command alter user anonymous account unlock;

Once this is done you can close the command box. Apex is now available at location http://localhost:8080/apex and the admin console can be found at http://localhost:8080/apex/apex_admin.
Workspace: INTERNAL (create a new one after you logged in)
USER: ADMIN
PASSWORD: in my case this is FancyPasswordHere

You’ll most likely be prompted to change the password for this user.
One small note, since you are using the default files delivered with the database the APEX version will be 3.X. Just so you know, because APEX 4 is already available.

For XE database:
This is a bit more difficult. Since you will really need to deploy apex entirely.

  • First off, download APEX. http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html. Pick the latest version, since you need download it anyway, you might as well deploy the latest version.
  • Unzip the file you just downloaded to a folder (to keep it simple, perhaps you can unzip it somewhere in the installation folder of these database, the folder needs to stay there)
  • Open a command box (start >> run >> cmd)
  • Navigate in the command prompt to the folder where you just unzipped all the apex files (you’ll probably have created a subfolder APEX in the folder where you’ve extracted the files. This is where you need to be!)
  • If the command prompt shows that you are located in the correct directory type the command sqlplus / as sysdba
  • Run following command (please, pleaaaaaseee don’t make any typos): @apexins SYSAUX SYSAUX TEMP /i/
  • Wait for the script to complete, this may take quite a while.
  • Run following command @apxldimg <path_where_apex_software_was_unzipped> (in my case C:\app\SHARP\product\11.1.0\db_1\apex).
  • Once the scripts completes you should receive the message PL/SQL procedure successfully completed with some other crap below that.
  • If you’re not connected anymore with SQLPLUS. Reconnect with command sqlplus / as sysdba
  • Once this is done run command @APXXEPWD.sql
  • Enter a password, please don’t forget it. This is the password for the ADMIN user.
  • Run command alter user anonymous account unlock;
  • Just to be safe, run following command execute dbms_xdb.setListenerLocalAccess(l_access => FALSE) ;

Once this is done you can close the command box. Apex is now available at location http://localhost:8080/apex and the admin console can be found at http://localhost:8080/apex/apex_admin.
Workspace: INTERNAL (create a new one after you logged in)
USER: ADMIN
PASSWORD: in my case this is FancyPasswordHere

You’ll most likely be prompted to change the password for this user.

That wasn’t so bad now, was it?

I found some APEX tutorials on the web. Here is the link. It may come in handy one day.
http://www.mandsconsulting.com/oracle-apex-video-training-tutorials-complete-list

Have fun! ;-)

execute dbms_xdb.setListenerLocalAccess(l_access => FALSE) ;
23Installing Oracle Application Express on XE
15. Open the browser, type the URL in formathtt p://ho stnam e.dom ain:80 80 / apex / apex _adm in
and you should be seeing the following screen. The username is ‘admin’ and the password is the
password that you specified in step 13. Enter the username & the password and click on ‘Login’.
16. When logging on for the first time, you will need to change the password for admin user.
Specify the old password, the new password and click on ‘Apply Changes’
24Installing Oracle Application Express on XE
17.Click ‘Return’ to return to the login page.
18. Logon with the new password.

Share & Embed

Add a Comment

Mohamed Aly

Mohamed Alyleft a comment

i’ll said my comment after I read it

humdrumincubus2left a comment

Thanks. Great tutorial mate… Here’s the Video Tutorial: http://bit.ly/cXQPGN – If you prefer video like myself. Don’t get me wrong, I still like ur tutorial!

hachemizakarialeft a comment

great Thanks!

jozefp14107left a comment

Thank you.

pranayraavileft a comment

good doc thank you

nareshvigt replied:

hi do u any post installation document is ther

03 / 09 / 2010
Advertisements

Leave a Reply

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: