{"id":240,"date":"2018-02-12T12:00:23","date_gmt":"2018-02-12T11:00:23","guid":{"rendered":"https:\/\/www.carajandb.com\/?p=240"},"modified":"2018-03-16T09:26:04","modified_gmt":"2018-03-16T08:26:04","slug":"automatic-diagnostic-repository-management-en","status":"publish","type":"post","link":"https:\/\/carajandb.com\/en\/2018\/02\/12\/automatic-diagnostic-repository-management-en\/","title":{"rendered":"Automatic Diagnostic Repository Management"},"content":{"rendered":"<p>With Release 11g Oracle introduced the concept of the Automatic Diagnostic Repository (ADR) which is an independent directory structure for all kinds of logs and traces for the database, listener and other Oracle products. The directory <samp>diag<\/samp> is located in <samp>$ORACLE_BASE<\/samp> so you should ensure that that variable has been set to the correct directory. If it\u2019s not set the files will be stored in <samp>$ORACLE_HOME\/diag<\/samp>.<br \/>\n<!--more--><br \/>\nWith Oracle 11g it was a starting point and several parts of the oracle database, like Grid infrastructure were not aware of the new structure. With Oracle 12c now most logs, traces and cores are in the various directories underneath <samp>$ORACLE_BASE\/diag<\/samp> (except for asmcmd which is using <samp>$ORACLE_BASE\/log\/diag<\/samp>!).<\/p>\n<p>Logs and traces are often stored twice in this structure like the good old alert file is stored in <samp>$ORACLE_BASE\/diag\/rdbms\/&lt;DB_UNIQUE_NAME&gt;\/&lt;ORACLE_SID&gt;\/alert<\/samp> as an xml-file and in the corresponding trace directory in the old ascii layout.<\/p>\n<p>As many of you already experienced the ADR can become huge over the time. I\u2019ve seen <samp>alert.log<\/samp> and <samp>listener.log<\/samp> with a size of several GByte which can bring the entire Oracle database environment to a stop as the filesystem gets full.<\/p>\n<h2>ADRCI<\/h2>\n<p>But one of the advantages of ADR is that it\u2019s able to manage the files without human intervention. 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 = 30 days) and <samp>LONGP_POLICY<\/samp> (default 8720 hours = 365 days).<\/p>\n<p>Guess normally it\u2019s not necessary to keep one year old logfiles online so you might want to change the parameters using the ADR command line interface:<\/p>\n<pre>% adrci<\/pre>\n<p>If you only have one database and no special settings there should only be one ADR-Home and you can continue changing the values immediate. If, like in my environment, you have several databases you need to select the environment first:<\/p>\n<pre>adrci&gt; show homes \r\ndiag\/rdbms\/rac112\/RAC1122 diag\/rdbms\/rac112\/TEST\r\ndiag\/rdbms\/rac112\/RAC1121 diag\/rdbms\/ron112\/RON112_2\r\ndiag\/rdbms\/ron112\/RON1121 diag\/rdbms\/ron112\/RON112_1 \r\nadrci&gt; set home\r\ndiag\/rdbms\/rac112\/RAC1122\r\n<\/pre>\n<p>Now You can change the parameters for that specific environment:<\/p>\n<pre>adrci&gt; \r\nshow control \r\nADR Home = \/u01\/app\/oracle\/diag\/rdbms\/rac112\/RAC1122: \r\n************************************************************************* \r\nADRID      SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME                     ... \r\n---------- ------------- ------------ --------------------------------- \r\n1122254562           720         8760 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\nadrci&gt; exit\r\n<\/pre>\n<p>This will purge old logfiles, traces, etc. automatically and free up the space again. If you are in a hurry you can purge the files manually using adrci as well:<\/p>\n<pre>adrci&gt; set home diag\/rdbms\/rac112\/RAC1122 \r\nadrci&gt; purge<\/pre>\n<h2>Listener.log<\/h2>\n<p>One more hint to the <samp>listener.log<\/samp>: If you have a webinterface you might encounter a huge <samp>listener.log<\/samp> file because every connect\/disconnect is going to be logged. Most recently one of my customer had a 10 GB <samp>listener.log<\/samp> file and it filled within minutes.<\/p>\n<p>In this case you better switch off logging for the listener at all:<\/p>\n<pre>% lsnrctl \r\nLSNRCTL&gt; show log_status \r\nConnecting to (DESCRIPTION= (ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) \r\nLISTENER parameter \u201clog_status\u201d set to ON \r\nThe command completed successfully \r\nLSNRCTL&gt; set log_status off\r\n<\/pre>\n<p>This will help to free up you diag destination.<\/p>\n<p>If you have any comments or annotations feel free contacting me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Release 11g Oracle introduced the concept of the Automatic Diagnostic Repository (ADR) which is an independent directory structure for all kinds of logs and traces for the database, listener and other Oracle products. The directory diag is located in $ORACLE_BASE so you should ensure that that variable has been set to the correct directory. If it\u2019s not set the files will be stored in $ORACLE_HOME\/diag.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_crdt_document":"","_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":[],"tags":[66,69,68],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","tag-adr","tag-longp_policy","tag-shortp_policy"],"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":["240"],"_fgj2wp_translation_association_key":["0d046fb17a2754b513ac0d2aa0742fca"],"_edit_lock":["1521188626:3"],"_edit_last":["3"],"_wpml_location_migration_done":["1"],"_yoast_wpseo_content_score":["30"],"_yoast_wpseo_primary_category":[""],"_vc_post_settings":["a:1:{s:10:\"vc_grid_id\";a:0:{}}"],"_yoast_wpseo_focuskw_text_input":["ADR"],"_yoast_wpseo_focuskw":["ADR"],"_yoast_wpseo_linkdex":["67"],"layout_header":["light"],"_layout_header":["field_5a48111185e5f"],"layout_background":[""],"_layout_background":["field_5a481193c0995"],"layout_hide_services":["0"],"_layout_hide_services":["field_5a4811c5c0996"],"layout_show-author-box":["1"],"_layout_show-author-box":["field_5a64ee9cc6490"],"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"],"rank_math_primary_category":[""],"rank_math_focus_keyword":["ADR"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_seo_score":["12"],"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:25+00:00"],"astra_style_timestamp_css":["1773726070"],"copied_media_ids":["a:0:{}"],"referenced_media_ids":["a:0:{}"],"_uag_css_file_name":["uag-css-240.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 is an independent directory structure for all kinds of logs and traces for the database, listener and other Oracle products. The directory diag is located in $ORACLE_BASE so you should ensure that that variable has been set to the correct directory.&hellip;","_links":{"self":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/240","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=240"}],"version-history":[{"count":4,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":6811,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/240\/revisions\/6811"}],"wp:attachment":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}