"Go" to see how much data Oracle generates archived logs per day and hourly

Source: Internet
Author: User

--View the amount of data generated per day for archived logs
Source: http://blog.51cto.com/bjiokn/321878


Alter session set nls_date_format= ' Yyyy.mm.dd hh24:mi:ss ';
Select Trunc (completion_time) as Arc_date,
COUNT (*) as Count,
Round ((SUM (blocks * block_size)/1024/1024), 2) as ARC_MB
From V$archived_log
Group by Trunc (Completion_time)
Order by Trunc (Completion_time);


--View the number of archived logs per hour in recent days
Source: 75309167


SELECT SUBSTR (To_char (first_time, ' mm/dd/rr HH:MI:SS '), 1,5) day,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' xx ', 1,0) H00,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' "1,0") H01,
SUM (DECODE (SUBSTR (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' To_char ', 1,0) H02,
SUM (DECODE (SUBSTR (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' To_char ', 1,0) H03,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' 1,0 ', H04,
SUM (DECODE (SUBSTR (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' To_char ', 1,0) H05,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' ", 1,0") H06,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' ", 1,0") H07,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' 1,0 '),
SUM (DECODE (SUBSTR (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' To_char ', 1,0) H09,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' Ten ', 1,0) H10,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' One ', ' 1,0 ') H11,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' 1,0 ', H12),
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H13,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H14,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' [] ', ' 1,0 ') H15,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H16,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H17,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H18,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H19,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' A ', ' 1,0 ') H20,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' + ', 1,0) H21,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' A ', ' 1,0 ') H22,
SUM (DECODE (SUBSTR (To_char (first_time, ' mm/dd/rr HH24:MI:SS '), 10,2), ' 23°c ', 1,0) H23,
COUNT (*) Total
From V$log_history A
WHERE First_time>=to_char (SYSDATE-10)
GROUP by SUBSTR (To_char (first_time, ' mm/dd/rr HH:MI:SS '), 1,5)
ORDER by SUBSTR (To_char (first_time, ' mm/dd/rr HH:MI:SS '), 1,5) DESC;

--Change the number of days to modify where First_time>=to_char (sysdate-11)

"Go" to see how much data Oracle generates archived logs per day and hourly

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.