Installing and Configuring an Oracle Developer Day VirtualBox Image

It’s winter. I can tell. First, it’s still dark. Secondly it’s bitterly cold.
Standing on the platform at Milton Keynes Central, it would appear that we now have further evidence that being late is a train driver’s prerogative.
Hiking up the season ticket price is obviously the prerogative of train operators.
The last time I spent this much money to feel this cold, I found myself standing on the top of a mountain in the South Island of New Zealand.

Unlike the “Great” British Railway, installation and configuration of an Oracle Developer Day Appliance is somewhat simpler, not to mention more reliable.

What I’m going to cover here is the installation of a Developer Day Appliance in Virtual Box as well as some settings you might want to tweak to gain access to the Appliance Database from the Host OS.

Environment, Pre-Requisites and terminology

As always, when we’re talking about virtualization, there are going to be mentions of :

  • The Host – the machine and Operating System on which the virtualization software (in this case VirtualBox) is running
  • The Guest – the system that’s running inside the Virtual Machine

These instructions should work, irrespective of the Host OS we’re using.
In my case, I’m using Mint 17 as my Host with VirtualBox 4.3.20 installed.

If you need installation instructions for VirtualBox, you can find them here for Debian based systems or here for Windows.

Alternatively, you can check the fairly comprehensive documentation on the VirtualBox website.

As for the Developer Day Image itself, I’m going to be using the Database Application Development VM.
The system requirements for this are :

  • 2GB RAM for the Guest OS
  • 22GB of disk space (15 GB for the Image plus 5.6 GB for the download file)

One other point to note – the latest incarnation of the Database Application Development VM has port-forwarding for port 1521 enabled by default.
This is the port for the TNS listener on the database in the Image. If you already have an Oracle instance running on your host, you’ll probably want to ensure that either, it’s not using 1521 for TNS connections, or that you disable the port forwarding on the Developer Day Image once you’ve installed it.
We’ll come back to this port-forwarding malarkey in a bit.

Getting the software

Open your browser and head over to Oracle’s Pre-Build Developer VMs page.

This is part of Oracle’s Technet site and you will need a Technet account to download the software, if you don’t already have one. However, registration is free and relatively painless.

Have a look through the available images and select the one that contains the stuff your interested in.
In my case, I want to have a play around with the 12c Database, hence the choice of the Database Application Development VM.

NOTE : this page itself may be a bit out-of-date in terms of what each VM contains, so click the Downloads and Instructions link next to the VM you may be interested in. This will give you a more accurate inventory of what software the VM contains.

Anyway, once you’ve selected your VM, simply hit the Download icon, enter your Technet credentials and – depending on your connection speed – find something else to do for a bit.
Eventually, you will have a file in your Downloads directory called :

Oracle_DB_Developer_VM_new.ova

In case you were wondering, .ova files are Open VirtualBox Format. Creating a VM with this type of file is slightly different to setting one up for a .iso …

Setting up the VM

Start the Oracle VM VirtualBox Manager on your machine and from the menu, select File/Import Appliance

appliance1

Appliance to Import is the file you’ve just downloaded :

appliance2

Appliance Settings are all already completed so just click Import :

…and agree to the License

appliance4

You’ll then see a progress bar….

appliance5

And finally, you’ll see the new VM listed in VirtualBox Manager.

Now, let’s power it up and see what happens….

Once you see the desktop, click the big armoured penguin icon…

vm_start

…and wait…

your patience will be rewarded with the introduction page to the hands-on sessions included in the image :

welcome_page

We can check that the database is up using the copy of SQLDeveloper available in the VM ( a connection for SYSTEM is already there).

Alternatively, we could just open a Terminal and login via SQL*Plus as SYSTEM ( all of the passwords are initially set to oracle).

Actually, that’s probably a point worth reiterating :

All of the accounts that you are likely to want to access on this VM have their password set to “oracle”

Either way connecting as SYSTEM will establish that the database is up. A couple of further queries will confirm the version of the Database and of APEX…

select banner
from v$version
where banner LIKE 'Oracle Database%'
union
select comp_name||' Version '||version as banner
from dba_registry
where comp_id = 'APEX'
/

BANNER
--------------------------------------------------------------------------------
Oracle Application Express Version 4.2.5.00.08
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

