Backing up and Restoring Oracle XE

At work we use Oracle as our production database and Oracle XE as our development database on our laptops/desktops. I recently received a new laptop and needed to move Oracle XE and all of the data from my old machine to my new machine. After some searching around I found a very simple method.

  1. Install a fresh copy of Oracle XE on the new machine.
  2. On the old machine run the “Backup Database” command which is located in the Windows Start Bar.
  3. Copy the following folders and files from the old machine to the new machine.
    • c:\oraclexe\app\oracle\flash_recovery_area\XE\AUTOBACKUP\*
    • c:\oraclexe\app\oracle\flash_recovery_area\XE\BACKUPSET\*
    • c:\oraclexe\app\oracle\product\10.2.0\server\database\SPFILE2INIT.ORA
  4. On the new machine run the “Restore Database” command which is located in the Windows Start Bar.

That is all there is to it. You should now have all of your schemas and data on your new machine.



How to change the Oracle XE web interface port.

By default the Oracle XE web interface uses port 8080. This can cause problems because by default JBoss AS and other app servers listen to port 8080 as well. Fortunately it is very easy to change the port that XE listens to.

  • Open the SQL command line: Start Menu >> Programs >> Oracle Database 10G Express Edition >> Run SQL Command Line >>

SQL Command Line

SQL Command Line


  • Enter the following commands at the SQL prompt.

1
2
3
4
5
6
CONNECT system
admin
BEGIN
DBMS_XDB.sethttpport('9090');
END;
/

Now the XE web interface will be listening on port 9090 instead of port 8080. Just make sure you use port 9090 instead of 8080 in the URL. For example: http://127.0.0.1:9090/apex