Thursday, July 3, 2008

How to make a crontab backup.

If we want to make a crontab backup we can insert the following lines into crontab (crontab -e)

#------------------------------------------------------------------------------
# Write out crontab file daily for backup
00 18 * * * $HOME/scripts/crontab_backup.ksh > $HOME/logs/crontab_backup.log 2>&1
#------------------------------------------------------------------------------
# Cleanup files
#
12 07 * * * find $HOME/logs/* -name "*" -mtime +30 -exec rm {} \; > /dev/null 2>&1

Where the $HOME/scripts/crontab_backup.ksh script contains of the following code:

#!/bin/ksh
LOG=$HOME/logs/crontab.`date +%y%m%d_%H:%M`
crontab -l > $LOG
# EOF

How to switch a database into the archive log mode:

In order to switch a database to archivelog mode we can use the following procedure:

shutdown immediate;
startup mount exclusive
alter database archivelog;
archive log start;
startup force;

And to check what is the the archivelog mode status:

SELECT log_mode FROM gv$database;

MISCELLANEOUS

ORACLE TECHNIQUES

INSTALLATION