Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

General

Note: Archive logging is essential for production databases where the loss of a transaction might be
fatal. It is generally considered unnecessary in development and test environments.

Init.ora Parameters
Configure for multiple
archiver processes

log_archive_max_processes=<integer>;
SELECTvalue
FROMgv$parameter
WHEREname='log_archive_max_processes';
ALTERSYSTEMSETlog_archive_max_processes=3;
SELECTvalue
FROMgv$parameter
WHEREname='log_archive_max_processes';

Startup The Database In Archivelog Mode


Steps Required To Take
A Database Not In
Archive Log Mode And
Alter It To Archive Log
Mode

SELECTlog_mode
FROMv$database;
SHUTDOWN;
STARTUPMOUNTEXCLUSIVE;
ALTERDATABASEARCHIVELOG;
ALTERDATABASEOPEN;
SELECTlog_mode
FROMv$database;

Startup The Database In NoArchivelog Mode


Steps Required To Take
A Database In Archive
Log Mode And Alter It To
No Archive Log Mode

SELECTlog_mode
FROMv$database;
SHUTDOWN;
STARTUPMOUNTEXCLUSIVE;
ALTERDATABASENOARCHIVELOG;
ALTERDATABASEOPEN;

SELECTlog_mode
FROMv$database;
Restart After Archiving Logging Failure
SHUTDOWN;
STARTUP;
Archive Logging Restart

ARCHIVELOGSTART;
ARCHIVELOGALL;
Archive Log Related Commands
Start Archive Logging

altersystemarchivelogstart;

Stop Archive Logging

altersystemarchivelogstop;

Force archiving of all log


files

altersystemarchivelogall;

Force archiving of the


current log file

altersystemarchivelogcurrent;

Shell Scripts
Move Archive Logs

exportARCH_DIR="/tmp/rim"
NEW_DIR="/tmp/rim/new_dir"
exportFILE_EXT="arc"
exportMOVELIST="/tmp/move.list"
exportCALF="/tmp/calc.tmp"
exportTMPF="/tmp/workfile.tmp"
CMD="lsltr$ARCH_DIR/*.$FILE_EXT|awk
{'print$9'}
|sortr>$TMPF"
exportFILE_COUNT="
echo"Numberoffilesfoundis$FILE_COUNT"
cat$TMPF
echo$FILE_COUNT<1">$CALF
echo"quit">>$CALF
MOVE="/usr/bin/bc/$CALF"
echo"Numberoffilestomoveis$MOVE"
/usr/bin/tail$MOVE$TMPF>$MOVELIST
echo"Filetobemoved"
cat$MOVELIST
whilereadFILE
do

echo"Movingfile$FILEto$NEW_DIR"
done<$MOVELIST

You might also like