In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Some users will be confused that the size of the archived log is smaller than that of the online log. For this situation:
First, check whether your archive log files are compressed:
SELECT to_char (first_time,'yyyy-mm-dd hh34:mi:ss'), blocks*block_size/1024/1024,compressed from v$archived_log
If it is not compressed, then this problem may have something to do with your number of CPU.
Please check your number of CPU:
Show parameter CPU_COUNT
The size of the archive log is the amount of real online log files used, that is, the size of the content written in it before the online log files are switched.
However, in order to reduce conflicts for better parallelism, oracle will divide into one strand for every 16 CPU, and each strand will independently allocate a piece of space from redo buffer and redo log. When this piece of redo buffer is used up, it will write to redo log and continue to allocate the same amount of space from redo log. If free space cannot be allocated, log switching will be carried out, regardless of whether the other strand is finished or not.
Here is an example to illustrate this algorithm:
For example, if the number of CPU is 64, there will be 64 strand.
Example 1) when both the size of log buffer and the size of redo log file are 256m, each strand is 256M/4=64M.
When each redo log file is enabled, four 64m corresponding to the log buffer are pre-allocated to the size in the redo log file, as shown in the figure:
Because both the size of log buffer and the size of redo log file are 256m, redo log file has no unallocated space left.
The redo generated by each process will be assigned to one of the strand on log buffer. A single process can only correspond to one strand.
In this way, when there is only a lot of redo generated by certain processes in the database (for example, in extreme cases, only one process), one of the strand will quickly fill up, such as strand 1 in the figure:
When it is full, LGWR will write the contents of strand 1 in log buffer to redo log file and try to allocate a new 64m space from redo log file. If it is found that it is gone, all the contents of strand will be written to the log and log switching will be made.
This may cause redo log file to write only one strand, and the rest is almost empty, and the resulting archive log will only be close to 64m instead of 256m.
When the CPU_COUNT is large, the difference is even larger.
Example 2) when the size of log buffer is 256m and the size of redo log file is 1G, each strand is still 256M/4=64M.
When each redo log file is enabled, four 64m corresponding to the log buffer are pre-allocated to the size in the redo log file, as shown in the figure:
At this point, there is still unallocated space left in the redo log file for 1G-256M=768M. If strand 1 is full, LGWR writes the contents of strand 1 in log buffer to redo log file, tries to allocate a new 64m space from redo log file, and then keeps writing down.
Until there is no more allocable space in the redo log file, all the contents of the strand are written to the log and the log is switched.
Example 3) when the size of log buffer is 256m and the size of redo log file is 100m, each strand is still 256M/4=64M.
But the space in the redo log file is evenly distributed according to the number of strand, that is, each 100M/4=25M.
In this way, when the content in each strand is written to 25m, the log will be switched instead of 64m. It is equivalent to that part of the space in log buffer is wasted.
Please refer to the following documents:
1.Archive Logs Are Created With Smaller, Uneven Size Than The Original Redo Logs. Why? (Doc ID 388627.1)
With a high CPU_COUNT, a low load and a redolog file size smaller than the redolog buffer, you may small archived log files because of log switches at about 1/8 of the size of the define log file size.
This is because CPU_COUNT defines the number of redo strands (ncpus/16). With a low load only a single strand may be used. With redolog file size smaller than the redolog buffer, the log file space is divided over the available strands. When for instance only a single active strand is used, a log switch can already occur when that strand is filled.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.