11g RAC 歸檔與非歸檔的切換
11g RAC 歸檔與非歸檔的切換
非歸檔------->歸檔
1.設置歸檔路徑
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.關閉所有實例
shutdown immediate
3.設置歸檔
SYS@rac1> startup mount
SYS@rac1> alter database archivelog;
4.打開數據庫
SYS@rac1> alter database open;
5。兩個節點驗證
節點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
節點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關閉數據庫
[oracle@rac1 ~]$ srvctl stop database -d rac
2.其中一個節點操作
SYS@rac1> startup mount;
SYS@rac1> alter database noarchivelog;
SYS@rac1> alter database open;
3.驗證
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/
已經刪除