11g RAC 歸檔與非歸檔的切換
11g RAC 歸檔與非歸檔的切換
非歸檔------->歸檔
1.設(shè)置歸檔路徑
SYS@rac1> alter system set log_archive_dest_1='LOCATION=+fra' scope=both sid='rac1';
SYS@rac2> alter system set log_archive_dest_1='LOCATION=+fra' scope=both sid='rac2';
2.關(guān)閉所有實(shí)例
shutdown immediate
3.設(shè)置歸檔
SYS@rac1> startup mount
SYS@rac1> alter database archivelog;
4.打開數(shù)據(jù)庫
SYS@rac1> alter database open;
5。兩個節(jié)點(diǎn)驗(yàn)證
節(jié)點(diǎn)1
SYS@rac1> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA
Oldest online log sequence 25
Next log sequence to archive 26
Current log sequence 26
節(jié)點(diǎn)2
SYS@rac2> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA
Oldest online log sequence 29
Next log sequence to archive 30
Current log sequence 30
6.查看歸檔文件
ASMCMD [+FRA/rac/archivelog/2018_03_23] > ls
thread_1_seq_26.263.971545091
thread_2_seq_29.261.971544421
thread_2_seq_30.262.971545055
歸檔------->非歸檔
1關(guān)閉數(shù)據(jù)庫
[oracle@rac1 ~]$ srvctl stop database -d rac
2.其中一個節(jié)點(diǎn)操作
SYS@rac1> startup mount;
SYS@rac1> alter database noarchivelog;
SYS@rac1> alter database open;
3.驗(yàn)證
SYS@rac1> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination +FRA
Oldest online log sequence 26
Current log sequence 27
SYS@rac2> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination +FRA
Oldest online log sequence 31
Current log sequence 32
使用rman 刪除歸檔
[oracle@rac1 ~]$ rman target /
RMAN> delete archivelog all;
ASMCMD [+fra/rac] > ls
CONTROLFILE/
ONLINELOG/
已經(jīng)刪除