{"id":155,"date":"2023-11-15T14:23:22","date_gmt":"2023-11-15T12:23:22","guid":{"rendered":"http:\/\/130.61.57.200\/?p=155"},"modified":"2023-11-15T14:23:22","modified_gmt":"2023-11-15T12:23:22","slug":"check-archive-logs-production","status":"publish","type":"post","link":"http:\/\/130.61.57.200\/index.php\/2023\/11\/15\/check-archive-logs-production\/","title":{"rendered":"Check Archive Logs production"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A database in ARCHIVELOG mode copies redo log entries in the achive log files. Archive log number and size is a metric of a database transactions load in time. Use the following query to monitor the Archive log production per hour for the last 30 days:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SELECT TRUNC (first_time) &quot;Date&quot;, TO_CHAR (first_time, &#039;Dy&#039;) &quot;Day&quot;,&lt;br&gt;COUNT (1) &quot;Total&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;00&#039;, 1, 0)) &quot;h0&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;01&#039;, 1, 0)) &quot;h1&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;02&#039;, 1, 0)) &quot;h2&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;03&#039;, 1, 0)) &quot;h3&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;04&#039;, 1, 0)) &quot;h4&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;05&#039;, 1, 0)) &quot;h5&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;06&#039;, 1, 0)) &quot;h6&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;07&#039;, 1, 0)) &quot;h7&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;08&#039;, 1, 0)) &quot;h8&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;09&#039;, 1, 0)) &quot;h9&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;10&#039;, 1, 0)) &quot;h10&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;11&#039;, 1, 0)) &quot;h11&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;12&#039;, 1, 0)) &quot;h12&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;13&#039;, 1, 0)) &quot;h13&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;14&#039;, 1, 0)) &quot;h14&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;15&#039;, 1, 0)) &quot;h15&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;16&#039;, 1, 0)) &quot;h16&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;17&#039;, 1, 0)) &quot;h17&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;18&#039;, 1, 0)) &quot;h18&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;19&#039;, 1, 0)) &quot;h19&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;20&#039;, 1, 0)) &quot;h20&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;21&#039;, 1, 0)) &quot;h21&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;22&#039;, 1, 0)) &quot;h22&quot;,&lt;br&gt;SUM (DECODE (TO_CHAR (first_time, &#039;hh24&#039;), &#039;23&#039;, 1, 0)) &quot;h23&quot;&lt;br&gt;FROM v$log_history&lt;br&gt;GROUP BY TRUNC (first_time), TO_CHAR (first_time, &#039;Dy&#039;)&lt;br&gt;ORDER BY 1;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OR the following to get size approach:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SELECT TO_CHAR(FIRST_TIME,&#039;MM-DD&#039;) DAY,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;00&#039;,MB,0))) AS &quot;00&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;01&#039;,MB,0))) AS &quot;01&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;02&#039;,MB,0))) AS &quot;02&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;03&#039;,MB,0))) AS &quot;03&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;04&#039;,MB,0))) AS &quot;04&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;05&#039;,MB,0))) AS &quot;05&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;06&#039;,MB,0))) AS &quot;06&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;07&#039;,MB,0))) AS &quot;07&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;08&#039;,MB,0))) AS &quot;08&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;09&#039;,MB,0))) AS &quot;09&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;10&#039;,MB,0))) AS &quot;10&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;11&#039;,MB,0))) AS &quot;11&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;12&#039;,MB,0))) AS &quot;12&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;13&#039;,MB,0))) AS &quot;13&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;14&#039;,MB,0))) AS &quot;14&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;15&#039;,MB,0))) AS &quot;15&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;16&#039;,MB,0))) AS &quot;16&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;17&#039;,MB,0))) AS &quot;17&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;18&#039;,MB,0))) AS &quot;18&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;19&#039;,MB,0))) AS &quot;19&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;20&#039;,MB,0))) AS &quot;20&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;21&#039;,MB,0))) AS &quot;21&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;22&#039;,MB,0))) AS &quot;22&quot;,&lt;br&gt;ROUND(SUM(DECODE(TO_CHAR(FIRST_TIME,&#039;HH24&#039;),&#039;23&#039;,MB,0))) AS &quot;23&quot;,&lt;br&gt;ROUND(SUM(MB)) as &quot;Tot&quot;&lt;br&gt;FROM (SELECT DISTINCT SEQUENCE#, (BLOCKS*BLOCK_SIZE)\/1048576 mb, FIRST_TIME FROM V$ARCHIVED_LOG)&lt;br&gt;GROUP BY TO_CHAR(FIRST_TIME,&#039;MM-DD&#039;)&lt;br&gt;ORDER BY 1;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In case you need to check this production for a specific time window, this can be rewritten as:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SELECT SUM (BLOCKS*BLOCK_SIZE)\/1048576 MB, TRUNC(FIRST_TIME) FROM V$ARCHIVED_LOG WHERE FIRST_TIME BETWEEN TO_DATE(&#039;20\/12\/2021 16:00&#039;,&#039;DD\/MM\/YYYY HH24:MI&#039;) and to_date(&#039;20\/12\/2021 19:00&#039;,&#039;DD\/MM\/YYYY HH24:MI&#039;)&lt;br&gt;GROUP BY TRUNC(FIRST_TIME);<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A database in ARCHIVELOG mode copies redo log entries in the achive log files. Archive log number and size is a metric of a database transactions load in time. Use the following query to monitor the Archive log production per hour for the last 30 days: SELECT TRUNC (first_time) &quot;Date&quot;, TO_CHAR (first_time, &#039;Dy&#039;) &quot;Day&quot;,&lt;br&gt;COUNT (1) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[52],"class_list":["post-155","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-archive-logs"],"blocksy_meta":[],"_links":{"self":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":1,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":156,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/155\/revisions\/156"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/media\/106"}],"wp:attachment":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}