data guard 歸檔日誌管理 (primary)
主庫歸檔管理:
1、 用SHELL指令碼,取歸檔已被APP的。然後刪除已經APP的歸檔。
2、 用RMAN 備份策略管理:oracle 自帶的策略:
RMAN> configure archivelog deletion policy to applied on standby;
有報錯,解決方法:
SQL>alter system set "_log_deletion_policy"=ALL scope=spfile sid='*';
Oracle 在刪除已經備份完的歸檔時,會看下是否已經被APP 沒有APP的就不刪除。
3、利用RMAN備份的時間點和刪除時間點分離,這樣就給了資料庫一段時間內的歸檔冗餘,在這段時間內備庫應該可以把歸檔應用了這個時間點可以儘量長一些。
這個方案雖然不夠嚴謹,但是可以解決一些實際問題。
下面是方案:
4點 full.sh
3點 delete.sh
[ora@dg-pp ~]$ cat full.sh
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
#--------------------------------------
# Set for Oracle10g Install 20101015;
#--------------------------------------
trap " " 0 1 2 3 5 9 15
trap clear 0
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=research
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_ASSUME_KERNEL=2.6.9
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF8
export LANG=en_US.UTF8
umask 022
#
if [ $USER = "ora" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
#------------------- Set Over
全庫備庫,不刪除多餘的備份和歸檔日誌。
rman target / nocatalog log=/rman/log/rman_db_full.log <
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
backup ( database
include current controlfile
filesperset=2
format '/rman/data/full_data_%s_%p'
tag="fullbackup_data");
backup ( archivelog all
filesperset=4
format '/rman/arch/arch_%s_%p'
tag="fullbackup_arch");
release channel d1;
release channel d2;
release channel d3;
crosscheck backup;
}
exit
EOF
0級資料壓縮備份,不刪除多餘的備份和歸檔。
rman target / nocatalog log=/u01/rman/log/rman_db_level0.log <
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
backup as compressed backupset incremental level 0 database filesperset 4 format
'/u01/rman/data/level0_%d_%s_%p_%u_%T.bak' include current controlfile;
sql 'alter system archive log current';
backup archivelog all filesperset 10 format '/u01/rman/arch/arc_%d_%s_%p_%u_%T.bak';
release channel d1;
release channel d2;
release channel d3;
crosscheck backup;
}
exit
EOF
[ora@dg-pp ~]$ cat delete.sh
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
#--------------------------------------
# Set for Oracle10g Install 20101015;
#--------------------------------------
trap " " 0 1 2 3 5 9 15
trap clear 0
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=research
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_ASSUME_KERNEL=2.6.9
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF8
export LANG=en_US.UTF8
umask 022
#
if [ $USER = "ora" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
#------------------- Set Over
rman target / nocatalog log=/u01/rman/log/rman_db_delete.log <
run {
crosscheck backup;
delete noprompt expired backup ;
delete noprompt obsolete;}
exit
EOF
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-721392/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- data guard 歸檔日誌管理 (standby)
- 刪除data guard歸檔日誌
- Oracle 11g Data Guard 備庫歸檔日誌清理指令碼(保留一週歸檔)Oracle指令碼
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 日誌檔案和歸檔管理
- Oracle歸檔日誌管理技巧Oracle
- oracle之 Oracle歸檔日誌管理Oracle
- Oracle archive log 歸檔日誌管理OracleHive
- Script to Collect Data Guard Primary Site Diagnostic InformationORM
- 歸檔日誌
- Data Guard跳歸檔恢復的案例
- oracle11G歸檔日誌管理Oracle
- 8.管理歸檔日誌(筆記)筆記
- oracle歸檔日誌Oracle
- Oracle 歸檔日誌Oracle
- 歸檔日誌挖掘
- PostgreSQL 歸檔日誌SQL
- Oracle RAC中使用RMAN管理歸檔日誌Oracle
- Oracle Data Guard 主庫歸檔檔案刪除策略Oracle
- Oracle Data Guard 主庫 歸檔檔案 刪除策略Oracle
- DATA GUARD手工管理資料檔案
- oracle10g data guard(dg)__歸檔日誌備份刪除相關策略_rman_configureOracle
- DATA GUARD部署模式——DATA GUARD概念和管理模式
- Data guard 中 alert 日誌報錯 "FAL archive failed"HiveAI
- 控制檔案/歸檔日誌
- Oracle Data Guard 主庫 歸檔檔案 刪除策略--續Oracle
- 歸檔日誌多歸檔路徑 duplex
- 歸檔oracle alert日誌Oracle
- 14. 日誌歸檔
- PostgreSQL歸檔日誌配置SQL
- rman清理歸檔日誌
- archive log 歸檔日誌Hive
- 備份歸檔日誌
- 歸檔日誌 現象
- Oracle歸檔日誌清理Oracle
- 介紹ORACLE DATA GUARD——DATA GUARD概念和管理Oracle
- 當ORACLE歸檔日誌滿後如何正確刪除歸檔日誌Oracle
- 用RMAN備份歸檔日誌時檢查歸檔日誌是否存在