Moving/Renaming Redo Log Files

It is possible to move/rename the online redo logs should the need arise. This document will detail the steps required to move/rename the online redo logs in an 11gR2 environment on Linux. These steps also apply to a 10g environment.

First we will verify the current location of the online redo log files.

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u02/app/oracle/oradata/orcl/redo03.log
/u02/app/oracle/oradata/orcl/redo02.log
/u02/app/oracle/oradata/orcl/redo01.log

SQL>

We are going to move the online redo logs from /u02/app/oracle/oradata/orcl to /u02/app/oracle/oradata/orcl/redo. The redo logs cannot be moved/renamed while the database is online. The database must be in a mount state to move/rename the online redo logs.

First we will shutdown the database and move the online redo logs to their new location.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host
[oracle@ora1 ~]$ mv /u02/app/oracle/oradata/orcl/redo01.log /u02/app/oracle/oradata/orcl/redo/redo01.log
[oracle@ora1 ~]$ mv /u02/app/oracle/oradata/orcl/redo02.log /u02/app/oracle/oradata/orcl/redo/redo02.log
[oracle@ora1 ~]$ mv /u02/app/oracle/oradata/orcl/redo03.log /u02/app/oracle/oradata/orcl/redo/redo03.log
[oracle@ora1 ~]$ exit
exit

SQL> 

Next we bring up the database into mount mode and issue ALTER DATABASE RENAME FILE statements to update the data dictionary and control files. The last thing we do is open the database.

SQL> startup mount
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             528485968 bytes
Database Buffers          314572800 bytes
Redo Buffers                5132288 bytes
Database mounted.
SQL> alter database rename file '/u02/app/oracle/oradata/orcl/redo01.log' to '/u02/app/oracle/oradata/orcl/redo/redo01.log';

Database altered.

SQL> alter database rename file '/u02/app/oracle/oradata/orcl/redo02.log' to '/u02/app/oracle/oradata/orcl/redo/redo02.log';

Database altered.

SQL> alter database rename file '/u02/app/oracle/oradata/orcl/redo03.log' to '/u02/app/oracle/oradata/orcl/redo/redo03.log';

Database altered.

SQL> alter database open;

Database altered.

SQL> 

We can see that the changes were made in the data dictionary by issuing the following query again.

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u02/app/oracle/oradata/orcl/redo/redo03.log
/u02/app/oracle/oradata/orcl/redo/redo02.log
/u02/app/oracle/oradata/orcl/redo/redo01.log

SQL> 

3 thoughts on “Moving/Renaming Redo Log Files”

Leave a Reply

Your email address will not be published. Required fields are marked *