{"id":119,"date":"2011-04-06T14:46:17","date_gmt":"2011-04-06T12:46:17","guid":{"rendered":"https:\/\/www.carajandb.com\/2011\/04\/06\/do-you-really-need-one-year-old-logs-and-traces-for-your-oracle-database\/"},"modified":"2018-12-21T12:44:16","modified_gmt":"2018-12-21T11:44:16","slug":"do-you-really-need-one-year-old-logs-and-traces-for-your-oracle-database","status":"publish","type":"post","link":"https:\/\/carajandb.com\/en\/2011\/04\/06\/do-you-really-need-one-year-old-logs-and-traces-for-your-oracle-database\/","title":{"rendered":"Do you really need one year old Logs and Traces for your Oracle Database?"},"content":{"rendered":"<p>With Release 11g Oracle introduced the concept of the Automatic Diagnostic Repository (ADR) which (in theory) is an independant directory structure for all kind of logs and traces for the database, listener and other Oracle products. The content is mostly stored twice (as text or traditional trace file and in xml format). So the size of each individual directory can easily become several GB. Nothing to worry for todays disk spaces but annoying if you really need to find some relevant information.<\/p>\n<p>The good news is that there is a purge mechanism associated with it so that old logs and traces are automatically removed. Unfortunately the default retention for most of those logs is one year! There are two parameters: <samp>SHORTP_POLICY<\/samp> (default 720 hours) and <samp>LONGP_POLICY<\/samp> (default 8720 hours). so <samp>SHORTP_POLICY<\/samp> is 30 days while <samp>LONGP_POLICY<\/samp> is 365 days.<br \/>\n<!--more--><br \/>\nBut you can easily change the retention by setting the variables to a more suitable value:<\/p>\n<pre>% adrci:\r\nadrci&gt; show homes\r\ndiag\/rdbms\/rac112\/RAC1122\r\ndiag\/rdbms\/rac112\/TEST\r\ndiag\/rdbms\/rac112\/RAC1121\r\ndiag\/rdbms\/ron112\/RON112_2\r\ndiag\/rdbms\/ron112\/RON1121\r\ndiag\/rdbms\/ron112\/RON112_1\r\nadrci&gt; set home diag\/rdbms\/rac112\/RAC1122\r\nadrci&gt; show control\r\nADR Home = \/u01\/app\/oracle\/diag\/rdbms\/rac112\/RAC1122:\r\n*************************************************************************\r\nADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME\r\n-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------\r\n1122254562 720 8760 2011-01-11 13:08:51.956565 +01:00 2011-03-23 23:08:36.314710 +01:00 1 2 76 1 2011-01-11 13:08:51.956565 +01:00\r\n1 rows fetched\r\nadrci&gt; set control (SHORTP_POLICY = 168)\r\nadrci&gt; set control (LONGP_POLICY = 720)\r\n<\/pre>\n<p>Like in this example you probably have more than one database or multiple Oracle Homes installed which ends um in various ADR-Home directories. Changing the parameter <samp>SHORTP_POLICY<\/samp> and <samp>LONGP_POLICY<\/samp> requires to first select the correct ADR-Home erst dann die Parameter anpassen kann.<\/p>\n<p>But adrci can be called with additional parameters which helps to create a simple Shell-script for the necessary changes. The following example will set SHORTP_POLICY to one week and LONGP_POLICY to one month:<\/p>\n<pre>#!\/bin\/sh\r\nfor ADRHOME in `adrci exec=\"show home\"`\r\ndo\r\n    if [ $ADRHOME = \"ADR\" -o $ADRHOME = \"Homes:\" ]\r\n    then\r\n        continue;\r\n    fi\r\n    echo $ADRHOME\r\n    adrci &lt;&lt; EOF\r\n         set home $ADRHOME\r\n         set control (SHORTP_POLICY = 168)\r\n         set control (LONGP_POLICY = 720)\r\n         purge\r\n    exit\r\nEOF\r\ndone\r\n<\/pre>\n<p>This can save a huge amount of space and the important files can be found more easily.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Release 11g Oracle introduced the concept of the Automatic Diagnostic Repository (ADR) which (in theory) is an independant directory structure for all kind of logs and traces for the database, listener and other Oracle products. The content is mostly stored twice (as text or traditional trace file and in xml format). So the size of each individual directory can easily become several GB. Nothing to worry for todays disk spaces but annoying if you really need to find some relevant information. The good news is that there is a purge mechanism associated with it so that old logs and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[406],"tags":[66,67,274],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-oracle-en","tag-adr","tag-automatic-diagnostic-repository","tag-oracle-12c-3"],"acf":{"occupation":"Write the Occupation of the Person","person_can-be-speaker":true,"person_is-team":true,"person_related-user-account":null,"person_ordering-number":50,"publication_speakers":null,"publication_content-language":["de"],"publication_files":null,"publication_event":"","publication_date":null},"spectra_custom_meta":{"_fgj2wp_old_id":["119"],"_yoast_wpseo_metadesc":["Logfiles and Alertfiles"],"_yoast_wpseo_metakeywords":["alert.log, tracefile, ADRCI, ADR, Automatic Diagnostic Repository, shortp_policy, longp_policy"],"layout_show-author-box":["1"],"_layout_show-author-box":["field_5a64ee9cc6490"],"_edit_lock":["1545392530:3"],"_edit_last":["3"],"_vc_post_settings":["a:1:{s:10:\"vc_grid_id\";a:0:{}}"],"_yoast_wpseo_content_score":["30"],"layout_header":["light"],"_layout_header":["field_5a48111185e5f"],"layout_background":[""],"_layout_background":["field_5a481193c0995"],"layout_hide_services":["0"],"_layout_hide_services":["field_5a4811c5c0996"],"layout_show-categories-tags":["1"],"_layout_show-categories-tags":["field_5a64eee4c6491"],"blogpost_related-publications":[""],"_blogpost_related-publications":["field_5a480debdac62"],"blogpost_related-files":[""],"_blogpost_related-files":["field_5a480f377db29"],"_yoast_wpseo_primary_category":[""],"rank_math_primary_category":[""],"rank_math_description":["Logfiles and Alertfiles"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"astra_style_timestamp_css":["1784919600"],"rank_math_internal_links_processed":["1"],"wpil_sync_report3":["1"],"wpil_links_inbound_internal_count":["0"],"wpil_links_inbound_internal_count_data":["eJxLtDKwqq4FAAZPAf4="],"wpil_links_outbound_internal_count":["0"],"wpil_links_outbound_internal_count_data":["eJxLtDKwqq4FAAZPAf4="],"wpil_links_outbound_external_count":["0"],"wpil_links_outbound_external_count_data":["eJxLtDKwqq4FAAZPAf4="],"wpil_sync_report2_time":["2024-08-27T11:47:31+00:00"],"copied_media_ids":["a:0:{}"],"referenced_media_ids":["a:0:{}"],"_uag_css_file_name":["uag-css-119.css"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Johannes Ahrends","author_link":"https:\/\/carajandb.com\/en\/author\/9aa6cdb2095bd409\/"},"uagb_comment_info":0,"uagb_excerpt":"With Release 11g Oracle introduced the concept of the Automatic Diagnostic Repository (ADR) which (in theory) is an independant directory structure for all kind of logs and traces for the database, listener and other Oracle products. The content is mostly stored twice (as text or traditional trace file and in xml format). So the size&hellip;","_links":{"self":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":1,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":7101,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/119\/revisions\/7101"}],"wp:attachment":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}