Basic Oracle XE and APEX Backup

June 19, 2008  |  apex, linux, security

There are thousands of people around the world using Oracle XE APEX version for developing applications and many of them just don’t know how to backup their database. Oracle XE database comes with 9 essential files that are the database itself. If you backup those 9 files you have your database backed up. To backup these files your database must be shutdown (cold backup).

When you install Oracle, it’s created the initialization parameters file, the server parameter file (SPFILE), the Oracle password file and 2 more not so important files. These files are created in the directory /install_dir/app/oracle/product/10.2.0/server/dbs.

Beside the initialization files, 6 data files are created in the dir /install_dir/oradata/XE. These files are the control file, system, sysaux, undo, temporary and user data files (each one representing one tablespace)… these files represent the database.

If your database is in archivelog mode you’ll have also to backup the redo log files. These files are in /install_dir/app/oracle/flash_recovery_area

So, to backup your XE database in linux you can zip those directories into a tar gzip file with this command:

tar cpvfz myxebackup.tar.gz /install_dir/app/oracle/product/10.2.0/server/dbs /install_dir/oradata/XE /install_dir/app/oracle/flash_recovery_area

If you’re not using Linux, the important thing is you to know what to backup, and sure windows has the tools you need to backup that directories I wrote about.

In Linux the install_dir is /usr/lib/oracle/xe and in windows usually is C:\OracleXE

Hope it helps 😉

Update: RMAN may also be used to hot backup the database without need to shutdown the database. This post came after some talks with starter XE users that just don’t knew which files “are the database itself” and which should be backup.


  1. Hi Yilmax… Yes I know that RMAN is available in XE. This post subject came after I talked with non-oracle developers I know who use XE… I answer they could backup using RMAN, but they just don’t wanted that… they wanted a simple way. So the cold backup apparently was simple for them, and they liked it. There are lots of people that use XE but just don’t know what files represent the database itself and what files they need to backup.

    BR, Joao

  2. Hi George,

    If you’re on linux, just uncompress those files with: “tar xvpfz myxebackup.tar.gz” … remember that tar extract extracts the files/dirs to your current work directory! If you’re on root directory i guess the files will go to the exact directory… If you’re on windows just replace those files. If you installed a clean XE, just replace those files and you’re backup will be restored!

  3. Hi Guys,
    did you try off the shelf backup and restore scripts with XE ?

    Kind Regards,

  4. So….how do I restore from this? I mean sure, I’ve got all the data I need but how do I turn that into a working Oracle server?

Leave a Reply