You are on page 1of 4

NNLO TLNO

a _^ = = =l q ^ = ~

Oracle OCA Courses


Find Top Oracle Institutes in India Get info on Courses,Admissions,Fees Shiksha.com/Oracle-OCA-Course

DBA Tips Archive for Oracle

Resizing / Recreating Online Redo Log Files


by Jeff Hunter, Sr. Database Administrator

One of the best ways I have found to resize or recreate online redo log files and keep the current sequence is to perform it online. In this example, we will resize all online redo logs from 100MB to 250MB while the database is running and use SQL*Plus to drop/recreate them in stages. Before looking at the tasks involved to perform the resize, let's look at the current online redo log groups and their sizes:

SL SLC agop,amme,bbts Q> EET .ru# .ebr .ye 2 FO vlgiea vlgbWEEagop =bgop; RM $ofl , $o HR .ru# .ru# GOP MME RU# EBR BTS YE ----- -------------------- ---------- -------------------- -----1/0/p/rdt/R90rd_0alg u3apoaaaOA2/eog1.o 148760 0,5,0 1/0/p/rdt/R90rd_0blg u4apoaaaOA2/eog1.o 148760 0,5,0 1/0/p/rdt/R90rd_0clg u5apoaaaOA2/eog1.o 148760 0,5,0 2/0/p/rdt/R90rd_0alg u3apoaaaOA2/eog2.o 148760 0,5,0 2/0/p/rdt/R90rd_0blg u4apoaaaOA2/eog2.o 148760 0,5,0 2/0/p/rdt/R90rd_0clg u5apoaaaOA2/eog2.o 148760 0,5,0 3/0/p/rdt/R90rd_0alg u3apoaaaOA2/eog3.o 148760 0,5,0 3/0/p/rdt/R90rd_0blg u4apoaaaOA2/eog3.o 148760 0,5,0 3/0/p/rdt/R90rd_0clg u5apoaaaOA2/eog3.o 148760 0,5,0 9rw slce. os eetd Now let's take a look at the steps involved to resize / recreate all online redo log groups: 1. Make the last redo log CURRENT Force a log switch until the last redo log is marked "CURRENT" by issuing the following command:

SL slc gop,sau fo vlg Q> eet ru# tts rm $o; GOP SAU RU# TTS ----- ------------ -------1CRET URN 2IATV NCIE 3IATV NCIE SL atrsse sic lgie Q> le ytm wth ofl; SL atrsse sic lgie Q> le ytm wth ofl; SL slc gop,sau fo vlg Q> eet ru# tts rm $o;

K K L~~Ll La _^ | ~ La ~~~| ^ La _^ | PQ ~ K

NLQ

NNLO TLNO

a _^ = = =l q ^ = ~

GOP SAU RU# TTS ----- ------------ -------1IATV NCIE 2IATV NCIE 3CRET URN 2. Drop first redo log After making the last online redo log file the CURRENT one, drop the first online redo log:

SL atrdtbs do lgiegop1 Q> le aaae rp ofl ru ; Dtbs atrd aaae lee.

As a DBA, you should already be aware that if you are going to drop a logfile group, it cannot be the current logfile group. I have run into instances; however, where attempting to drop the logfile group resulted in the following error as a result of the logfile group having an active status: SL ATRDTBS DO LGIEGOP1 Q> LE AAAE RP OFL RU ; ATRDTBS DO LGIEGOP1 LE AAAE RP OFL RU * ERRa ln 1 RO t ie : OA064 lg1nee frcahrcvr o isac OA2 (hed1 R-12: o edd o rs eoey f ntne R90 tra ) OA032 oln lg1tra 1 'fl_ae' R-01: nie o hed : <ienm> Easy problem to resolve. Simply perform a checkpoint on the database: SL ATRSSE CEKON GOA; Q> LE YTM HCPIT LBL Sse atrd ytm lee. SL ATRDTBS DO LGIEGOP1 Q> LE AAAE RP OFL RU ; Dtbs atrd aaae lee.

