행위

Redo aws 사이즈조정

DB CAFE

Dbcafe (토론 | 기여)님의 2019년 8월 19일 (월) 18:54 판 (새 문서: Query V$LOG to see the logs.: You start with 4 logs of 128 MB each.: select GROUP#, BYTES, STATUS from V$LOG; GROUP# BYTES STATUS ---------- ---------- -...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
thumb_up 추천메뉴 바로가기


/* Query V$LOG to see the logs. */ /* You start with 4 logs of 128 MB each. */

select GROUP#, BYTES, STATUS from V$LOG;

GROUP# BYTES STATUS


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

1 134217728 INACTIVE 2 134217728 CURRENT 3 134217728 INACTIVE 4 134217728 INACTIVE


/* Add four new logs that are each 512 MB */

exec rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); exec rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); exec rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); exec rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912);


/* Query V$LOG to see the logs. */ /* Now there are 8 logs. */

select GROUP#, BYTES, STATUS from V$LOG;

GROUP# BYTES STATUS


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

1 134217728 INACTIVE 2 134217728 CURRENT 3 134217728 INACTIVE 4 134217728 INACTIVE 5 536870912 UNUSED 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED


/* Drop each inactive log using the group number. */

exec rdsadmin.rdsadmin_util.drop_logfile(grp => 1); exec rdsadmin.rdsadmin_util.drop_logfile(grp => 3); exec rdsadmin.rdsadmin_util.drop_logfile(grp => 4);


/* Query V$LOG to see the logs. */ /* Now there are 5 logs. */

select GROUP#, BYTES, STATUS from V$LOG;

GROUP# BYTES STATUS


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

2 134217728 CURRENT 5 536870912 UNUSED 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED


/* Switch logs so that group 2 is no longer current. */

exec rdsadmin.rdsadmin_util.switch_logfile;


/* Query V$LOG to see the logs. */ /* Now one of the new logs is current. */

SQL>select GROUP#, BYTES, STATUS from V$LOG;

GROUP# BYTES STATUS


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

2 134217728 ACTIVE 5 536870912 CURRENT 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED


/* Issue a checkpoint to clear log 2. */

exec rdsadmin.rdsadmin_util.checkpoint;


/* Query V$LOG to see the logs. */ /* Now the final original log is inactive. */

select GROUP#, BYTES, STATUS from V$LOG;

GROUP# BYTES STATUS


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

2 134217728 INACTIVE 5 536870912 CURRENT 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED


  1. Drop the final inactive log.

exec rdsadmin.rdsadmin_util.drop_logfile(grp => 2);


/* Query V$LOG to see the logs. */ /* Now there are four 512 MB logs. */

select GROUP#, BYTES, STATUS from V$LOG;

GROUP# BYTES STATUS


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

5 536870912 CURRENT 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED