<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Purging deleted data</title>
    <link>/en/admin/working-with-native-tables/removing-table-data/purging-deleted-data/</link>
    <description>Recent content in Purging deleted data on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/admin/working-with-native-tables/removing-table-data/purging-deleted-data/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Admin: Setting a purge policy</title>
      <link>/en/admin/working-with-native-tables/removing-table-data/purging-deleted-data/setting-purge-policy/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/working-with-native-tables/removing-table-data/purging-deleted-data/setting-purge-policy/</guid>
      <description>
        
        
        &lt;p&gt;The preferred method for purging data is to establish a policy that determines which deleted data is eligible to be purged. Eligible data is automatically purged when the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/tuple-mover-tm/&#34; title=&#34;The Tuple Mover manages ROS data storage.&#34;&gt;Tuple Mover&lt;/a&gt; performs &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/mergeout/&#34; title=&#34;&#34;&gt;mergeout&lt;/a&gt; operations.&lt;/p&gt;
&lt;p&gt;The database provides two methods for determining when deleted data is eligible to be purged:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Specifying the time for which delete data is saved&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specifying the number of &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/epoch/&#34; title=&#34;A logical unit of time in which a single change is made to data in your OpenText&amp;amp;trade; Analytics Database.&#34;&gt;epochs&lt;/a&gt; that are saved&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;specifying-the-time-for-which-delete-data-is-saved&#34;&gt;Specifying the time for which delete data is saved&lt;/h2&gt;
&lt;p&gt;Specifying the time for which delete data is saved is the preferred method for determining which deleted data can be purged. By default, the database saves historical data only when nodes are down.&lt;/p&gt;
&lt;p&gt;To change the specified time for saving deleted data, use the &lt;a href=&#34;../../../../../en/sql-reference/config-parameters/epoch-management-parameters/&#34;&gt;&lt;code&gt;HistoryRetentionTime&lt;/code&gt; configuration parameter&lt;/a&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET HistoryRetentionTime = {&lt;span class=&#34;code-variable&#34;&gt;seconds&lt;/span&gt; | -1};
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the above syntax:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;seconds&lt;/em&gt; is the amount of time (in seconds) for which to save deleted data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;-1&lt;/em&gt; indicates that you do not want to use the &lt;code&gt;HistoryRetentionTime&lt;/code&gt; configuration parameter to determine which deleted data is eligible to be purged. Use this setting if you prefer to use the other method (&lt;code&gt;HistoryRetentionEpochs&lt;/code&gt;) for determining which deleted data can be purged.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following example sets the history epoch retention level to 240 seconds:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET HistoryRetentionTime = 240;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;specifying-the-number-of-epochs-that-are-saved&#34;&gt;Specifying the number of epochs that are saved&lt;/h2&gt;
&lt;p&gt;Unless you have a reason to limit the number of epochs, it is recommended that you specify the time for which deleted data is saved.&lt;/p&gt;
&lt;p&gt;To specify the number of historical epoch to save through the &lt;code&gt;HistoryRetentionEpochs&lt;/code&gt; configuration parameter:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Turn off the &lt;code&gt;HistoryRetentionTime&lt;/code&gt; configuration parameter:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET HistoryRetentionTime = -1;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the history epoch retention level through the &lt;code&gt;HistoryRetentionEpochs&lt;/code&gt; configuration parameter:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET HistoryRetentionEpochs = {&lt;span class=&#34;code-variable&#34;&gt;num_epochs&lt;/span&gt; | -1};
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;num_epochs&lt;/em&gt; is the number of historical epochs to save.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;-1&lt;/em&gt; indicates that you do not want to use the &lt;code&gt;HistoryRetentionEpochs&lt;/code&gt; configuration parameter to trim historical epochs from the epoch map. By default, &lt;code&gt;HistoryRetentionEpochs&lt;/code&gt; is set to -1.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following example sets the number of historical epochs to save to 40:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET HistoryRetentionEpochs = 40;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Modifications are immediately implemented across all nodes within the database cluster. You do not need to restart the database.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If both &lt;code&gt;HistoryRetentionTime&lt;/code&gt; and &lt;code&gt;HistoryRetentionEpochs&lt;/code&gt; are specified, &lt;code&gt;HistoryRetentionTime&lt;/code&gt; takes precedence.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/sql-reference/config-parameters/epoch-management-parameters/#&#34;&gt;Epoch management parameters&lt;/a&gt; for additional details. See &lt;a href=&#34;../../../../../en/admin/failure-recovery/epochs/#&#34;&gt;Epochs&lt;/a&gt; for information about how epochs work.&lt;/p&gt;
&lt;h2 id=&#34;disabling-purge&#34;&gt;Disabling purge&lt;/h2&gt;
&lt;p&gt;If you want to preserve all historical data, set the value of both historical epoch retention parameters to -1, as follows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DABABASE mydb SET HistoryRetentionTime = -1;
=&amp;gt; ALTER DATABASE DEFAULT SET HistoryRetentionEpochs = -1;
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Admin: Manually purging data</title>
      <link>/en/admin/working-with-native-tables/removing-table-data/purging-deleted-data/manually-purging-data/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/working-with-native-tables/removing-table-data/purging-deleted-data/manually-purging-data/</guid>
      <description>
        
        
        &lt;p&gt;You manually purge deleted data as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set the cut-off date for purging deleted data. First, call one of the following functions to verify the current ancient history mark (&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/ancient-history-mark-ahm/&#34; title=&#34;Also known as AHM, the ancient history mark is the oldest epoch whose data is accessible to historical queries.&#34;&gt;AHM&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/epoch-functions/get-ahm-time/#&#34;&gt;GET_AHM_TIME&lt;/a&gt;&lt;/code&gt; returns a TIMESTAMP value of the AHM.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/epoch-functions/get-ahm-epoch/#&#34;&gt;GET_AHM_EPOCH&lt;/a&gt;&lt;/code&gt; returns the number of the epoch in which the AHM is located.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the AHM to the desired cut-off date with one of the following functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/epoch-functions/set-ahm-time/#&#34;&gt;SET_AHM_TIME&lt;/a&gt;&lt;/code&gt; sets the AHM to the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/epoch/&#34; title=&#34;A logical unit of time in which a single change is made to data in your OpenText&amp;amp;trade; Analytics Database.&#34;&gt;epoch&lt;/a&gt; that includes the specified TIMESTAMP value on the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/initiator-node/&#34; title=&#34;In the context of a client connection, the initiator node is the node associated with the specific host to which the connection was made.&#34;&gt;initiator node&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/epoch-functions/set-ahm-epoch/#&#34;&gt;SET_AHM_EPOCH&lt;/a&gt;&lt;/code&gt; sets the AHM to the specified epoch.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/epoch-functions/make-ahm-now/#&#34;&gt;MAKE_AHM_NOW&lt;/a&gt;&lt;/code&gt; sets the AHM to the greatest allowable value. This lets you purge all deleted data.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you call &lt;code&gt;SET_AHM_TIME&lt;/code&gt;, keep in mind that the timestamp you specify is mapped to an epoch, which by default has a three-minute granularity. Thus, if you specify an AHM time of &lt;code&gt;2008-01-01 00:00:00.00&lt;/code&gt;, the database might purge data from the first three minutes of 2008, or retain data from last three minutes of 2007.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

You cannot advance the AHM beyond a point where the database is unable to recover data for a down node.

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Purge deleted data from the desired projections with one of the following functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/db-functions/purge/#&#34;&gt;PURGE&lt;/a&gt;&lt;/code&gt; purges all projections in the physical schema.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/table-functions/purge-table/#&#34;&gt;PURGE_TABLE&lt;/a&gt;&lt;/code&gt; purges all projections anchored to the specified table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/projection-functions/purge-projection/#&#34;&gt;PURGE_PROJECTION&lt;/a&gt;&lt;/code&gt; purges the specified projection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/purge-partition/#&#34;&gt;PURGE_PARTITION&lt;/a&gt;&lt;/code&gt; purges a specified partition.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/tuple-mover-tm/&#34; title=&#34;The Tuple Mover manages ROS data storage.&#34;&gt;tuple mover&lt;/a&gt; performs a &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/mergeout/&#34; title=&#34;&#34;&gt;mergeout&lt;/a&gt; operation to purge the data. The database periodically invokes the tuple mover to perform mergeout operations, as configured by &lt;a href=&#34;../../../../../en/sql-reference/config-parameters/tuple-mover-parameters/&#34;&gt;tuple mover parameters&lt;/a&gt;. You can manually invoke the tuple mover by calling the function 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/storage-functions/do-tm-task/#&#34;&gt;DO_TM_TASK&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;

Manual purge operations can take a long time.

&lt;/div&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/failure-recovery/epochs/#&#34;&gt;Epochs&lt;/a&gt; for additional information about how epochs work.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