… as well as the identity and current status of the database itself :

select db.name, ins.host_name,
    ins.status, ins.logins,
    db.log_mode 
FROM v$database db, v$instance ins
/

NAME	  HOST_NAME							   STATUS	LOGINS	   LOG_MODE
--------- ---------------------------------------------------------------- ------------ ---------- ------------
CDB1	  localhost.localdomain 					   OPEN 	ALLOWED    NOARCHIVELOG

Some Housekeeping

Time and Date

The first thing you’ll probably notice is that the time and date is defaulted to US Pacific Standard time (I think).
If you want to change this :

Go to the Applicationsmenu and select Utilities/Settings/Time and Date,
Click the Unlock button and then set the time and date that’s appropriate for your location.
Finally, click the Lock button.

Region and Language (as well as Keyboard)

If, like me, you have trouble remembering where the US keyboard layout puts the “@” symbol (not to mention the “|”) then you’ll probably want to re-configure the Keyboard settings to your locality, along with the Region settings :

Go to Applications/System Tools/Settings/Regions & Language.

To change the region settings, Hit the “+” button under Input Sources and select the appropriate region.
To change the Keyboard itself, first highlight the current Input Source – i.e. English (US) – then click add to add the source you require.
Once this is done, Highlight the English (US) entry again and hit the “-” button to remove it.

For Region Changes to take effect, the system will need to be restarted. The keyboard change, however, should take effect immediately.

Setting the APEX user not to Expire

Given that these images were initially created for Developer Day events, it is perhaps not surprising that the expiration of the APEX_PUBLIC_USER password after 6 months was not a primary consideration.
If you want to avoid this little inconvenience, then the simplest way is to change the DEFAULT profile, to which all database accounts in the image are assigned :

alter profile default limit password_life_time unlimited;

NOTE: In a production environment you’d probably want to take a bit more care here. However, the Developer Day Images are purely for research.

Accessing the Database running on the VM from the Host

Accessing the Database via TNS

As mentioned previously, port-forwarding of 1521 (The default SQL*Net port) is already pre-configured.
Therefore, assuming that you have an Oracle Client installed, you can connect to the database on the Guest (whilst it’s running) from the Host as follows :

sqlplus system/oracle@0.0.0.0:1521/cdb1

Once you have a SQL prompt, you can check to see that you now have access to Oracle in all it’s 12c splendour…

select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE	12.1.0.2.0	Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production

For convenience, you can always add the following entries to $ORACLE_HOME/network/admin/tnsnames.ora on your host :

CDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb1)
    )
  )
  
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
 

Accessing APEX

We can repeat the simple port-forwarding trick to make the APEX home page available on the Host as well.

In Virtual Box Manager, with the Developer Day VM highlighted, click Settings
Select Network
Click the Advanced arrow

network_advanced

Click the Port Forwarding button
Now Click the Add icon on the right-hand side of the window and enter the following values for each of the fields :

  • Name : http
  • Protocol : TCP
  • Host Port : 8080
  • Guest Port : 8080

Note : once again, you’ll probably want to change these values if you have a local instance of Oracle running on the Host.

Anyway, your rules should now look like this :

http

You can now hit the APEX main page from a browser in the host by entering :

http://localhost:8080/apex

apex_login

Note – the credentials for the ADMIN user for APEX are :

Workspace : INTERNAL
Username : ADMIN
Password : oracle

Update – in later versions of the VM, the username may have changed to SECURE.Thanks to Catscrash and Russell Trafford for pointing this out ( see comments below).

And there you have it, a quick and simple (not to mention, cheap) way to get Oracle 12c installed on your local machine. Now, if only they’d do the equivalent for getting from Milton Keynes to London.

Author: mikesmithers

Back in 1993, I discovered that I could get paid money for doing fun stuff with computers. Over the years, I've specialised in Oracle Databases as a developer, a DBA and sometimes, an architect. It's my evil alter-ego - The Antikyte - who writes a blog about my various technical adventures. Yes, that is his Death Star parked in the Disabled Bay. I currently live in the South-West of England with Deb, my long-suffering wife.

