oracle rac--归档日志的开启方法
==================================
10g r1 要修改cluster_database参数 ,10g r2和以后的版本就不需要了
1. 例子(10g r1或之前):
srvctl stop database -d rac
节点1
sql>startup mount
sql> alter system set log_archive_dest_1='location=/racdb1_arch' scope=spfile sid='rac1';
sql> alter system set log_archive_dest_1='location=/racdb2_arch' scope=spfile sid='rac2';
sql> alter system set log_archive_dest_2='service=rac2' scope=spfile sid='rac1';
sql> alter system set log_archive_dest_2='service=rac1' scope=spfile sid='rac2';
sql> alter system set standby_archive_dest='/racdb2_arch' scope=spfile sid='rac1';
sql> alter system set standby_archive_dest='/racdb1_arch' scope=spfile sid='rac2';
sql>alter system set cluster_database=false scope=spfile;
sql>shutdown immediate
sql>startup mount
sql>alter database archivelog
sql>alter database open
sql>alter system set cluster_database=true scope=spfile;
sql>shutdown immediate
srvctl start database -d rac
2. 例子(10g r2或之后):
节点1
sql>startup mount;
sql> alter system set log_archive_dest_1='location=/racdb1_arch' scope=spfile sid='rac1';
sql> alter system set log_archive_dest_1='location=/racdb2_arch' scope=spfile sid='rac2';
sql> alter system set log_archive_dest_2='service=rac2' scope=spfile sid='rac1';
sql> alter system set log_archive_dest_2='service=rac1' scope=spfile sid='rac2';
sql> alter system set standby_archive_dest='/racdb2_arch' scope=spfile sid='rac1';
sql> alter system set standby_archive_dest='/racdb1_arch' scope=spfile sid='rac2';
srvctl stop database -d rac
节点1
sql> startup mount
sql> alter database archivelog;
srvctl start database -d rac
3. 测试归档日志的切换:
节点一,二上分别执行切换日志操作如下:
sql> alter system switch logfile; 操作执行这条语句5次
节点一查询:
sql> !ls -l /racdb*
/racdb1_arch:
total 1072
-rw-r----- 1 oracle oinstall 93696 oct 7 08:57 1_82_762368314.dbf
-rw-r----- 1 oracle oinstall 980992 oct 7 09:10 1_83_762368314.dbf
-rw-r----- 1 oracle oinstall 1536 oct 7 09:10 1_84_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 oct 7 09:10 1_85_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 oct 7 09:10 1_86_762368314.dbf
/racdb2_arch:
total 980
-rw-rw---- 1 oracle oinstall 166400 oct 7 08:56 2_57_762368314.dbf
-rw-rw---- 1 oracle oinstall 811520 oct 7 09:10 2_58_762368314.dbf
-rw-rw---- 1 oracle oinstall 2560 oct 7 09:10 2_59_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 oct 7 09:10 2_60_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 oct 7 09:10 2_61_762368314.dbf
节点二查询:
sql> !ls -l /racdb*
/racdb1_arch:
total 1072
-rw-rw---- 1 oracle oinstall 93696 oct 7 08:57 1_82_762368314.dbf
-rw-rw---- 1 oracle oinstall 980992 oct 7 09:10 1_83_762368314.dbf
-rw-rw---- 1 oracle oinstall 1536 oct 7 09:10 1_84_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 oct 7 09:10 1_85_762368314.dbf
-rw-rw---- 1 oracle oinstall 1024 oct 7 09:10 1_86_762368314.dbf
/racdb2_arch:
total 980
-rw-r----- 1 oracle oinstall 166400 oct 7 08:56 2_57_762368314.dbf
-rw-r----- 1 oracle oinstall 811520 oct 7 09:10 2_58_762368314.dbf
-rw-r----- 1 oracle oinstall 2560 oct 7 09:10 2_59_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 oct 7 09:10 2_60_762368314.dbf
-rw-r----- 1 oracle oinstall 1024 oct 7 09:10 2_61_762368314.dbf
节点一:
sql> show parameter archive_dest
name type value
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/racdb1_arch
log_archive_dest_10 string
log_archive_dest_2 string service=rac2
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
standby_archive_dest string /racdb2_arch
节点二:
sql> show parameter archive_dest
name type value
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string location=/racdb2_arch
log_archive_dest_10 string
log_archive_dest_2 string service=rac1
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
standby_archive_dest string /racdb1_arch
===========================================
阅读(7254) | 评论(1) | 转发(1) |