<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Epoch functions</title>
    <link>/en/sql-reference/functions/management-functions/epoch-functions/</link>
    <description>Recent content in Epoch functions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/management-functions/epoch-functions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: ADVANCE_EPOCH</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/advance-epoch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/advance-epoch/</guid>
      <description>
        
        
        &lt;p&gt;Manually closes the current epoch and begins a new epoch.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ADVANCE_EPOCH ( [ &lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt; ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;&lt;span class=&#34;code-variable&#34;&gt;integer&lt;/span&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies the number of epochs to advance.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;p&gt;This function is primarily maintained for backward compatibility with earlier versions of OpenText™ Analytics Database.&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following command increments the epoch number by 1:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT ADVANCE_EPOCH(1);
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GET_AHM_EPOCH</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/get-ahm-epoch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/get-ahm-epoch/</guid>
      <description>
        
        
        &lt;p&gt;Returns the number of 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; in which the &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;Ancient History Mark&lt;/a&gt; is located. Data deleted up to and including the AHM epoch can be purged from physical storage.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GET_AHM_EPOCH()
&lt;/code&gt;&lt;/pre&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;

The AHM epoch is 0 (zero) by default (purge is disabled).

&lt;/div&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GET_AHM_EPOCH();
    GET_AHM_EPOCH
----------------------
 Current AHM epoch: 0
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GET_AHM_TIME</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/get-ahm-time/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/get-ahm-time/</guid>
      <description>
        
        
        &lt;p&gt;Returns a TIMESTAMP value representing the &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;Ancient History Mark&lt;/a&gt;. Data deleted up to and including the AHM epoch can be purged from physical storage.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GET_AHM_TIME()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GET_AHM_TIME();
                  GET_AHM_TIME
-------------------------------------------------
 Current AHM Time: 2010-05-13 12:48:10.532332-04
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GET_CURRENT_EPOCH</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/get-current-epoch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/get-current-epoch/</guid>
      <description>
        
        
        &lt;p&gt;The epoch into which data (COPY, INSERT, UPDATE, and DELETE operations) is currently being written.&lt;/p&gt;

&lt;p&gt;Returns the number of the current epoch.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GET_CURRENT_EPOCH()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GET_CURRENT_EPOCH();
 GET_CURRENT_EPOCH
-------------------
               683
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: GET_LAST_GOOD_EPOCH</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/get-last-good-epoch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/get-last-good-epoch/</guid>
      <description>
        
        
        &lt;p&gt;Returns the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/last-good-epoch-lge/&#34; title=&#34;A term used in manual recovery, LGE (Last Good Epoch) refers to the most recent epoch that can be recovered.&#34;&gt;last good epoch&lt;/a&gt; number. If the database has no projections, the function returns an error.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;GET_LAST_GOOD_EPOCH()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT GET_LAST_GOOD_EPOCH();
 GET_LAST_GOOD_EPOCH
---------------------
                 682
(1 row)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Sql-Reference: MAKE_AHM_NOW</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/make-ahm-now/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/make-ahm-now/</guid>
      <description>
        
        
        &lt;p&gt;Sets the &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;Ancient History Mark&lt;/a&gt; (AHM) to the greatest allowable value. This lets you purge all deleted data.

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

After running this function, you cannot query historical data that precedes the current epoch. Only database administrators should use this function.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;MAKE_AHM_NOW&lt;/code&gt; performs the following operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Advances the epoch.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sets the AHM to the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/last-good-epoch-lge/&#34; title=&#34;A term used in manual recovery, LGE (Last Good Epoch) refers to the most recent epoch that can be recovered.&#34;&gt;last good epoch&lt;/a&gt; (LGE) — at least to the epoch that is current when you execute &lt;code&gt;MAKE_AHM_NOW&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MAKE_AHM_NOW ( [ &lt;span class=&#34;code-variable&#34;&gt;true &lt;/span&gt;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;true &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Allows AHM to advance when one of the following conditions is true:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;One or more nodes are down.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One projection is being refreshed from another (retentive refresh).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In both cases , you must supply this argument to &lt;code&gt;MAKE_AHM_NOW&lt;/code&gt;, otherwise OpenText™ Analytics Database returns an error. If you execute &lt;code&gt;MAKE_AHM_NOW(true)&lt;/code&gt; during retentive refresh, the database rolls back the refresh operation and advances the AHM.

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

If the function advances AHM beyond the last good epoch of the down nodes, those nodes must recover all data from scratch.

&lt;/div&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;setting-ahm-when-nodes-are-down&#34;&gt;Setting AHM when nodes are down&lt;/h2&gt;
&lt;p&gt;If any node in the cluster is down, you must call &lt;code&gt;MAKE_AHM_NOW&lt;/code&gt; with an argument of true; otherwise, the function returns an error.

&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;

This requirement applies only to Enterprise mode; in Eon mode, it is ignored.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;In the following example, &lt;code&gt;MAKE_AHM_NOW&lt;/code&gt; advances the AHM even though a node is down:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MAKE_AHM_NOW(true);
WARNING:  Received no response from v_vmartdb_node0002 in get cluster LGE
WARNING:  Received no response from v_vmartdb_node0002 in get cluster LGE
WARNING:  Received no response from v_vmartdb_node0002 in set AHM
         MAKE_AHM_NOW
------------------------------
 AHM set (New AHM Epoch: 684)
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&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;/li&gt;
&lt;li&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;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SET_AHM_EPOCH</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/set-ahm-epoch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/set-ahm-epoch/</guid>
      <description>
        
        
        &lt;p&gt;Sets the &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;Ancient History Mark&lt;/a&gt; (AHM) to the specified epoch. This function allows deleted data up to and including the AHM epoch to be purged from physical storage.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SET_AHM_EPOCH&lt;/code&gt; is normally used for testing purposes. Instead, consider using 
&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; which is easier to use.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SET_AHM_EPOCH ( &lt;span class=&#34;code-variable&#34;&gt;epoch, &lt;/span&gt;[ &lt;span class=&#34;code-variable&#34;&gt;true &lt;/span&gt;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;epoch &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies one of the following:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The number of the epoch in which to set the AHM&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Zero (0) (the default) disables &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/db-functions/purge/#&#34;&gt;PURGE&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
&lt;p&gt;The number of the specified epoch must be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Greater than the current AHM epoch&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Less than the current epoch&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Query the &lt;a href=&#34;../../../../../en/sql-reference/system-tables/v-monitor-schema/system/#&#34;&gt;SYSTEM&lt;/a&gt; table to view current epoch values relative to the AHM.&lt;/p&gt;

&lt;/div&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;true &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Allows the AHM to advance when nodes are down.

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

If you advance AHM beyond the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/last-good-epoch-lge/&#34; title=&#34;A term used in manual recovery, LGE (Last Good Epoch) refers to the most recent epoch that can be recovered.&#34;&gt;last good epoch&lt;/a&gt; of the down nodes, those nodes must recover all data from scratch.

&lt;/div&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;setting-ahm-when-nodes-are-down&#34;&gt;Setting AHM when nodes are down&lt;/h2&gt;
&lt;p&gt;If any node in the cluster is down, you must call &lt;code&gt;SET_AHM_EPOCH&lt;/code&gt; with an argument of true; otherwise, the function returns an error.

&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;

This requirement applies only to Enterprise mode; in Eon mode, it is ignored.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following command sets the AHM to a specified epoch of 12:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SET_AHM_EPOCH(12);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following command sets the AHM to a specified epoch of 2 and allows the AHM to advance despite a failed node:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SET_AHM_EPOCH(2, true);
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&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;/li&gt;
&lt;li&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;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SET_AHM_TIME</title>
      <link>/en/sql-reference/functions/management-functions/epoch-functions/set-ahm-time/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/epoch-functions/set-ahm-time/</guid>
      <description>
        
        
        &lt;p&gt;Sets the &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;Ancient History Mark&lt;/a&gt; (AHM) to the epoch corresponding to the specified time on the initiator node. This function allows historical data up to and including the AHM epoch to be purged from physical storage. &lt;code&gt;SET_AHM_TIME&lt;/code&gt; returns a TIMESTAMPTZ that represents the end point of the AHM epoch.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SET_AHM_TIME ( &lt;span class=&#34;code-variable&#34;&gt;time&lt;/span&gt;, [ &lt;span class=&#34;code-variable&#34;&gt;true &lt;/span&gt;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;time&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;A &lt;a href=&#34;../../../../../en/sql-reference/data-types/datetime-data-types/timestamptimestamptz/#&#34;&gt;TIMESTAMP/TIMESTAMPTZ&lt;/a&gt; value that is automatically converted to the appropriate epoch number.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;true&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Allows the AHM to advance when nodes are down.

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

If you advance AHM beyond the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/last-good-epoch-lge/&#34; title=&#34;A term used in manual recovery, LGE (Last Good Epoch) refers to the most recent epoch that can be recovered.&#34;&gt;last good epoch&lt;/a&gt; of the down nodes, those nodes must recover all data from scratch.

&lt;/div&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Superuser&lt;/p&gt;

&lt;h2 id=&#34;setting-ahm-when-nodes-are-down&#34;&gt;Setting AHM when nodes are down&lt;/h2&gt;
&lt;p&gt;If any node in the cluster is down, you must call &lt;code&gt;SET_AHM_TIME&lt;/code&gt; with an argument of true; otherwise, the function returns an error.

&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;

This requirement applies only to Enterprise mode; in Eon mode, it is ignored.

&lt;/div&gt;&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Epochs depend on a configured epoch advancement interval. If an epoch includes a three-minute range of time, the purge operation is accurate only to within minus three minutes of the specified timestamp:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SET_AHM_TIME(&amp;#39;2008-02-27 18:13&amp;#39;);
           set_ahm_time
------------------------------------
 AHM set to &amp;#39;2008-02-27 18:11:50-05&amp;#39;
(1 row)
&lt;/code&gt;&lt;/pre&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;

The –05 part of the output string is a time zone value, an offset in hours from UTC (Universal Coordinated Time, traditionally known as Greenwich Mean Time, or GMT).

&lt;/div&gt;
&lt;p&gt;In the previous example, the actual AHM epoch ends at 18:11:50, roughly one minute before the specified timestamp. This is because SET_AHM_TIME selects the epoch that ends at or before the specified timestamp. It does not select the epoch that ends after the specified timestamp because that would purge data deleted as much as three minutes after the AHM.&lt;/p&gt;
&lt;p&gt;For example, using only hours and minutes, suppose that epoch 9000 runs from 08:50 to 11:50 and epoch 9001 runs from 11:50 to 15:50. &lt;code&gt;SET_AHM_TIME(&#39;11:51&#39;)&lt;/code&gt; chooses epoch 9000 because it ends roughly one minute before the specified timestamp.&lt;/p&gt;
&lt;p&gt;In the next example, suppose that a node went down at 11:00:00 AM on January 1st 2017. At noon, you want to advance the AHM to 11:15:00, but the node is still down.&lt;/p&gt;
&lt;p&gt;Suppose you try to set the AHM using this command:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SET_AHM_TIME(&amp;#39;2017-01-01 11:15:00&amp;#39;);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you will receive an error message. OpenText™ Analytics Database prevents you from moving the AHM past the point where a node went down. The database returns this error to prevent the AHM from advancing past the down node&#39;s last good epoch. You can force the AHM to advance by supplying the optional second parameter:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SET_AHM_TIME(&amp;#39;2017-01-01 11:15:00&amp;#39;, true);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, if you force the AHM past the last good epoch, the failed node will have to recover from scratch.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&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;/li&gt;
&lt;li&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;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/statements/set-statements/set-datestyle/#&#34;&gt;SET DATESTYLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/data-types/datetime-data-types/timestamptimestamptz/#&#34;&gt;TIMESTAMP/TIMESTAMPTZ&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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