In today’s article we will be learning how to Move Redo Log File in oracle database.
Moving Redo Log files with the database open is dangerous work. Therefore, it is not recommended.
The database is closed;
1 2 3 4 | SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. |
Redo Log files are moved to the desired location in the operating system. (I’m just going to change the name here)
First go to the file location;
1 | $ cd /u01/app/oracle/oradata/traindb |
We then move or change the name;
1 | $ cp redo04.log redo04a.log |
The database opens in MOUNT mode;
1 2 3 4 5 6 7 8 9 | SQL> startup mount; ORACLE instance started. Total System Global Area 2488635392 bytes Fixed Size 2215904 bytes Variable Size 1577058336 bytes Database Buffers 889192448 bytes Redo Buffers 20168704 bytes Database mounted. |
New locations or names of Redo Log files are written to the Control File;
1 2 3 | SQL> alter database rename file '/u01/app/oracle/oradata/traindb/redo04.log' to '/u01/app/oracle/oradata/traindb/redo04a.log'; Database altered. |
We put the database in OPEN mode;
1 2 3 | SQL> alter database open; Database altered. |
Let’s check and see if it’s changed;
1 2 3 4 5 | SQL> select group#, member, status from v$logfile where group#=4; GROUP# MEMBER -------------------------------------------------------------------------------- 4 /u01/app/oracle/oradata/traindb/redo04a.log |