Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
The poster asked how to find the physical log's total allocated space and space used via SMI tables, specifically so it could be queried with plain SQL over JDBC rather than shell/onstat tools. One reply offered a ksh script using sysdbspaces/syschunks for dbspace usage, which didn't fit the JDBC requirement. The working answer was to query sysmaster:sysplog, which holds the same physical log figures shown at the top of 'onstat -l' output; selected columns give the size and used values. The original poster confirmed it worked.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
PRATHEEP KK — — source: IIUG Forums & Mailing Lists
Hi all
How do I get the space use in physical logs? I need to get the total space
allocated and total used by physical logs using SMI tables.
Any help on this is highly appreciated
Thanks in advance
Pratheep
Pratheep,
I have a little script that might be useful. We only have IDS 7.31 and 9.40 so
it works for at least those two versions. You did not indicate your version of
IDS and I have not been allowed to use any version higher than 9.40, so I
don't know if it will apply to you or not. Here it is:
--------------------------------------------------------------------------------
--------------------
#!/usr/bin/ksh
#-------------------------------------------------------------------------------
# space.ksh
#
# This script is a rewrite of the original space script. This version
# handles the following situations:
#
# if there are smartblob dbspaces (handles metadata space)
# if there are gaps in dbspace numbering
# Informix engine versions 9 or greater versus less than 9
#-------------------------------------------------------------------------------
export WORKFILE=/tmp/space.$$
export MAJOR_VER=`echo "select dbinfo('version','major')
from systables where tabid=1" \\\\
| dbaccess sysmaster 2>/dev/null \\\\
| sed '/constant/d;/^ *$/d'`
if [ "$MAJOR_VER" -ge 9 ]
then
echo "unload to $WORKFILE delimiter ' '
select name,syschunks.dbsnum,is_sbchunk,
sum(chksize),sum(nfree),sum(mdsize),sum(udfree)
from sysdbspaces,syschunks
where sysdbspaces.dbsnum=syschunks.dbsnum
group by name,syschunks.dbsnum,is_sbchunk
order by syschunks.dbsnum" \\\\
| dbaccess sysmaster >/dev/null 2>&1
else
echo "unload to $WORKFILE delimiter ' '
select name,syschunks.dbsnum,0,
sum(chksize),sum(nfree),0,0
from sysdbspaces,syschunks
where sysdbspaces.dbsnum=syschunks.dbsnum
group by name,syschunks.dbsnum
order by syschunks.dbsnum" \\\\
| dbaccess sysmaster >/dev/null 2>&1
fi
awk ' BEGIN { printf("\\
- - - - - -(kbs)- - - - - -")
printf("\\
DBSPACE %%FREE USED FREE TOTAL\\
")}
{ totsize+=$4
if ($3 == 1)
{ printf("\\
%-18s %7.2f%% ", $1,$7/$4*100)
printf("%9d %9d %9d ", ($4-$7)*kpp,$7*kpp,$4*kpp)
printf("\\
%-16s %7.2f%% ", "Metadata:",$5/$6*100)
printf(" %9d %9d ", ($6-$5)*kpp,$5*kpp)
printf("%9d", $6*kpp)
totfree+=$7 }
else
{ printf("\\
%-18s %7.2f%% ", $1,$5/$4*100)
printf("%9d %9d %9d ", ($4-$5)*kpp,$5*kpp,$4*kpp)
totfree+=$5 }
}
END { printf("\\
\\
%-26s", "TOTAL:")
printf("%9d %9d %9d\\
", (totsize-totfree)*kpp,totfree*kpp,totsize*kpp) }
' kpp=`onstat -b|grep "buffer size"|awk '{print ($(NF-2))/1024}'` $WORKFILE
rm -f $WORKFILE
--------------------------------------------------------------------------------
--------------------
Hope it helps
Rob Schmitz
Embarq Data Management
rob.b.schmitz@embarq.com
www.embarq.com
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of PRATHEEP
KK
Sent: Wednesday, November 05, 2008 7:37 AM
To: ids@iiug.org
Subject: space used by physical logs [13907]
Hi all
How do I get the space use in physical logs? I need to get the total space
allocated and total used by physical logs using SMI tables.
Any help on this is highly appreciated
Thanks in advance
Pratheep
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
↪ replying to Schmitz, Rob B [EQ]
PRATHEEP KK — — source: IIUG Forums & Mailing Lists
Hi Rob,
Thank you very much for the quick reply.
I am sorry, I didn't mention my requirement correctly.
I should be able to execute an SQL query throw jdbc call and get the physical
log space used and total.
Pratheep
Hi,
you may want to start with something like
SELECT * from sysmaster:sysplog;
Probably has more than you need - select from specific
columns as you like ...
Regards,
Martin
--
Martin Fuerderer
IBM Informix Development Munich, Germany
Information Management
IBM Deutschland Research & Development GmbH
Chairman of the Supervisory Board: Martin Jetter
Board of Management: Erich Baier
Corporate Seat: Boeblingen, Germany
Reg.-Gericht: Amtsgericht Stuttgart, HRB 243294
ids-bounces@iiug.org wrote on 05.11.2008 15:15:06:
> Hi Rob,
>
> Thank you very much for the quick reply.
>
> I am sorry, I didn't mention my requirement correctly.
>
> I should be able to execute an SQL query throw jdbc call and get
thephysical
> log space used and total.
>
> Pratheep
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
The table sysmaster:sysplog has the data that is displayed at the top of the
onstat -l output related to the physical log.
Art
On Wed, Nov 5, 2008 at 8:36 AM, PRATHEEP KK <pratheepkk@gmail.com> wrote:
> Hi all
>
> How do I get the space use in physical logs? I need to get the total space
> allocated and total used by physical logs using SMI tables.
>
> Any help on this is highly appreciated
>
> Thanks in advance
> Pratheep
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
↪ replying to Martin Fuerderer
PRATHEEP KK — — source: IIUG Forums & Mailing Lists
Hi,
The solution worked! Thank you very much.
Pratheep
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.