I am seeing the below errors on my asemon logs.
2023/03/15 15:45:23.288 Purge REPSERVER - Purge Thread : archive, error in loop. com.sybase.jdbc4.jdbc.SybSQLException: Arithmetic overflow occurred.
at com.sybase.jdbc4.tds.Tds.processEed(Tds.java:4229)
at com.sybase.jdbc4.tds.Tds.nextResult(Tds.java:3346)
at com.sybase.jdbc4.jdbc.ResultGetter.nextResult(ResultGetter.java:78)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:303)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:285)
at com.sybase.jdbc4.jdbc.SybStatement.updateLoop(SybStatement.java:2763)
at com.sybase.jdbc4.jdbc.SybStatement.executeUpdate(SybStatement.java:2747)
at com.sybase.jdbc4.jdbc.SybStatement.executeUpdate(SybStatement.java:597)
at asemon_logger.PurgeThread.archiveIndic(PurgeThread.java:80)
at asemon_logger.PurgeThread.run(PurgeThread.java:246)
Can you execute manually this query in your asemon database with isql and see if it produces overflow
If yes, try to find if you have abnormal values for IOTime, Reads or Writes in your ASESERVER_DevIO table
The query tries to convert them to numeric(20,0) which is huge but may not be sufficient in some cases
Regards
JP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi JP,
The above query returned values without an error. I tried to review the other queries related to the REPSERVER and found the below causing the arithmetic overflow:
declare @startts datetime
select @startts=isnull(dateadd(dd, 1, (select convert(varchar, max(dt),102) from REPSERVER_Trends where TrendID=16) ),'1900/01/01')
select 16, dt=dateadd(hh,datepart(hh, Timestamp), convert(datetime,convert(varchar,Timestamp,102)) ), Value=avg(val) from (select Timestamp, val=sum(1.*counter_total/1024)/ avg(Interval)
from REPSERVER_RSStats
where Timestamp >= @startts
and Timestamp < convert(varchar,getdate(), 102)
and counter_id=6004 group by Timestamp) lvl0tbl
group by dateadd(hh,datepart(hh, Timestamp), convert(datetime,convert(varchar,Timestamp,102)) )
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes you can do this modification and I'll set that in the next version.
Can you check if you have strange values in the Interval column ?
I never saw this problem on many sites where asemon is installed
Nevertheless I'll port the modificatio on all aggregates
Thanks a lot
JP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi JP,
Sorry to reply just now. I tried to apply the changes on the RSTrends.xml but i can see the same error in the debug logs. It is still using the old query(without the 1.* notation. I have stopped and started the asemon logger though. Any idea why is this so?
Regards,
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Mark
before restarting asemon_logger for your RS, delete rows in the table XXXXX_TrendsCfg
At the first restart of asemon_logger, asemon will re-insert rows in this table , including your modification
Regards
JP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks a lot JP! I don't see the errors now in the log. Now that it's probably fixed, would i be able to see a significant decrease in the database size of my archive db? Reason i asked is because purging was not working for a long time and our archive db grew to a very large size. The oldest data i can see on REPSERVER_Trends is Nov 2020(see below)
1> select top 1 * from REPSERVER_Trends order by dt asc
2> go
TrendID dt Value
1 Nov 14 2020 12:00AM NULL
Our purging setting is only 90 days (xml setting)
<purgearchive daystokeep="90" deletesleep="100"></purgearchive>
If i need to purge manually, can i just delete data on REPSERVER_Trends?
Regards,
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mark, trend data is never purged, and does not use a lot of space
Keep this data, is is interesting to see the trend of some indicators on a long timeframe
Regards
Jp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the clarification JP! Really appreciate your prompt response. How would I know that the data is being purged and what is the schedule of the purging? Any tables i need to check? I need to do capacity management to make sure i have enough space. Right now I have around 500+GB of data usage on one of my archive databases.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Mark,
most of tables are purged automatically (exept trends and some other very small tables) depending on the "daystokeep" param
If set to 90 (the default) it keeps 90 days of data. Often this param is too high and customers lower it to 30
Monitored data volumes depends on many factors, particularly on activity of your monitored server : number of active connections, number of objects, number of captured queries and plans...
So, decrease this paramter if your database fills too fast
You can set this param at collector level. For example to keep only 10 days of data in the SysMon table :
<mddaysToKeep="10">SysMon.xml</md>
(generaly XXXXX_SysMon table is the largest)
Hope this answer your questions
Regards
JP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am seeing the below errors on my asemon logs.
2023/03/15 15:45:23.288 Purge REPSERVER - Purge Thread : archive, error in loop. com.sybase.jdbc4.jdbc.SybSQLException: Arithmetic overflow occurred.
com.sybase.jdbc4.jdbc.SybSQLException: Arithmetic overflow occurred.
2023/03/15 15:45:23.288 Purge REPSERVER - Purge Thread - archive,Closing connection
My asemon_logger version is 3.1.6
Hi,
I don't know this error (no change in Trends.xml since V3.1.6)
Can you start your asemon_logger with trace flag 112:
asemon_logger ... -d 112
You'll get more info on the indicator which threads overflow
Then send me the trace
Regards
JP
Hi JP,
Thanks for the prompt reply. I have attached the logfile for your reference.
Hi Mark
I think the problem is with this query :
Can you execute manually this query in your asemon database with isql and see if it produces overflow
If yes, try to find if you have abnormal values for IOTime, Reads or Writes in your ASESERVER_DevIO table
The query tries to convert them to numeric(20,0) which is huge but may not be sufficient in some cases
Regards
JP
Hi JP,
The above query returned values without an error. I tried to review the other queries related to the REPSERVER and found the below causing the arithmetic overflow:
declare @startts datetime
select @startts=isnull(dateadd(dd, 1, (select convert(varchar, max(dt),102) from REPSERVER_Trends where TrendID=16) ),'1900/01/01')
select 16, dt=dateadd(hh,datepart(hh, Timestamp), convert(datetime,convert(varchar,Timestamp,102)) ), Value=avg(val) from (select Timestamp, val=sum(1.*counter_total/1024)/ avg(Interval)
from REPSERVER_RSStats
where Timestamp >= @startts
and Timestamp < convert(varchar,getdate(), 102)
and counter_id=6004 group by Timestamp) lvl0tbl
group by dateadd(hh,datepart(hh, Timestamp), convert(datetime,convert(varchar,Timestamp,102)) )
Yes I just see that the error was on the REPSERVER purge threadnot ASESERVER
I think the "avg(val) " produce the overflow
You can replace it by "avg(1.*val) "
If this solve the query, you can change it in the file RSTrends.xml :
JP
Thanks JP,
I got an arithmetic overflow still but not after updating avg(Interval) to avg(1.*Interval) as well. Is it correct to update the same?
Yes you can do this modification and I'll set that in the next version.
Can you check if you have strange values in the Interval column ?
I never saw this problem on many sites where asemon is installed
Nevertheless I'll port the modificatio on all aggregates
Thanks a lot
JP
Hi JP,
Sorry to reply just now. I tried to apply the changes on the RSTrends.xml but i can see the same error in the debug logs. It is still using the old query(without the 1.* notation. I have stopped and started the asemon logger though. Any idea why is this so?
Regards,
Mark
Hi Mark
before restarting asemon_logger for your RS, delete rows in the table XXXXX_TrendsCfg
At the first restart of asemon_logger, asemon will re-insert rows in this table , including your modification
Regards
JP
Thanks a lot JP! I don't see the errors now in the log. Now that it's probably fixed, would i be able to see a significant decrease in the database size of my archive db? Reason i asked is because purging was not working for a long time and our archive db grew to a very large size. The oldest data i can see on REPSERVER_Trends is Nov 2020(see below)
1> select top 1 * from REPSERVER_Trends order by dt asc
2> go
TrendID dt Value
Our purging setting is only 90 days (xml setting)
<purgearchive daystokeep="90" deletesleep="100"></purgearchive>
If i need to purge manually, can i just delete data on REPSERVER_Trends?
Regards,
Mark
Mark,
trend data is never purged, and does not use a lot of space
Keep this data, is is interesting to see the trend of some indicators on a long timeframe
Regards
Jp
Thanks for the clarification JP! Really appreciate your prompt response. How would I know that the data is being purged and what is the schedule of the purging? Any tables i need to check? I need to do capacity management to make sure i have enough space. Right now I have around 500+GB of data usage on one of my archive databases.
Hi Mark,
most of tables are purged automatically (exept trends and some other very small tables) depending on the "daystokeep" param
If set to 90 (the default) it keeps 90 days of data. Often this param is too high and customers lower it to 30
Monitored data volumes depends on many factors, particularly on activity of your monitored server : number of active connections, number of objects, number of captured queries and plans...
So, decrease this paramter if your database fills too fast
You can set this param at collector level. For example to keep only 10 days of data in the SysMon table :
(generaly XXXXX_SysMon table is the largest)
Hope this answer your questions
Regards
JP
Thanks so much JP! Really appreciate you help on this!