11g rac 修改redo日志的大小

11grac修改redo日志的大小

1.查看当前redo日志的情况

sys@RACDB>SELECT l.group#, l.thread#, f.member, l.archived, l.status, (bytes/1024/1024) size_mb FROM v$log l,v$logfile f WHERE f.group# = l.group# ORDER BY 1,2;

11g rac 修改redo日志的大小

2.执行以下语句,创建新的日志组,作为过渡日志组

alter database add logfile thread 1 group 5 ('+DATA/racdb/onlinelog/group_5_1.log') size 100M;

alter database add logfile thread 1 group 6 ('+DATA/racdb/onlinelog/group_6_1.log') size 100M;

alter database add logfile thread 2 group 7 ('+DATA/racdb/onlinelog/group_7_1.log') size 100M;

alter database add logfile thread 2 group 8 ('+DATA/racdb/onlinelog/group_8_1.log') size 100M;

3.多次切换日志组,直到要替换的日志组变为INACTIVE状态(所有节点执行)

sys@RACDB>alter system switch logfile;

sys@RACDB>select group#,THREAD#,status,archived,bytes/1024/1024 MB from v$log; GROUP# THREAD# STATUS ARC MB

------ ------- ---------- --- ----------

1 1 INACTIVE YES 50

2 1 INACTIVE YES 50

3 2 INACTIVE NO 50

4 2 INACTIVE YES 50

5 1 ACTIVE YES 100

6 1 CURRENT NO 100

7 2 INACTIVE YES 100

8 2 INACTIVE YES 100

4.删除日志组1,2,3,4

sys@RACDB>alter database drop logfile group 1;

sys@RACDB>alter database drop logfile group 2;

sys@RACDB>alter database drop logfile group 3;

sys@RACDB>alter database drop logfile group 4;

sys@RACDB>select group#,THREAD#,status,archived,bytes/1024/1024 MB from v$log;

GROUP# THREAD# STATUS ARCHIVED MB

------ ------- ---------- ---------- ----------

5 1 ACTIVE YES 100

6 1 CURRENT NO 100

7 2 INACTIVE YES 100

8 2 INACTIVE YES 100

5.重新添加日志组1,2,3,4分配日志文件大小为100MB

alter database add logfile thread 1 group 1 ('+DATA/racdb/onlinelog/group_1_1.log','+FRA/racdb/onlinelog/group_1_2.log') size 100M;

alter database add logfile thread 1 group 2 ('+DATA/racdb/onlinelog/group_2_1.log','+FRA/racdb/onlinelog/group_2_2.log') size 100M;

alter database add logfile thread 2 group 3 ('+DATA/racdb/onlinelog/group_3_1.log','+FRA/racdb/onlinelog/group_3_2.log') size 100M;

alter database add logfile thread 2 group 4 ('+DATA/racdb/onlinelog/group_4_1.log','+FRA/racdb/onlinelog/group_4_2.log') size 100M;

添加玩后,查看日志组

sys@RACDB>select group#,THREAD#,status,archived,bytes/1024/1024 MB from v$log;

GROUP# THREAD# STATUS ARCHIVED MB

------ ------- ---------- ---------- ----------

1 1 CURRENT NO 100

2 1 INACTIVE YES 100

3 2 UNUSED YES 100

4 2 UNUSED YES 100

5 1 INACTIVE YES 100

6 1 INACTIVE YES 100

7 2 CURRENT NO 100

8 2 INACTIVE YES 100

6.切换日志组,使日志组5,6,7,8变为INACTIVE

sys@RACDB>alter system switch logfile;

sys@RACDB>select group#,THREAD#,status,archived,bytes/1024/1024 MB from v$log;

GROUP# THREAD# STATUS ARCHIVED MB

------ ------- ---------- ---------- ----------

1 1 CURRENT NO 100

2 1 INACTIVE YES 100

3 2 INACTIVE YES 100

4 2 CURRENT NO 100

5 1 INACTIVE YES 100

6 1 INACTIVE YES 100

7 2 INACTIVE YES 100

8 2 INACTIVE YES 100

7.删除过渡日志组5,6,7,8

sys@RACDB>alter database drop logfile group 5;

sys@RACDB>alter database drop logfile group 6;

sys@RACDB>alter database drop logfile group 7;

sys@RACDB>alter database drop logfile group 8;

8.最后查看修改后的日志情况

11g rac 修改redo日志的大小

相关推荐
相关主题
热门推荐