Remove or Relocate Online Redo Log Files and Groups

  • Upload
    nassr50

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

  • 8/9/2019 Remove or Relocate Online Redo Log Files and Groups

    1/3

    Sunday July 31, 2011

    How To Add, Remove or Relocate Online Redo Log File and !rou"

    To protect against a failure involving the redo log itself, Oracle Database allows a

    multiplexed redo log, meaning that two or more identical copies of the redo log can be

    automatically maintained in separate locations. For the most benefit, these locations

    should be on separate disks. Even if all copies of the redo log are on the same disk,

    however, the redundancy can help protect against !O errors, file corruption, and so

    on. "hen redo log files are multiplexed, #$"% concurrently writes the same redo

    log information to multiple identical redo log files, thereby eliminating a single point

    of redo log failure.

    &ultiplexing is implemented by creating groups of redo log files. ' group consists of

    a redo log file and its multiplexed copies. Each identical copy is said to be a member

    of the group. Each number defines a redo log group. (uch as group ), group *, and so

    on. + &ore information on finding online redolog files

    1# Adding A $ew redo log !rou"

    )sql> ALTERDATABASEADDLOGFILE('/oracledata/test/redo3a.log','/test!"lt#$le%/redo3&.log'

    SIE)*+*3-*

    The command above will add a new redo log group to your database. The group will

    have two members with si-e */*01)*. ' group number will automatically be

    assigned to your new group. f you want to set it explicitly you may use command

    below.

    )sql> ALTERDATABASEADDLOGFILE TREAD - GRO01-)('/oracledata/test/redo3a.log','/test!"lt#$le%/redo3&.log' SIE)*+*3-*

    n a %'2 +%eal 'pplication 2lusters environment you have to specify which instancethe redo log group will belong to by setting thread number. Every instance in a %'2

    database has a thread number. For ex3 the command below will add the redo log group

    to instance with thread number ).

    )sql> ALTERDATABASEADDLOGFILE TREAD - GRO01-)('/oracledata/test/redo3a.log','/test!"lt#$le%/redo3&.log' SIE)*+*3-*

    2# %ro""ing A redo log !rou"

    4efore dropping a redo log group, make sure that at the moment, logwriter process is

    not writing to the redo log file you plan to drop.

    http://www.oracleportal.org/knowledge-base/high-availability/general/how-to-add,-remove-or-relocate-online-redo-log-files-and-groups.aspxhttp://www.oracleportal.org/knowledge-base/oracle-database/database-administration/general/how-to-find-location-of-online-redolog-files.aspxhttp://www.oracleportal.org/knowledge-base/oracle-database/database-administration/general/how-to-find-location-of-online-redolog-files.aspxhttp://www.oracleportal.org/knowledge-base/high-availability/general/how-to-add,-remove-or-relocate-online-redo-log-files-and-groups.aspx
  • 8/9/2019 Remove or Relocate Online Redo Log Files and Groups

    2/3

    ) sql> SELE2TGRO01, TREAD,AR2I4ED, STAT0S FRO546LOG

    !RO&'( THR)A%( AR* STAT&S

    ) ) 5E( 6'2T7E

    * ) 6O 28%%E6T

    1 ) 5E( 6'2T7E

    The value for 9'%2:7ED9 column must be 95E(9 and (T'T8( column must be

    96'2T7E9.

    f the status is 928%%E6T9 it means that logwriter is currently using this group to

    store redo records. 'fter the redo files in this group is filled it will switch to next

    group. 5ou may wait till next log switch operation or you may manually trigger it by

    command below3

    ) S7L> alters8ste! s9#tc: log;#le

    f status is 9'2T7E9 it means that there are some redo log records, which have notbeen applied to datafiles yet. The status is supposed to turn to 6'2T7E soon after

    the next checkpoint operation. f you do not want to wait till then you may manually

    trigger checkpoint by command below.

    ) sql> alters8ste! c:ec ALTERDATABASEADDLOGFILE 5E5BER '/"?*/oradata/!8d&/redo?*.log'TOGRO01*

    The above command adds a new redo log file to redo log group with number *.

    .# %ro""ing A +emer From An )-iting !rou"

  • 8/9/2019 Remove or Relocate Online Redo Log Files and Groups

    3/3

    's stated in sub=ect 1 +Dropping ' redo log $roup again the group, whose member

    you want to drop should be inactive.

    )sql> ALTERDATABASEDRO1LOGFILE 5E5BER'/"?3/oradata/!8d&/redo?3.log'

    /# Relocating A redo log !rou"

    5ou may want to relocate your existing redo log group and change the path of redo

    log files. :ere are the steps to accomplish it

    Step 1:(hutdown database

    ) sql> s:"tdo9= #!!ed#ate

    Step 2:4ackup your existing control file and redo log file at operating system level.

    Step 3:&ove your redo log member to a new location. 5ou may also change the file

    name if you want.

    ) !@ /"?*/oradata/!8d&/redo?*.log /"?3/oradata/!8d&/redo?3.log

    Step 4:(tartup in nomount mode

    ) sql> start"$ =o!o"=t

    Step 5:>ath of redo log files is kept in control file. 5ou have to update that record by

    command below3

    )sql> ALTERDATABASEREA5E FILE '/"?*/oradata/!8d&/redo?*.log'TO'/"?3/oradata/!8d&/redo?3.log'

    2ontrol file is modified and the path of redo log member is updated. 6ow you can

    open your database.

    ) sql> alterdata&aseo$e=

    's you see this way of relocating online redo log files re?uires downtime. 5ou

    may also change the path of your redo log files by adding a new group at desiredlocation and dropping the ones at former location. This approach re?uires no

    downtime.