单个归档目录满导致数据库hang的问题
归档多路径,防止单点故障
LOG_ARCHIVE_DEST_n ---使用LOG_ARCHIVE_DEST_n参数定义多个归档路径
log_archive_min_succeed_dest
如果要解决归档空间满或者某路径归档满的问题,可以设置两个归档路径,路径为可选optional,且log_archive_min_succeed_dest参数设置为1,即可解决相关问题。缺点是两个目录都正常情况下,需要归档两份归档日志。具体实验步骤如下:
1,修改为多路径模式,每个路径为可选,但至少一个是成功才可以日志覆盖:
SQL> alter systemset log_archive_dest_1='location=/oracle/archive/arch1 optional'; System altered. SQL> alter systemset log_archive_dest_2='location=/oracle/archive/arch2 optional'; System altered. SQL> showparameter log_archive_min_succeed_dest NAME TYPE VALUE ----------------------------------------------- ------------------------------ log_archive_min_succeed_dest integer 1
2,经过多档测试,均可成功进行归档:
SQL> alter systemswitch logfile; System altered. [root@dtydb0 arch1]#ls -l /oracle/archive/arch* /oracle/archive/arch1: total 389564 -rw-r----- 1 oracle oinstall 397999616 May 14 17:05 1_211_740745127.dbf -rw-r----- 1 oracle oinstall 507904 May 14 17:06 1_212_740745127.dbf /oracle/archive/arch2: total 389564 -rw-r----- 1 oracle oinstall 397999616 May 14 17:05 1_211_740745127.dbf -rw-r----- 1 oracle oinstall 507904 May 14 17:06 1_212_740745127.dbf
3,修改arch1的权限,是不能归档到arch1,继续归档,发现只能归档到arch2,当数据库归档正常。
[root@dtydb0archive]# chown -R root:root ./arch1 [root@dtydb0archive]# ls -lrt SQL> alter systemswitch logfile; System altered. [root@dtydb0archive]# ls -l /oracle/archive/arch* /oracle/archive/arch1: total 389564 -rw-r----- 1 root root 397999616 May 14 17:05 1_211_740745127.dbf -rw-r----- 1 root root 507904 May 14 17:06 1_212_740745127.dbf /oracle/archive/arch2: total 390272 -rw-r----- 1 oracle oinstall 397999616 May 14 17:05 1_211_740745127.dbf -rw-r----- 1 oracle oinstall 507904 May 14 17:06 1_212_740745127.dbf -rw-r----- 1 oracle oinstall 351744 May 14 17:08 1_213_740745127.dbf -rw-r----- 1 oracle oinstall 332800 May 14 17:08 1_214_740745127.dbf -rw-r----- 1 oracle oinstall 2560 May 14 17:08 1_215_740745127.dbf -rw-r----- 1 oracle oinstall 6656 May 14 17:08 1_216_740745127.dbf
4,修改回权限,2个路径的归档又恢复正常
[root@dtydb0archive]# chown -R oracle:oinstall /oracle/archive/arch1 [root@dtydb0archive]# ls -l /oracle/archive/arch* /oracle/archive/arch1: total 389788 -rwxr-xr-x 1 oracle oinstall 397999616 May 14 17:05 1_211_740745127.dbf -rwxr-xr-x 1 oracle oinstall 507904 May 14 17:06 1_212_740745127.dbf -rw-r----- 1 oracle oinstall 220672 May 14 17:14 1_219_740745127.dbf /oracle/archive/arch2: total 391464 -rw-r----- 1 oracle oinstall 397999616 May 14 17:05 1_211_740745127.dbf -rw-r----- 1 oracle oinstall 507904 May 14 17:06 1_212_740745127.dbf -rw-r----- 1 oracle oinstall 351744 May 14 17:08 1_213_740745127.dbf -rw-r----- 1 oracle oinstall 332800 May 14 17:08 1_214_740745127.dbf -rw-r----- 1 oracle oinstall 2560 May 14 17:08 1_215_740745127.dbf -rw-r----- 1 oracle oinstall 6656 May 14 17:08 1_216_740745127.dbf -rw-r----- 1 oracle oinstall 628736 May 14 17:11 1_217_740745127.dbf -rw-r----- 1 oracle oinstall 342528 May 14 17:12 1_218_740745127.dbf -rw-r----- 1 oracle oinstall 220672 May 14 17:14 1_219_740745127.dbf