In this Blog, we are discussing about how to change the location of Redolog file along with the Name Change.
Rename the folder itself; Open the sln file with a text editor like notepad and do a Find&Replace to replace the old name with the new name. Note: You can also remove the wrong project inside Soluton Explorer and add the correct one back. Step 3: Executable or Library Name. Rename function in C/C. Rename function is used to change the name of the file or directory i.e. From oldname to newname without changing the content present in the file. This function takes name of the file as its argument. If newname is the name of an existing file in the same folder then the function may either fail or override the. A directory is a special kind of file, but it is still a (case sensitive!) file.Each terminal window (for example /dev/pts/4), any hard disk or partition (for example /dev/sdb1) and any process are all represented somewhere in the file system as a file.
This Blog can be used to change the name of redo log file at same location or different location.
So we will find out the location of the existing redo log file:
SQL> select member from v$logfile;
MEMBER
———————————————————————————————————————————-
/u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_3_cgf7hpvy_.log
/u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_3_cgf7hpx9_.log
/u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_2_cgf7hmvc_.log
/u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_2_cgf7hmx1_.log
/u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_1_cgf7hk1t_.log
/u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_1_cgf7hk4f_.log
6 rows selected.
SQL>
As per our previous posts, we change the database name from CDB2 to CDB3, however the location of these files does not change with the database name change, we have to do it later with the extra steps.
Find out the log files using OS Commands:
SQL> host ls -lrt /u01/app/oracle/oradata/CDB2/onlinelog
total 153792
-rw-r—– 1 oracle oinstall 52429312 Apr 3 06:30 o1_mf_1_cgf7hk1t_.log
-rw-r—– 1 oracle oinstall 52429312 Apr 3 10:30 o1_mf_2_cgf7hmvc_.log
-rw-r—– 1 oracle oinstall 52429312 Apr 3 13:50 o1_mf_3_cgf7hpvy_.log
SQL>
SQL> host ls -lrt /u01/app/oracle/fast_recovery_area/CDB2/onlinelog
total 153792
-rw-r—– 1 oracle oinstall 52429312 Apr 3 06:30 o1_mf_1_cgf7hk4f_.log
-rw-r—– 1 oracle oinstall 52429312 Apr 3 10:30 o1_mf_2_cgf7hmx1_.log
-rw-r—– 1 oracle oinstall 52429312 Apr 3 13:50 o1_mf_3_cgf7hpx9_.log
SQL>
Create the directories, where we are planning to keep the new files:
SQL> host mkdir /u01/app/oracle/oradata/cdb3/onlinelog
SQL> host mkdir /u01/app/oracle/fast_recovery_area/cdb3/onlinelog
Shutdown the database now and using OS command copy the files with the new name on the new location:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> host cp /u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_3_cgf7hpvy_.log /u01/app/oracle/oradata/cdb3/onlinelog/redo01a.log
SQL> host cp /u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_3_cgf7hpx9_.log /u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo01b.log
SQL> host cp /u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_2_cgf7hmvc_.log /u01/app/oracle/oradata/cdb3/onlinelog/redo02a.log
SQL> host cp /u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_2_cgf7hmx1_.log /u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo02b.log
SQL> host cp /u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_1_cgf7hk1t_.log /u01/app/oracle/oradata/cdb3/onlinelog/redo03a.log
SQL> host cp /u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_1_cgf7hk4f_.log /u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo03b.log
SQL>
After you create the file, we have to start the database in mount stage and alter the location of these log files:
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2516582400 bytes
Fixed Size 2927528 bytes
Variable Size 671089752 bytes
Database Buffers 1828716544 bytes
Redo Buffers 13848576 bytes
Database mounted.
SQL>
SQL> ALTER DATABASE RENAME FILE ‘/u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_3_cgf7hpvy_.log’ to ‘/u01/app/oracle/oradata/cdb3/onlinelog/redo01a.log’;
Database altered.
SQL> ALTER DATABASE RENAME FILE ‘/u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_3_cgf7hpx9_.log’ to ‘/u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo01b.log’;
Database altered.
SQL> ALTER DATABASE RENAME FILE ‘/u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_2_cgf7hmvc_.log’ to ‘/u01/app/oracle/oradata/cdb3/onlinelog/redo02a.log’;
Database altered.
SQL> ALTER DATABASE RENAME FILE ‘/u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_2_cgf7hmx1_.log’ to ‘/u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo02b.log’;
Database altered.
SQL> ALTER DATABASE RENAME FILE ‘/u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_1_cgf7hk1t_.log’ to ‘/u01/app/oracle/oradata/cdb3/onlinelog/redo03a.log’;
Database altered.
Rename Files In Dev Chrome
SQL> ALTER DATABASE RENAME FILE ‘/u01/app/oracle/fast_recovery_area/CDB2/onlinelog/o1_mf_1_cgf7hk4f_.log’ to ‘/u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo03b.log’;
Database altered.
SQL>
After we rename the files using alter command, we have the new location in the controlfile to pick up. So its time to open the database:
SQL> alter database open;
Database altered.
SQL>
Rename Files In Dev Command
Finally check the location of Redo Log File:
SQL> select member from v$logfile;
MEMBER
———————————————————————–
/u01/app/oracle/oradata/cdb3/onlinelog/redo01a.log
/u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo01b.log
/u01/app/oracle/oradata/cdb3/onlinelog/redo02a.log
/u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo02b.log
/u01/app/oracle/oradata/cdb3/onlinelog/redo03a.log
/u01/app/oracle/fast_recovery_area/cdb3/onlinelog/redo03b.log
6 rows selected.
SQL>
Rename Files In Dev C++
Thanks for watching.
Rename Files In Dev Console
Let me know if any questions.