3. Re-create dropped online redo log group Re-create the dropped redo log group with different size (if desired):

SL atrdtbs adlgiegop1( Q> le aaae d ofl ru 2 'u3apoaaaOA2/eog1.o' /0/p/rdt/R90rd_0alg, 3 'u4apoaaaOA2/eog1.o' /0/p/rdt/R90rd_0blg, 4 'u5apoaaaOA2/eog1.o' sz 20 rue /0/p/rdt/R90rd_0clg) ie 5m es; Dtbs atrd aaae lee. 4. Force another log switch After re-creating the online redo log group, force a log switch. The online redo log group just created should become the "CURRENT" one:

SL slc gop,sau fo vlg Q> eet ru# tts rm $o; GOP SAU RU# TTS ----- ------------ -------1UUE NSD 2IATV NCIE 3CRET URN

K K L~~Ll La _^ | ~ La ~~~| ^ La _^ | PQ ~ K

O LQ

NNLO TLNO

a _^ = = =l q ^ = ~

SL atrsse sic lgie Q> le ytm wth ofl; SL slc gop,sau fo vlg Q> eet ru# tts rm $o; GOP SAU RU# TTS ----- ------------ -------1CRET URN 2IATV NCIE 3ATV CIE 5. Loop back to Step 2 until all logs are rebuilt After re-creating an online redo log group, continue to re-create (or resize) all online redo log groups until all of them are rebuilt. After rebuilding (resizing) all online redo log groups, here is a snapshot of all physical files:

SL SLC agop,amme,bbts Q> EET .ru# .ebr .ye 2 FO vlgiea vlgbWEEagop =bgop; RM $ofl , $o HR .ru# .ru# GOP MME RU# EBR BTS YE ----- -------------------- ---------- -------------------- -----1/0/p/rdt/R90rd_0alg u3apoaaaOA2/eog1.o 221400 6,4,0 1/0/p/rdt/R90rd_0blg u4apoaaaOA2/eog1.o 221400 6,4,0 1/0/p/rdt/R90rd_0clg u5apoaaaOA2/eog1.o 221400 6,4,0 2/0/p/rdt/R90rd_0alg u3apoaaaOA2/eog2.o 221400 6,4,0 2/0/p/rdt/R90rd_0blg u4apoaaaOA2/eog2.o 221400 6,4,0 2/0/p/rdt/R90rd_0clg u5apoaaaOA2/eog2.o 221400 6,4,0 3/0/p/rdt/R90rd_0alg u3apoaaaOA2/eog3.o 221400 6,4,0 3/0/p/rdt/R90rd_0blg u4apoaaaOA2/eog3.o 221400 6,4,0 3/0/p/rdt/R90rd_0clg u5apoaaaOA2/eog3.o 221400 6,4,0 9rw slce. os eetd

About the Author


Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX, Linux, and Windows server environment. Jeff's other interests include mathematical encryption theory, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 18 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science.

Copyright (c) 1998-2012 Jeffrey M. Hunter. All rights reserved.


All articles, scripts and material located at the Internet address of http://w w w .idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright law s of the United States. This document may not be hosted on any other site w ithout my express, prior, w ritten permission. Application to host any of the material elsew here can be made by contacting me at jhunter@idevelopment.info. I have made every effort and taken great care in making sure that the material included on my w eb site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property w hich may arise from relying on it. I w ill in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
K K L~~Ll La _^ | ~ La ~~~| ^ La _^ | PQ ~ K

Wednesday, 28-Dec-2011 13:57:14 EST

PLQ

NNLO TLNO

a _^ = = =l q ^ = ~

Wednesday, 28-Dec-2011 13:57:14 EST Page Count: 119175

K K L~~Ll La _^ | ~ La ~~~| ^ La _^ | PQ ~ K

Q LQ

You might also like