{"id":1355,"date":"2024-05-11T13:14:16","date_gmt":"2024-05-11T07:44:16","guid":{"rendered":"https:\/\/adilfahim.com\/myblog\/?p=1355"},"modified":"2024-05-11T13:20:26","modified_gmt":"2024-05-11T07:50:26","slug":"sap-hana-data-reclaim","status":"publish","type":"post","link":"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/","title":{"rendered":"SAP HANA Data Reclaim process overview in DB Cluster"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69d7a79a9f079\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69d7a79a9f079\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#SAP_HANA_Data_Reclaim_Introduction\" >SAP HANA Data Reclaim | Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#Replication_Modes\" >Replication Modes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#Checking_Unused_Space\" >Checking Unused Space<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#DB_OS_Cluster_Status\" >DB OS Cluster Status<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#SAP_HANA_Data_Reclaim_Steps_Before_Data_Reclamation\" >SAP HANA Data Reclaim | Steps Before Data Reclamation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#SAP_HANA_Data_Reclaim_Data_Reclamation_Process\" >SAP HANA Data Reclaim | Data Reclamation Process<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#Steps_After_Data_Reclamation\" >Steps After Data Reclamation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#How_does_this_process_impact_performance_metrics\" >How does this process impact performance metrics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/adilfahim.com\/myblog\/sap-hana-data-reclaim\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"SAP_HANA_Data_Reclaim_Introduction\"><\/span>SAP HANA Data Reclaim | Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In the world of database management, one of the key tasks that often goes unnoticed is the process of SAP HANA data reclaim. This process, also known as defragmentation, is crucial for maintaining the efficiency and cost-effectiveness of your HANA Database (DB). This blog post aims to provide a detailed walk through of the SAP HANA Data Reclaim process in a DB cluster.<\/p>\n<h2The Importance of SAP HANA Data Reclamation<\/h2>\n<p>&#8211; Data reclamation serves a dual purpose:<\/p>\n<p>1. Space Optimization: It helps in freeing up space within the HANA DB, thereby enhancing its performance.<br \/>\n2. Cost Efficiency: By reclaiming space, we can avoid the need for additional storage space in \/hana\/data, which directly translates to cost savings.<\/p>\n<h2>Why SAP HANA Data Reclaim | Causes of Fragmentation<\/h2>\n<p>There are several reasons why fragmentation occurs, leading to the availability of space that can be reclaimed or defragmented:<\/p>\n<p>1. Business Data Reduction: This can occur due to archiving and deletion operations (Refer SAP Note 2388483 for more details).<\/p>\n<p>2. Garbage Collection Blockage: Sometimes, the garbage collection process might get blocked, necessitating a cleanup (Refer SAP Note 2169283 for more details).<\/p>\n<p>3. Table Optimization: Processes such as merge and compression of a large table can temporarily require double space (Refer SAP Note 2057046 for more details).<\/p>\n<p>4. Preservation of Snapshots\/Savepoints: If snapshots or savepoints are preserved for a longer duration, it can result in an increased amount of shadow pages (Refer SAP Note 2100009 for more details).<\/p>\n<p>Since the allocated space doesn&#8217;t automatically reduce, it becomes necessary to perform data reclamation.<\/p>\n<p>Read More &#8211; Setting up Multi Tier Replication Setup, <a href=\"https:\/\/adilfahim.com\/myblog\/setting-up-sap-hana-multi-target-system-replication-a-comprehensive-guide\/#google_vignette\" target=\"_blank\" rel=\"noopener\">click here<\/a> <\/p>\n<h2><span class=\"ez-toc-section\" id=\"Replication_Modes\"><\/span>Replication Modes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In a typical setup, we have two replication modes:<\/p>\n<p>1. Primary to Secondary (SYNC Mode)<br \/>\n2. Secondary to Disaster Recovery (DR) (ASYNC Mode)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/sap_hana.png\" alt=\"HANA Data Reclaim\" width=\"624\" height=\"201\" class=\"alignnone size-full wp-image-1357\" srcset=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/sap_hana.png 624w, https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/sap_hana-300x97.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Checking_Unused_Space\"><\/span>Checking Unused Space<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To check the unused space, you can refer to the SQL Statement Collection for SAP HANA (1969700).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused.png\" alt=\"HANA Data Reclaim\" width=\"798\" height=\"343\" class=\"alignnone size-full wp-image-1358\" srcset=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused.png 798w, https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused-300x129.png 300w, https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused-768x330.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused1.png\" alt=\"HANA Data Reclaim\" width=\"616\" height=\"158\" class=\"alignnone size-full wp-image-1359\" srcset=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused1.png 616w, https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/hana_db_unused1-300x77.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><\/p>\n<p>Also validate and take screenshot of \/hana\/data and \/hana\/log volume at File system level.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"DB_OS_Cluster_Status\"><\/span>DB OS Cluster Status<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before initiating the data reclamation process, it&#8217;s important to place the HA cluster in maintenance mode at the OS level. This can be verified using the command `crm status`.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"SAP_HANA_Data_Reclaim_Steps_Before_Data_Reclamation\"><\/span>SAP HANA Data Reclaim | Steps Before Data Reclamation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before starting the data reclamation process, follow these steps:<\/p>\n<p>1. Stop the secondary DB (SiteB) and unregister it.<br \/>\n2. Stop the DR DB (SiteC) and unregister it.<br \/>\n3. Disable replication from the primary DB (SiteA).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"SAP_HANA_Data_Reclaim_Data_Reclamation_Process\"><\/span>SAP HANA Data Reclaim | Data Reclamation Process<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The data reclamation process is executed in the primary DB (SiteA) using the following commands in sql console from OS level or HANA Studion.<\/p>\n<p><strong>ALTER SYSTEM RECLAIM DATAVOLUME 120 DEFRAGMENT;<br \/>\nALTER SYSTEM RECLAIM DATAVOLUME 110 DEFRAGMENT;<br \/>\nALTER SYSTEM RECLAIM DATAVOLUME 115 DEFRAGMENT;<\/strong><\/p>\n<p>If you wish to perform log reclamation, you can use the following SQL query:<\/p>\n<p><strong>ALTER SYSTEM RECLAIM LOG;<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/data_reclaim.png\" alt=\"HANA Data Reclaim\" width=\"938\" height=\"410\" class=\"alignnone size-full wp-image-1360\" srcset=\"https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/data_reclaim.png 938w, https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/data_reclaim-300x131.png 300w, https:\/\/adilfahim.com\/myblog\/wp-content\/uploads\/2024\/05\/data_reclaim-768x336.png 768w\" sizes=\"auto, (max-width: 938px) 100vw, 938px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Steps_After_Data_Reclamation\"><\/span>Steps After Data Reclamation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once the data reclamation process is complete, follow these steps:<\/p>\n<p>1. Enable replication in the primary DB (SiteA).<br \/>\n2. Register and start the secondary DB (SiteB) in SYNC mode.<br \/>\n3. Register and start the DR DB (SiteC) in ASYNC mode.<\/p>\n<p>Validate the file system of \/hana\/data and \/hana\/log at file system level and monitor the replication status as it will be in Full Replica Mode and ensure that it is completed and all systems are in SYNC status.<\/p>\n<p>Finally, remove the DB cluster from maintenance mode(SiteA&#8212;-SiteB> and validate it using the `crm status` command in OS.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_does_this_process_impact_performance_metrics\"><\/span>How does this process impact performance metrics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The HANA Data Reclaim process can have a significant impact on the performance metrics of your HANA Database. Here&#8217;s how:<\/p>\n<p>1. Disk Space Utilization: The primary purpose of data reclamation is to free up disk space. This can lead to a decrease in the disk space utilization metric, which measures the percentage of the total disk space that is currently being used\u00b9.<\/p>\n<p>2. Database Performance: By freeing up disk space, data reclamation can improve the overall performance of the database. For instance, operations that require disk space (such as creating new tables or adding entries to existing tables) can be performed more quickly when more disk space is available\u00b9.<\/p>\n<p>3. Network Performance: The data reclamation process involves moving and rearranging data, which can increase network activity. This could temporarily impact network performance metrics, such as latency and throughput\u2074.<\/p>\n<p>4. System Downtime: The data reclamation process requires the database to be taken offline temporarily. This can increase system downtime, which is a metric that measures the total time that the system is unavailable or offline\u00b3.<\/p>\n<p>5. Cost Efficiency: By reducing the need for additional storage space, data reclamation can lead to cost savings. This can improve cost efficiency metrics, such as the cost per unit of data stored.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The process of data reclamation is a crucial aspect of database management. It not only helps in optimizing the performance of your HANA DB but also contributes to significant cost savings. By following the steps outlined in this guide, you can successfully perform a data reclamation process in your DB cluster. Remember, a well-maintained database is the backbone of any successful business operation. Happy data reclaiming.<br \/>\n<strong>Resources<\/strong><\/p>\n<p>(1) SAP HANA Troubleshooting and <a href=\"https:\/\/help.sap.com\/docs\/r\/bed8c14f9f024763b0777aa72b5436f6\/2.0.03\/en-US\/9171ce1138a94a3ba95324350c8979eb.html\" target=\"_blank\" rel=\"noopener\">Performance Analysis Guide <\/a>&#8211; SAP Online Help. <\/p>\n<p>(2) Mastering <a href=\"https:\/\/community.sap.com\/t5\/enterprise-resource-planning-blogs-by-members\/mastering-sap-hana-troubleshooting-unlocking-the-power-of-in-memory-data\/ba-p\/13568016\" target=\"_blank\" rel=\"noopener\">SAP HANA Troubleshooting<\/a><\/p>\n<p>(3) Troubleshooting <a href=\"https:\/\/help.sap.com\/docs\/SUPPORT_CONTENT\/saphana\/3361895578.html\" target=\"_blank\" rel=\"noopener\">HANA Performance issues<\/a> | SAP Help Portal <\/p>\n","protected":false},"excerpt":{"rendered":"<p>SAP HANA Data Reclaim | Introduction In the world of database management, one of the key tasks that often goes unnoticed is the process of SAP HANA data reclaim. This process, also known as defragmentation, is crucial for maintaining the efficiency and cost-effectiveness of your HANA Database (DB). This blog post aims to provide a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8],"tags":[1071,1080,1076,1072,1075,1073,1074,1079,1064,1028,1078,1077],"class_list":["post-1355","post","type-post","status-publish","format-standard","hentry","category-sap-updates","tag-hana-data-reclaim","tag-hana-data-reclaim-steps","tag-hana-db-defragmentation","tag-hana-db-reclaim","tag-hana-db-space-utilization","tag-hana-log-reclaim","tag-hana-log-space-utilization","tag-sap-hana-data-reclaim","tag-sap-hana-log-space-full","tag-sap-hana-multitier-replication","tag-sap-note-2100009","tag-sap-note-2169283"],"_links":{"self":[{"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/posts\/1355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/comments?post=1355"}],"version-history":[{"count":4,"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"predecessor-version":[{"id":1364,"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/posts\/1355\/revisions\/1364"}],"wp:attachment":[{"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adilfahim.com\/myblog\/wp-json\/wp\/v2\/tags?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}