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
Thursday, July 3, 2008
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;
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;
ORACLE TECHNIQUES
- How to clean up the FRA from archive logs.
- How to create a flash recovery area.
- ORA-06512 on 9i SE
- How to reset an oracle parameter.
- "EXP-00008: ORACLE error 6550 encountered" error of Oracle10g.
- How to truncate all tables in schema which contain foreign key constraints.
- How to import a schema and ignore all data from tables.
- How to change the location of oraInventory.
- How to switch a database into the archive log mode.
- How to analyze all tables with theirs indices where statistics is equal to null.
- How to rebuild a table which occupies the last extend in the data file, and then shrink this file.
Subscribe to:
Posts (Atom)