Database Reference
In-Depth Information
If you can't afford any downtime, consider adding new log files in the new location and then dropping the old log
files. See the section “Adding Online Redo Log Groups,” earlier in this chapter, for details on how to add a log group.
See also the section “Resizing and Dropping Online Redo Log Groups,” earlier in this chapter, for details on how to
drop a log group.
Alternatively, you can physically move the files from the OS. You can do this with the database open or closed.
If your database is open, ensure that the files you move aren't part of the current online redo log group (because
those are actively written to by the log writer background process). It's dangerous to try to do this task while your
database is open because on an active system, the online redo logs may be switching at a rapid rate, which creates the
possibility of attempting to move a file while it's being switched to be the current online redo log. Therefore, I strongly
recommend that you only try to do this while your database is closed.
The next example shows how to move the online redo log files with the database shut down. Here are the steps:
1.
Shut down your database:
SQL> shutdown immediate;
From the OS prompt, move the files. This example uses the mv command to accomplish
this task:
2.
$ mv /u02/oraredo/O12C/redo02b.rdo /u01/oraredo/O12C/redo02b.rdo
3.
Start up your database in mount mode:
SQL> startup mount;
4.
Update the control file with the new file locations and names:
SQL> alter database rename file '/u02/oraredo/O12C/redo02b.rdo'
to '/u01/oraredo/O12C/redo02b.rdo';
5.
Open your database:
SQL> alter database open;
You can verify that your online redo logs are in the new locations by querying the V$LOGFILE view. I recommend
as well that you switch your online redo logs several times and then verify from the OS that the files have recent
timestamps. Also check the alert.log file for any pertinent errors.
Implementing Archivelog Mode
Recall from the discussion earlier in this chapter that archive redo logs are created only if your database is in
archivelog mode. If you want to preserve your database transaction history to facilitate point-in-time and other types
of recovery, you need to enable that mode.
In normal operation, changes to your data generate entries in the database redo log files. As each online redo
log group fills up, a log switch is initiated. When a log switch occurs, the log writer process stops writing to the most
recently filled online redo log group and starts writing to a new online redo log group. The online redo log groups
are written to in a round-robin fashion—meaning the contents of any given online redo log group will eventually be
overwritten. Archivelog mode preserves redo data for the long term by employing an archiver background process to
copy the contents of a filled online redo log to what is termed an archive redo log file . The trail of archive redo log files
is crucial to your ability to recover the database with all changes intact, right up to the precise point of failure.
 
Search WWH ::




Custom Search