use below script to quickly resize the redolog size. you can also automate this script easily by adding some more steps. but when doing you need to be careful.
before using below script make sure you have correct redo entries in the highlighted red color.
step 1:-
before starting the process make sure you do these 2 steps.
alter system switch logfile;
alter system checkpoint global;
step 2:-
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group#;
set heading off
select '##### STEP_1: Check point issued before starting the process' from dual;
set heading on
alter system switch logfile;
alter system checkpoint global;
set heading off
select '######STEP_2: Redologs groups info with Inactive status' from dual;
set heading on
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group# and b.status = 'INACTIVE';
set heading off
select '######: Redologs groups info with Active status' from dual;
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group# and b.status !='INACTIVE';
select '###### STEP_3: Now dropping the redolog groups which are INACTIVE' from dual;
--set heading on
select 'alter database drop logfile group '||GROUP#||';' from v$log where status='INACTIVE';
before using below script make sure you have correct redo entries in the highlighted red color.
step 1:-
before starting the process make sure you do these 2 steps.
alter system switch logfile;
alter system checkpoint global;
step 2:-
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group#;
set heading off
select '##### STEP_1: Check point issued before starting the process' from dual;
set heading on
alter system switch logfile;
alter system checkpoint global;
set heading off
select '######STEP_2: Redologs groups info with Inactive status' from dual;
set heading on
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group# and b.status = 'INACTIVE';
set heading off
select '######: Redologs groups info with Active status' from dual;
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group# and b.status !='INACTIVE';
select '###### STEP_3: Now dropping the redolog groups which are INACTIVE' from dual;
--set heading on
select 'alter database drop logfile group '||GROUP#||';' from v$log where status='INACTIVE';
set heading off
select '#### STEP_4: Generating scripts for New Redolog Resize' from dual;
set heading on
set serveroutput ON
@redo_auto_script.sql
set heading off
select '#### STEP_5: Confirming active redolog at this moment and will change later' from dual;
set heading on
SELECT a.group#, a.member,b.status, b.bytes/1024/1024 Size_in_MB FROM v$logfile a,v$log b WHERE a.group# = b.group# and b.status in ('ACTIVE','CURRENT');
Hope this helps and saves your time.......
No comments:
Post a Comment