How many redo log groups should i have
This means that each redo log group can consist of more than one online redo log file. Each file is known as a member. Each member should be located on a different disk, to protect the group from losing all of its members in the event a disk failure should occur.
Oracle writes to those members in parallel, to ensure that the database is always recoverable while maintaining performance. The online redo logs are first created when the database is created, and the database cannot live without them. If all members of the active redo log group are lost, the database crashes, and worse yet, there will be data loss.
Hence, it is very important to preserve these files. There are two kinds of redo logs that we will consider in this section, the online redo logs and archived redo logs. First we will address administration of online redo logs. This includes creation and removal of an online redo log group, as well as the addition and removal of redo log group members.
You use the alter database command to add an online redo log group, and its associated members, to the database. Here is an example of the creation of a new online redo log group:. Of course, there are times that you will want to drop a given redo log group.
This is commonly done if you need to increase or reduce the size of the online redo logs. You drop the online redo log group using the alter database drop logfile group command as seen in this example:. There are a few things to note concerning the dropping of redo log groups. For starters, you cannot drop the CURRENT redo log group; meaning, if the log group you wish to drop is currently being written to, it will not be allowed.
In this case, you can switch to the next redo log group and then drop the old one. In case your Instance crash, maybe an ORA or HW fail, when you start up your database it has to replay whatever it is on your redo logs, it is named roll forward, and start applying whatever transaction is on those files until it reach the end of that file, if there are no-commited transactions, then it rollback those tx, after this, then the db is opened.
If you have small redo logs, you have checkpoints more frequent, so in case of an instance crash, the time it takes to replay the transactions is less than if the redo logs were bigger. So, you have to decide wether you want to recover faster in case of a instance crash or have better performance, it is a trade-off. It is not a matter of if you can or cant recover, it is a matter of how fast you want to recover.
In our case we have a M redo log files, during peak hours we switch every min, during normal hours, we switch every hour. No size fits all. ITt cc: oolbox.
Subject: [oracle-db-l] RE: redo log size question regarding performance. Whether you have 1M redo logs or 1 M redo log to apply, it does not really matter….
If you have a lot of data in a given time frame, it will take as long as it takes to re-apply that data. Just because you limit your log switch to every 15 to 20 minutes does not make any difference as to the MTTR…. Just because they are spread out over 1 file or several files is not going to make that much of a difference.
The sizing of the redo log files only reduces the overhead of very frequent log switches and I have only seen this become a problem when you switch logs several times a minute….. Instance recovery with our M redo log file size is not too bad…. I have done the math and have timed recovery in both cases….. As consultants go, and I do not think that are all that bad, but the ones that make such assertions usually do not back this up with real examples or real world experience and when they come into a short and does this to a fellow DBA who has worked long hours to solve problems, it really does not sit well with me.
Dianna would have the same problem with recovery time if she had 4 M redo logs or 1 M redo log….. The only thing she saves with the smaller files is lower risk of losing data in the event that she loses her redo logs entirely….. How big should be a redo log? No redistribution. No Account? Sign up.
By signing in, you agree to our Terms of Use and Privacy Policy. Already have an account? Sign in. For example, one group can have only one member, and other groups can have two members. This configuration protects against disk failures that temporarily affect some redo log members but leave others intact. The only requirement for an instance redo log is that it have at least two groups. Figure shows legal and illegal multiplexed redo log configurations.
The second configuration is illegal because it has only one group. When setting up a multiplexed redo log, place members of a group on different physical disks. If a single disk fails, then only one member of a group becomes unavailable to LGWR and other members remain accessible to LGWR, so the instance can continue to function. If you archive the redo log, spread redo log members across disks to eliminate contention between the LGWR and ARC n background processes.
For example, if you have two groups of multiplexed redo log members a duplexed redo log , place each member on a different disk and set your archiving destination to a fifth disk. Datafiles should also be placed on different disks from redo log files to reduce contention in writing data blocks and redo records.
When setting the size of redo log files, consider whether you will be archiving the redo log. Redo log files should be sized so that a filled group can be archived to a single unit of offline storage media such as a tape or disk , with the least amount of space on the medium left unused.
In this case, it is better to decrease the size of the redo log files slightly, so that two log groups could be archived on each tape. All members of the same multiplexed redo log group must be the same size. Members of different groups can have different sizes. However, there is no advantage in varying file size between groups. If checkpoints are not set to occur between log switches, make all groups the same size to guarantee that checkpoints occur at regular intervals.
The best way to determine the appropriate number of redo log files for a database instance is to test different configurations. The optimum configuration has the fewest groups possible without hampering LGWR from writing redo log information. In some cases, a database instance may require only two groups. In other situations, a database instance may require additional groups to guarantee that a recycled group is always available to LGWR. During testing, the easiest way to determine whether the current redo log configuration is satisfactory is to examine the contents of the LGWR trace file and the database alert log.
If messages indicate that LGWR frequently has to wait for a group because a checkpoint has not completed or a group has not been archived, add groups. Consider the parameters that can limit the number of redo log files before setting up or altering the configuration of an instance redo log. The following parameters limit the number of redo log files that you can add to a database:.
When the compatibility level is set earlier than Therefore, it is important to consider this limit before creating a database. When compatibility is set to Oracle Database Backup and Recovery Advanced User's Guide to learn how checkpoints and the redo log impact instance recovery.
You can force all enabled redo log threads to switch their current logs at regular time intervals. The changes that are being applied by the standby database can lag behind the changes that are occurring on the primary database, because the standby database must wait for the changes in the primary database redo log to be archived into the archived redo log and then shipped to it. Setting this parameter lets you specify in seconds how long that lag can be.
If the following conditions are met, then the instance will switch the log:. In an Oracle Real Application Clusters environment, the instance also causes other threads to switch and archive their logs if they are falling behind.
It also provides an upper limit of how long in seconds the current log of the primary database can span. Because the estimated archival time is also considered, this is not the exact log switch time. The following initialization parameter setting sets the log switch interval to 30 minutes a typical value. However, in the case of irregularities of redo generation speed, the interval does provide an upper limit for the time range each current log covers.
This can force frequent log switches. Set the parameter to a reasonable value so as not to degrade the performance of the primary database. Plan the redo log of a database and create all required groups and members of redo log files during database creation.
However, there are situations where you might want to create additional groups or members. For example, adding groups to a redo log can correct redo log group availability problems.
Using group numbers can make administering redo log groups easier. Do not skip redo log file group numbers that is, do not number your groups 10, 20, 30, and so on , or you will consume unnecessary space in the control files of the database. In some cases, it might not be necessary to create a complete group of redo log files. A group could already exist, but not be complete because one or more members of the group were dropped for example, because of a disk failure.
In this case, you can add new members to an existing group. The following statement adds a new redo log member to redo log group number Notice that filenames must be specified, but sizes need not be. The size of the new members is determined from the size of the existing members of the group. This procedure is necessary, for example, if the disk currently used for some redo log files is going to be removed, or if datafiles and a number of redo log files are stored on the same disk and should be separated to reduce contention.
Additionally, you might also need operating system privileges to copy files to the desired location and privileges to open and back up the database.
Before relocating your redo logs, or making any other structural changes to the database, completely back up the database in case you experience problems while performing the operation. As a precaution, after renaming or relocating a set of redo log files, immediately back up the database control file.
Use the following steps for relocating redo logs. The example used to illustrate these steps assumes:. The redo log files located on diska must be relocated to diskc. Operating system files, such as redo log members, must be copied using the appropriate operating system commands.
See your operating system specific documentation for more information about copying files. The following example uses operating system commands UNIX to move the redo log members to a new location:. In some cases, you may want to drop an entire group of redo log members. For example, you want to reduce the number of groups in an instance redo log. In a different case, you may want to drop one or more specific redo log members.
For example, if a disk failure occurs, you may need to drop all the redo log files on the failed disk so that the database does not try to write to the inaccessible files. In other situations, particular redo log files become unnecessary. For example, a file might be stored in an inappropriate location. Before dropping a redo log group, consider the following restrictions and precautions:.
An instance requires at least two groups of redo log files, regardless of the number of members in the groups. A group comprises one or more members. You can drop a redo log group only if it is inactive. If you need to drop the current group, first force a log switch to occur. Make sure a redo log group is archived if archiving is enabled before dropping it.
When a redo log group is dropped from the database, and you are not using the Oracle-managed files feature, the operating system files are not deleted from disk. Rather, the control files of the associated database are updated to drop the members of the group from the database structure.
0コメント