<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage23
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333;background:whitesmoke'>This did it:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333;background:whitesmoke'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333;background:whitesmoke'>> use accounting;</span><span lang=EN-US style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333'><br><span style='background:whitesmoke'>> select count(*) from cdr where start_time < UNIX_TIMESTAMP('2019/01/01')</span><br><span style='background:whitesmoke'>> create table cdr_backup_until_20181231 like cdr;</span><br><span style='background:whitesmoke'>> insert into cdr_backup_until_20181231 select * from cdr where start_time < UNIX_TIMESTAMP('2019/01/01');</span><br><span style='background:whitesmoke'>> select count(*) from cdr_backup_until_20181231;</span><br><span style='background:whitesmoke'>> delete from cdr where start_time < UNIX_TIMESTAMP('2019/01/01');<o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333;background:whitesmoke'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Spce-user <spce-user-bounces@lists.sipwise.com> <b>Im Auftrag von </b>Hohl Matthias<br><b>Gesendet:</b> Montag, 26. August 2019 18:21<br><b>An:</b> 'Rene Krenn' <rkrenn@sipwise.com>; 'Spce-user' <Spce-user@lists.sipwise.com><br><b>Betreff:</b> Re: [Spce-user] Acc Cleanup - Cannot Update partitions for table=cdr the gap is too large<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello Rene,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>yah… i think last time the script was ruinning was before the upgrade from 4.5.5 to 5.5.2 on January 2018. There was my last backup.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Hmm ok I will try this.. thanks.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Rene Krenn <<a href="mailto:rkrenn@sipwise.com">rkrenn@sipwise.com</a>> <br><b>Gesendet:</b> Montag, 26. August 2019 18:15<br><b>An:</b> 'Hohl Matthias' <<a href="mailto:matthias.hohl@telematica.at">matthias.hohl@telematica.at</a>>; 'Spce-user' <<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br><b>Betreff:</b> AW: [Spce-user] Acc Cleanup - Cannot Update partitions for table=cdr the gap is too large<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Seems your cleanup was not running for long time, not just since the upgrade.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Move out all cdrs (and accompanying tables that have a cdr_start_time column) older than 24 months into separate tables.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>1.create table accounting.xy_old like accounting.xy;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>2.insert into accounting.xy_old select from accounting.xy where start_time < unix_timestamp(now() - interval ..<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>3.delete from accounting.xy where start_time < unix_timestamp(now() - interval ..<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>br<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE-AT'>Von:</span></b><span lang=DE style='mso-fareast-language:DE-AT'> Spce-user [<a href="mailto:spce-user-bounces@lists.sipwise.com">mailto:spce-user-bounces@lists.sipwise.com</a>] <b>Im Auftrag von </b>Hohl Matthias<br><b>Gesendet:</b> Montag, 26. August 2019 17:42<br><b>An:</b> 'Spce-user' <<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br><b>Betreff:</b> [Spce-user] Acc Cleanup - Cannot Update partitions for table=cdr the gap is too large<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>After fixing the cleanup script manually (thanks to the hint from Henk Plessius) I have a new error now:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>root@spce:~# /usr/sbin/acc-cleanup.pl<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>ERROR error: Cannot update partitions for table=cdr,the gap between min/max record is too large (more than 24 months). at /usr/share/perl5/NGCP/Cleanup.pm line 361.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>How can I solve this?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='mso-fareast-language:DE-AT'>Mit freundlichen Grüßen,<br>Matthias Hohl<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>