In this tutorial we will learn what is redo logs in oracle,view oracle redo log group and members (redo log files), add redo log file in redo group,drop redo log file and redo log group in oracle.
What is redo logs in oracle
REDO log file is very essential file for Oracle database which is stored in physical filesystem of hard disk. Normally it is a file which records all changes made in oracle database .
Suppose a user modified any row using SQL query ,the changed data will be stored in redo Buffer in SGA components. Then LGWR process transferred all data from redo Buffer to redo log file under the following conditions.
1. Redo Buffer one third full
2. Every 3 seconds3. After a successful transaction committed
4. Before data blocks transfer from db buffer cache to data files.
View oracle redo log group and members (redo log files)
We can see Status of redo group and size using the dba directory table called v$log .here group 2 is current means oracle uses this group to store redo log file and group 1 and group 3 are inactive means it is no longer required to recover oracle database.
We can view oracle redo log group members using one Dba directory called v$logfile. Here under the member we find the location of the redo log file. Here redo01.log file belongs to group 1 , redo02.log file belongs to group 2 and redo03.log file belongs to group 3.
It is recommended that each group should be at least two redo log file if none redo log file is corrupted then database will be worked using other redo log file.and also two redo log files will be stored on the different disks.if one disk is corrupted then we will get second redo log file in other disk.
It is recommended that each group should be at least two redo log file if none redo log file is corrupted then database will be worked using other redo log file.and also two redo log files will be stored on the different disks.if one disk is corrupted then we will get second redo log file in other disk.
Add redo log file in redo group
We can add redo log file member to redo log group using the command.here redo01a.log redo log file member is added to group 1 and it's status is invalid.
After switching the log file the status will be valid.
Drop redo log file and redo log group in oracle
We can drop redo log file using the below command. Here redo01a.log file will be dropped.
We can drop redo log group sing the below command. Here we delete group 1 .we can not drop the group which status is current.in our case our current group is group 2.
After dropped the group 1 ,redo log files inside the group 1 was not deleted.it is stored on the physical filesystem of the disk.we need delete this log file using the os command.
Here we did not delete this file and create group 1 using the same file we got this below error.
Here we did not delete this file and create group 1 using the same file we got this below error.
After deleted the Physical redo log file from the disk we can create redo group 1 with the redo log file using the same name.no error came.
In this article we have learned
1. what is redo log file in oracle
2. View oracle redo log group and members (redo log files)
3. Add redo log file in redo group
4. Drop redo log file and redo log group in oracle
2. View oracle redo log group and members (redo log files)
3. Add redo log file in redo group
4. Drop redo log file and redo log group in oracle
Stay tune with us.😊
0 comments:
Post a Comment