40 thoughts on “Installing and Configuring an Oracle Developer Day VirtualBox Image”

  1. Hi,

    do you know, if they changed the login data for the apex admin user with their current Developer Day VMs? I’m getting “Invalid Login Credentials” when trying with internal/ADMIN/oracle

    Like

    1. Catscrash,

      The Dev Day version I’ve got looks like it’s from 2014 OpenWorld.

      You should be able to re-set the password using the apxchpwd.sql script.

      You can find this in the $ORACLE_HOME/apex directory on the VM.

      HTH,

      Mike

      Like

  2. Thanks mikesmithers and catscrash. I had the same issue. The change in username to ‘secure’ worked for me. Mike, could you update the post to warn people if they dont read the comments? 🙂

    Like

    1. BJ,

      As far as I recall, etc/oratab holds a list of instances running on a given server.
      There is only one instance running on the VM, although there are two databases – the Container (CDB1) and the Pluggable (PDB1).
      Each of these are present in the tnsnames.ora so you should be able to connect in the normal way via SQL*Plus or SQLDeveloper.
      Is this what your referring to ?

      HTH,

      Mike

      Like

    1. Bud,
      You can run VirtualBox on Windows7. Just click the link in the post for Windows installation of VirtualBox or visit the VirtualBox site for installation instructions.
      If you’re talking about the Developer Day Image then you need to assign it a minimum of 2GB RAM.
      In my experience, this means that the host machine ( i.e. your HP), will need a minimum of 4GB Physical Memory.

      HTH

      Mike

      Like

  3. Hi

    can you help me in installing the oracle VM. i installed the VM but the sql developer is not connecting saying as ORA -12505 failure. this is the first time i installed VM dont know how to resolve., checking in google to start oracle instance on Oracle VM.

    please help me how to start and enter into sql developer on VM and connect to HR database

    Like

    1. Mitx,

      are you getting this problem with the SQLDeveloper that’s running in the VM, or are you trying to connect to the VM database from outside the VM ? I think a good starting point would be to see if you can connect to the database via SQL*Plus. If you can then you know that the database is up and the problem is somewhere in the TNS setup. I would suspect this is the case, judging by the error you’re getting but it’s worth making sure.
      Please let me know how you get on.

      HTH,

      Mike

      Like

  4. Hi Mike,

    I’m not able to connect to the database with sql developer or the terminal sqlplus . I’m getting this error: “ORA-12154 could not resolve the connect identifier specified”.

    I just imported the appliance and run the vm.

    Do you have any idea what’s wrong?

    Thank you very much

    Like

    1. Art,

      as you probably already know, ORA-12154 is a TNS error.
      Note that, unlike previous database versions, a 12c database will have at least two TNS entries – one for the Container Database (CDB1 in the Developer Day Image) and at least one pluggable instance ( ORCL in the Developer Day Image).

      If you are trying to connect from inside the VM using SQL*Plus ( i.e. running the terminal from the VM) then this should work :

      sqlplus system/oracle@orcl
      

      If this doesn’t work, then run :

      lsnrctl status
      

      …which should tell you what database aliases the TNS Listener is using.

      If you’re trying to connect from the host running the VM, then something like this is probably what you’re after :

      sqlplus system/oracle@0.0.0.0:1521/cdb1
      

      HTH,

      Mike

      Like

      1. Hi Mike,

        Thanks for your reply.

        I tried that (sqlplus system/oracle@orcl) in the terminal and I still get the same error.
        In sql developer there is a system user already created for that orcl and it doesn’t work either.

        This is what I get from the lsnrctl status

        LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 23-SEP-2016 19:21:14
        
        Copyright (c) 1991, 2014, Oracle.  All rights reserved.
        
        Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
        STATUS of the LISTENER
        ------------------------
        Alias                     LISTENER
        Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
        Start Date                23-SEP-2016 19:18:21
        Uptime                    0 days 0 hr. 2 min. 55 sec
        Trace Level               off
        Security                  ON: Local OS Authentication
        SNMP                      OFF
        Default Service           orcl12c
        Listener Parameter File   /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
        Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
        Listening Endpoints Summary...
          (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
          (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
        Services Summary...
        Service "orcl12c" has 1 instance(s).
          Instance "orcl12c", status UNKNOWN, has 1 handler(s) for this service...
        The command completed successfully
        

        I then tried with sqlplus system/oracle@orcl12c and I get a different error

        [oracle@localhost ~]$ sqlplus sytem/oracle@orcl12c
        
        SQL*Plus: Release 12.1.0.2.0 Production on Fri Sep 23 19:22:00 2016
        
        Copyright (c) 1982, 2014, Oracle.  All rights reserved.
        
        ERROR:
        ORA-01034: ORACLE not available
        ORA-27101: shared memory realm does not exist
        Linux-x86_64 Error: 2: No such file or directory
        Additional information: 3640
        Additional information: -1791386741
        Process ID: 0
        Session ID: 0 Serial number: 0
        

        I’m new to oracle so I don’t really know what to do here. Any help would be great.
        I have been stuck for a few days just trying to connect so I can start with some tutorials.

        Thanks,
        Art

        Like

      2. Art,

        the Developer Day Virtual Box Image has changed a bit since I wrote this guide so bear with me.

        It looks like you’re on the right track – i.e. the database alias that the listener is setup for is actually ORCL12C and not ORCL.
        So, the correct command is indeed :

        sqlplus sytem/oracle@orcl12c
        

        The ORA-01034 Error is because the database is not currently running.
        From the output you posted, it looks like you’re running in the terminal as oracle.

        This being the case, you should be able to start the database by doing the following in the terminal window :

        sqlplus / as sysdba
        

        This should get you to the SQL prompt ( i.e. SQL> ). You will now have SYS privileges on the database ( essentially the equivalent of root for Oracle).
        This allows you to do stuff like start the database…
        Now type :

        startup
        

        Once that’s done, you should eventually get some feedback to tell you that the database has been opened.

        I’ve just run this command sequence ( admittedly on an 11G XE database), but the output should be similar. It looks like this :

        oracle@mike-TravelMate-B116-M /home/mike $ sqlplus / as sysdba
        
        SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 19:49:22 2016
        
        Copyright (c) 1982, 2011, Oracle.  All rights reserved.
        
        Connected to an idle instance.
        
        SQL> startup
        ORACLE instance started.
        
        Total System Global Area 1068937216 bytes
        Fixed Size		    2233344 bytes
        Variable Size		  687868928 bytes
        Database Buffers	  373293056 bytes
        Redo Buffers		    5541888 bytes
        Database mounted.
        Database opened.
        SQL> 
        

        Once you get this then logout of your current session. You should now be able to connect to the database as system using :

        sqlplus sytem/oracle@orcl12c
        

        Assuming you get this far, you can fix the SQLDeveloper connection simply by specifying the correct SID value.
        To do this, in SQLDeveloper, right-click the SYSTEM connection and select Properties from the menu.
        In the SID replace ORCL with ORCL12C. Note that the string is not case-sensitive.

        Please let me know if any of this works.

        Mike

        Like

  5. Hi Mike,

    Thanks for all your help here.

    The command “sqlplus / as sysdba” didn’t work. I still get the tns 12514 error

    so I tried with -> sqlplus sys/oracle@orcl12c as sysdba and it worked.
    I got the SQL prompt and I tried as you said to start the db, I got the following error this time.
    ORA-00845: MEMORY_TARGET not supported on this system

    I googled that and it looks I need to increase the memory, not sure how

    Thanks,
    Art

    Like

    1. Art,

      Once again, you’re correct – ORA-00845 is about not enough shared memory being available in Linux for the Oracle database to start.
      The problems that you’ve been having are a bit puzzling, if the Virtual Box Appliance that you’re using was one of the Developer Day Images available from the Oracle site.

      Can you confirm which Appliance you downloaded ? There’s several on the site.

      If you have got one of these, is the amount of RAM allocated to the Virtual Machine in Virtual Box 2GB or greater ? 2GB is pretty much the minimum that a fully fledged Enterprise Edition database will run on.
      One final thing to check – how much space is allocated for disk on the Virtual Machine ? I vaguely remember having a memory issue when trying to install an Express Edition database on a CentOS VM because I hadn’t allocated enough space for the hard-drive.
      I find it hard to believe that this could be your issue, but thought I might as well mention it, just in case.

      If you’re still stuck after all that, can you post the output of :

      uname -a
      

      …from the terminal in the VM ?

      Also, can you confirm which OS you’re running as the host for Virtaul Box ?

      Thanks,

      Mike

      Like

      1. Mike,

        Thanks for following up with my issue here.

        I’m running the VM on a Windows 7 Home Premium.
        I downloaded the applicance “Database app development” from this link http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html

        I just downloaded it a few days ago so it’s up to date.
        I only have 4GB of RAM in my machine, I’m upgrading soon to 8GB. For the moment I only allocated 2GB for the VM.

        The appliance created two drives with 30gb of dynamically allocated storage. It looks that I can only see one in linux but has 25gb free, so it should be ok.

        This is the output of uname -a
        Linux vbgeneric 3.8.13-118.4.2.el7uek.x86_64 #2 SMP Tue Mar 22 20:46:48 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

        If it’s a memory problem I can wait until I get the extra 4GB but according to the web, it should work with 2.

        Thanks,
        Art

        Like

  6. Thanks for all your help.

    I was able to connect to the service and mount the database by changing the tmpfs size
    The problem is that it´s really slow. Almost impossible to use.

    I will try again once I can allocate more memory.

    Like

    1. Art,
      congratulations on getting it running !
      You may want to try accessing the database from the host system rather than inside the VM as this is a fair bit faster.
      You need to do the port forwarding stuff I mentioned in the post. Then you’d need to install SQLDeveloper and the Oracle Client on your local machine. These are both available for download for free from Oracle.

      HTH,

      Mike

      Like

  7. Thank You for the article. I have installed Oracle developer image which contains oracle Apex 5.1.

    Our work internment had 5.0. When i try create the sample project in oracle apex 5.1 in virtual box, the option “Chart : Type – select Stacked Bar Chart. is not showing. But it exits in work envirnment 5.0. Do i need to apply any patches after that?

    Like

  8. Sorry for this question. Does anyone remember the default password for oracle OS user password for the VM? It starts OraPwd something. Cant remember it after shutting down the VM for a while. Appreciate any replies.

    Like

    1. Dhana,

      I assume that you want to connect to the database server VM from the host ?
      This being the case, you should may be able to open a connection simply by specifying the IP address of the VM – in this case it’s 0.0.0.0
      If that doesn’t work, then you can try to set up a static IP address for the VM and use that.
      To do this you can either try these steps, or take a look at this article recommended by Wayne in his comment on this post.

      HTH,

      Mike

      Like

    1. Rushikesh,
      that will depend on what the VM contains. If there is a version of APEX that is running on the embedded PL/SQL Gateway then it’s the web-server that’s built into Oracle which I think is Apache. If it’s running on Ords then it will probably be the ORDS default, which is Jetty.
      You can check if the PL/SQL Gateway is running by executing the following query :

      select dbms_xdb.gethttpport
      from dual;
      

      If it is running, this will return the port number. Otherwise it will return 0.

      HTH,

      Mike

      Like

  9. Hi Mike,

    Firstly, thanks very much for the article.

    I would just like to point a minor error. In the section on configuring the Date/Time and Keyboard it states for the date and time….

    “Go to the Applications menu and select Utilities/Settings/Time and Date,…”

    It should actually say…
    “Go to the Applications menu and select System Tools/Settings/Time and Date,…”

    Regards.

    John.

    Like

  10. Hello, I am getting the below error while trying to import Oracle Developer VM file.

    Failed to import appliance /Users/Downloads/DeveloperDaysVM2019-05-31_20.ova.
    Result Code: NS_ERROR_INVALID_ARG (0x80070057)

    I have 160 GB flash storage available.
    Oracle VM Virtual Box Manager version 6.1.8

    Please advise.
    Thanks & Regards,
    Sandy

    Like

    1. Sandy,
      I’ve not hit this issue myself but a quick search reveals that this may be a problem with Virtual Box thinking that it doesn’t have enough space to import the appliance.
      Therefore, I’d suggest you check the following :
      a) what are the stated space requirements for your appliance ( i.e. the size on disk after it’s been imported) and do you have enough space
      b) from your description of your flash drive, I’m guessing you have more than one drive. Is it possible that Virtual Box is attempting to save to a different drive (which does not have enough space) ?
      c) if a and b don’t throw up anything obvious then it may be worth checking the .ova file hasn’t got corrupted during download (maybe compare check the md5sum against what Oracle have published for this appliance) ?

      HTH,

      Mike

      Like

Leave a comment

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