ITPub博客

首页 > 数据库 > Oracle > ORACLE Archive Log Mode

ORACLE Archive Log Mode

原创 Oracle 作者:mfm088 时间:2006-10-10 14:13:19 0 删除 编辑
ORACLE Archive Log Mode[@more@]
Oracle Archive Log Mode
Version 10.2
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=;
log_archive_max_processes=10;
Startup The Database In Archivelog Mode
Steps Required To Take A Database Not In Archive Log Mode And Alter It To Archive Log Mode SHUTDOWN;

STARTUP MOUNT EXCLUSIVE;

ALTER DATABASE ARCHIVELOG;

ALTER DATABASE OPEN;
Startup The Database In NoArchivelog Mode
Steps Required To Take A Database In Archive Log Mode And Alter It To No Archive Log Mode SHUTDOWN;

STARTUP MOUNT EXCLUSIVE;

ALTER DATABASE NOARCHIVELOG;

ALTER DATABASE OPEN;
Restart After Archiving Logging Failure
Archive Logging RestartSHUTDOWN;

STARTUP;

ARCHIVE LOG START;

ARCHIVE LOG ALL;
Archive Log Related Commands
Start Archive Loggingalter system archive log start;
Stop Archive Loggingalter system archive log stop;
Force archiving of all log filesalter system archive log all;
Force archiving of the current log filealter system archive log current;
Shell Scripts
Move Archive Logsexport ARCH_DIR="/tmp/rim"
NEW_DIR ="/tmp/rim/new_dir"
export FILE_EXT="arc"
export MOVELIST="/tmp/move.list"
export CALF="/tmp/calc.tmp"
export TMPF="/tmp/workfile.tmp"
CMD="ls -ltr $ARCH_DIR/*.$FILE_EXT | awk {'print $9'}
| sort -r > $TMPF"
export FILE_COUNT="

echo "Number of files foundis $FILE_COUNT"
cat $TMPF
echo $FILE_COUNT - 1" > $CALF
echo "quit" >> $CALF
MOVE ="/usr/bin/bc/ $CALF"
echo "Number of files to move is $MOVE"
/usr/bin/tail -$MOVE $TMPF > $MOVELIST
echo "File to be moved"
cat $MOVELIST
while read FILE
do

cho "Moving file $FILE to $NEW_DIR"
done < $MOVELIST

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/330796/viewspace-871353/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle Log Files
下一篇: Oracle control files
请登录后发表评论 登录
全部评论

注册时间:2012-01-14

  • 博文量
    98
  • 访问量
    1025045