OraOpenSource / OXAR

Oracle XE & APEX build script along with images for popular cloud platforms
http://www.oraopensource.com/oxar/
MIT License
109 stars 42 forks source link

Add backup and flash recovery etc #3

Open martindsouza opened 9 years ago

martindsouza commented 9 years ago

See http://www.davidghedini.com/pg/entry/install_oracle_11g_xe_on for examples

martindsouza commented 9 years ago

As part of this will need to think about putting the project's entire folder in a root directory so we can update the backup scripts in the future without having to guess where the project its.

Can leverage new APEX backup project: https://github.com/OraOpenSource/apexbackup

dgielis commented 8 years ago

Here's a script I use together with crontab entry: backup_now

#!/bin/bash
_now=$(date +"%Y_%m_%d")
_file="xe_$_now"
echo "Starting backup to $_file..."
expdp system/oracle1$ full=y directory=backups dumpfile="$_file".dmp logfile="$_file".log

crontab -l > x3 echo "0 0 * * * /home/oracle /home/oracle/backup_now" >> x3 crontab < x3 rm x3

backup_now.txt (rename backup_now.txt to backup_now and make it executable)

It will take a datapump every night and put it in a directory. You could make the directory a mount to another (network) disk.

Additional I think it would be nice to do something like dropbox to keep your backups in the cloud.

tschf commented 8 years ago

Some examples of backup rotation: http://serverfault.com/questions/196843/logrotate-rotating-non-log-files