Oracle XE Backup

After installing Oracle XE you should setup backups.

Backups for XE

For Oracle XE there is ready a backup script that uses Oracle’s RMAN.


Setup Archive Log Mode

After installing the database change it to archivelog mode:

[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release - Production on Sun May 25 01:28:00 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> connect / as sysdba
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  289406976 bytes
Fixed Size                  1258488 bytes
Variable Size              92277768 bytes
Database Buffers          192937984 bytes
Redo Buffers                2932736 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.


To make sure the database is really in archive log mode run the following sql statement:




Run the Initial Backup

Windows run $ORACLE_HOME/bin/Backup.bat

Linux run $ORACLE_HOME/config/scripts/

[oracle@localhost ~]$ $ORACLE_HOME/config/scripts/ 
Doing online backup of the database.
Backup of the database succeeded.
Log file is at /usr/lib/oracle/xe/oxe_backup_current.log.
Press ENTER key to exit
[oracle@localhost ~]$


Run the Backups Daily

Windows add the $ORACLE_HOME/bin/Backup.bat to a job scheduler.

  • Make sure the user running the job is the same user who installed Oracle.


Linux add the $ORACLE_HOME/config/scripts/ to cron.daily

  • Remove the user notification line from the end of the script


Backing up files

Make sure that your backup script backups up the $ORACLE_HOME directory.  On windows make sure the oradata directory is excluded since this might cause file locking issues.

Leave a comment

Your email address will not be published. Required fields are marked *