Re: Smart Blob Space Size
Posted in 2017
Topics: Storage & Space Management, SQL Development & Query Writing
Hi. We're monitoring the %space free for all dbspaces/sbspaces to be used for OVO using next script: SELECT d.name dbspace, SUM(chksize) as espacio, CASE WHEN is_sbspace =1 THEN SUM(chksize)-SUM(udfree) WHEN is_sbspace =0 THEN SUM(chksize)-SUM(nfree) END as ocupado , CASE WHEN is_sbspace =1 THEN trunc(((sum(chksize)-sum(udfree))*100)/sum(chksize),2) WHEN is_sbspace =0 THEN trunc(((sum(chksize)-sum(nfree))*100)/sum(chksize),2) END as p_ocupado FROM sysmaster:syschunks c, sysmaster:sysdbspaces d WHERE c.dbsnum=d.dbsnum GROUP BY d.dbsnum, d.name, d.is_sbspace ; Best regards
It's not quite that simple. The calculation for dumb blob spaces is different as well. If you want you can just use the dbsavail utility from my utils2_ak package running it as: Report %free: dbsavail -p Report %free and sort by %free: dbsavail -p -P Even if you don't want to use the reporting part, it installs a stored procedure into sysmaster that actually performs all of the calculations, so your reporting tool could just use the procedure or at least you can see the required calculations in the code there. You can download the latest utils2_ak from my web site: www.askdbmgt.com/my-utilities.html Art Art S. Kagel, President and Principal Consultant ASK Database Management www.askdbmgt.com Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, Jul 14, 2017 at 4:27 AM, EDUARDO OCHOA <eduardo.ochoa@es.ibm.com> wrote: > Hi. > We're monitoring the %space free for all dbspaces/sbspaces to be used for > OVO > using next script: > > SELECT > > d.name dbspace, > > SUM(chksize) as espacio, > > CASE > WHEN is_sbspace =1 THEN SUM(chksize)-SUM(udfree) > WHEN is_sbspace =0 THEN SUM(chksize)-SUM(nfree) > END > as ocupado , > > CASE > WHEN is_sbspace =1 THEN trunc(((sum(chksize)-sum( > udfree))*100)/sum(chksize),2) > WHEN is_sbspace =0 THEN trunc(((sum(chksize)-sum( > nfree))*100)/sum(chksize),2) > END as p_ocupado > > FROM sysmaster:syschunks c, sysmaster:sysdbspaces d > > WHERE c.dbsnum=d.dbsnum > > GROUP BY d.dbsnum, d.name, d.is_sbspace > ; > > Best regards > > > ************************************************************ > ******************* > Forum Note: Use "Reply" to post a response in the discussion forum. > >