for   
Save 
Save 
   Join IIUG  

Informix News
14 August 08 - IIUG.org - Sellout Expected for the 2009 IIUG Informix Conference... Read
29 April 08 - IntelligentEnterprise.com - IBM Informix Upgrade Enhances Clustering, Database Management... Read
29 April 08 - itweek.com - IBM 'Cheetah 2' mauls data costs... Read
28 April 08 - eWeek.com - IBM Uncages Cheetah 2 Data Server... Read
28 April 08 - CNNMoney.com - IBM Helps Clients Reduce Data Management Costs With New Informix Dynamic Server... Read
09 April 08 - CNNMoney.com - MediaSpan Embeds IBM Informix Dynamic Server Software for Delivering News to Print, Web and Wireless Devices... Read
08 April 08 - IT-Director.com - Informix seeks developers... Read
18 February 08 - marketwire.com - Icarus Studios Partners With IBM to Upgrade Performance, Availability for Its Online Games... Read
17 January 08 - eWeek.com - IBM Adds Mac Support to IDS for Higher Education... Read
17 January 08 - informationweek.com - Lotus Notes For iPhone Signals Closer Ties Between IBM, Apple... Read
16 January 08 - marketwire.com - IBM Informix Dynamic Server to Deliver Support for Mac OS X... Read
16 January 08 - internetnews.com - IBM's IDS to Support Mac Platform... Read
28 June 07 - REG Developer - IBM and Informix tie down Cheetah... Read
27 June 07 - CBRonline.com - IBM corrects its own Informix customer figures... Read
14 June 07 - vnunet.com - IBM changes spots with Informix 'Cheetah' database... Read
14 June 07 - eChannelLine - IBM expands scope for IDS... Read
14 June 07 - Resellernews - IBM: Informix database alive and kicking... Read
13 June 07 - DB2 Magazine - Cheetah is now out of the gate... Read
12 June 07 - IBM - IDS 11 release announcement (pdf)... Read
12 June 07 - ChannelWeb Network - IBM Uncages IDS 11, Aka Cheetah, Database... Read
12 June 07 - eWeek.com - IBM's 'Cheetah' Ready to Pounce... Read
12 June 07 - InformationWeek - IBM Unleashes 'Cheetah' Database... Read
12 June 07 - WebWire - IBM Strengthens Database Portfolio With New Informix Dynamic Server... Read
12 June 07 - Intelligent Enterprise - IBM Unveils Informix Upgrade... Read
12 June 07 - ComputerWeekly.com - IBM's Cheetah IDS makes leap to better data centre clustering... Read
12 June 07 - ebiz - IBM Unveils Next Generation Informix Dynamic Server... Read
12 June 07 - computerworld.com - Will 'Cheetah' help IBM's Informix chase down market share?... Read
12 June 07 - Internetnews.com - No Data Can Outrun This 'Cheetah'... Read
12 June 07 - de.internet.com - IBM neuer Datenbank-Server mit Codenamen Cheetah ist fertig... Read
12 June 07 - verifox.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - golem.de - Informix 11 vorgestellt... Read
12 June 07 - Computerwoche.de - IBM stellt neue Informix-Version vor... Read
12 June 07 - IBM.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - Heise - IBM gibt Informix 11 frei... Read
25 May 07 - Taiwan.CNET.com - Local Taiwan Informix user group established... (Chinese language) ... Read
18 May 07 - ChannelWeb Network - IBM Musters Partners For Cheetah Release... Read
18 May 07 - eWeek.com - IBM Looks to 'Cheetah' to Speed Up Blade Servers... Read
7 May 07 - DB2 Magazine - SQL Shortcuts - Use these tricks to generate IDS SQL scripts... Read

Previous news items
 

Home Member Area About IIUG


Resources
IIUG Insider
IIUG Hotspots
IBM-Informix Links
IIUG RSS Feeds
Software Repository
Informix Products
Online Resources
Informix Library
Informix Books
IIUG Banners
Discussion
Technical SIGs
Non-technical
Other Discussion
Community
Events
Webcasts/Chat w Lab
IIUG TV
IIUG Sponsors
Informix Business Directory
IIUG Press Partners
Local User Groups
Job Board
Fun Stuff

[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

IDS Forum

RE: Tablespace Allocation versus Storage Needs (More Scripting [9 [985]

Posted By:
Date:






George is right....TRUNC....

I didn't look at the script(s)...keep in mind that rows larger than a page
will have 4 bytes for it's slot table entry, a 4-byte forward pointer on
the home page, and slot table entry of 4 bytes on the remainder page. If a
row spans multiple pages, then this will repeat.

HTH -
Mark.

Mark Scranton
Principal Consultant/Teacher
IBM Denver

IBM Software Group - Data Management
Office: 303-773-5067
Cell: 303-929-0914
email: mscranto@us.ibm.com





"Palmer, George"
<George.Palmer@pe To: ids@iiug.org
gs.com> cc:
Sent by: Subject: RE: Tablespace Allocation versus Storage Needs (More Scripting [9 [985]
forum.subscriber@
iiug.org


04/24/2003 10:23
AM






A few notes. I have not looked into the script carfully because of more
pressing problems locally

Rows per page needs to use TRUC around ( pagesize - overhead / rowsize +
size of slot (4) )
I did not read cafully but did you account for slot table entry in all
places.

You do not mention what release of Informix, In Non Fragmented table in
release 7, Indexes are inside the table by default not detached ( could
this
be a problem for you ? )

George




-----Original Message-----
From: bill.robert.... [mailto:bill.roberts@verizon.com]
Sent: Thursday, April 24, 2003 8:24 AM
To: ids@iiug.org
Subject: Tablespace Allocation versus Storage Needs (More Scripting
[984]




IDS 7.31FD4X2
SunOS 5.7

Okay team, here's one for you:

This copy of the e-mail actually tells you what the problem is...apolog=
ies
for the previous omission.

I have written a script that is supposed to report space allocation for=

table and table-fragment tablespaces. I am receiving some erroneous res=
ults
and I have not been able to pinpoint the error in my logic. Please take=
a
look and see what you can see?I know I am receiving flawed results for =
52
of 2071 tables, but we all know what that means?

The problem: Some tables report that the amount of space I calculate is=

needed to store the actual number of rows in the table is greater than =
the
amount of space I calculate to be allocated to that table's tablespace.=

Update stats is not an issue.

The eventual goal is to report tables that are allocated beyond their
needs. Such tables would be marked for analysis as candidates for rebui=
ld
to free space within a dbspace. If you know a better way, I am open to
suggestion (but likely to continue trudging the path to my destiny with=
in
the SMI tables...).

Note that this is a first run through and I am aware that there are oth=
er
considerations when it comes to storage so feel free to mention what yo=
u
know. You can leave out the varchar part though; rowsize is the max
possible size for a row (as far as I can determine) and that will err i=
n my
favor...

The logic I am using to calculate the space needed to hold the rows tha=
t
exist within a table is:

the number of rows that fit on a page is calculated with this formula:=

('pagesize less overhead' / rowsize)

The pages required to store those rows is calculated with this formula=
:
('number of rows in the table' / 'number of rows that fit on a page')

The KB required to store those rows is calculated with this formula:
('number of pages to store rows * 'O/S page size')


(See attached file: 4iiug.tar)

Regards,
Bill Roberts

AAIS Core Production Support, Informix DBA
Verizon Data Services
Office : (813) 978-2340
Pager: (888) 423-6604
e-mail:bill.roberts@verizon.com

http://dbaman.tmtrfl.tel.gte.com/browser.cgi


#!/bin/ksh
#set -x
#######################################################################=
#########
# Place your very own environmental script here...
#######################################################################=
#########
. /opt/informix/dba.env.sh

#######################################################################=
#########
# Calculate the pagesize less overhead for my O/S.
#######################################################################=
#########
PAGE_SIZE=3D$(onstat -b | grep buffer | awk {'print $10'})
PAGE_SIZE_LO=3D$(expr $(onstat -b | grep buffer | awk {'print $10'}) - =
24)

#######################################################################=
#########
# Create a list of databases in an instance.
#######################################################################=
#########
for DB in $(printf "output to pipe cat without headings select name fro=
m \
sysdatabases where name not in
('onpload','sysmaster','sysutils');" \
| dbaccess 2>/dev/null sysmaster);do

#######################################################################=
#########
# Check for connect permission.
#######################################################################=
#########
echo | dbaccess > /dev/null 2>&1 ${DB}
RC=3D$?
if [ ${RC} -ne 0 ];then
echo "No connect permission to ${DB}"
else

#######################################################################=
#########
# Check for logging and set isolation level if it is on.
#######################################################################=
#########
IS_LOGGED=3D$(printf "output to pipe cat without headings \
select is_logging from \
sysdatabases where name =3D \"${DB}\";" \
| dbaccess 2>/dev/null sysmaster | tr -d [:space:])
if [ ${IS_LOGGED} -eq 0 ];then
SET_ISOLATION_LEVEL=3D
else
SET_ISOLATION_LEVEL=3D'set isolation dirty read;'
fi
#######################################################################=
#########
# Create a cross-reference for tables/dbspaces. Remove a lot of junk fr=
om
the
# select once the bugs are fixed...
# Oh, and by the way:
#
# the number of rows that fit on a page is calculated with this formula=
:
# ('pagesize less overhead' / rowsize)
#
# The pages required to store those rows is calculated with this formul=
a:
# ('number of rows in the table' / 'number of rows that fit on a page')=

#
# The KB required to store those rows is calculated with this formula:
# ('number of pages to store rows * 'O/S page size'
#
# Note that this is a first run through and I am aware that there are o=
ther
# considerations when it comes to storage (varchar overhead comes to mi=
nd),
but
# I'll work these issues out later (feel free to mention it though...)
#######################################################################=
#########
UNL_FILE=3D${DB}_t2d.unl
TXT_FILE=3D${DB}_t2d.txt
printf "${SET_ISOLATION_LEVEL}
UNLOAD TO ${UNL_FILE} delimiter \" \"
SELECT UNIQUE partnum,
name,
tabname,
tabtype,
rowsize,
nrows,
(ROUND((nrows*rowsize)/1024)) ROWS_KB,
(ROUND(nrows/(${PAGE_SIZE_LO}/rowsize))
*${PAGE_SIZE}) KB_4_ROWS,
(SUM(te_size)*${PAGE_SIZE}) EXTENTS_KB,
(ROUND((nrows*rowsize)/1024)/(SUM(te_size)
*${PAGE_SIZE})*100) PERCENT_ROWS
FROM systables t, sysmaster:sysdbspaces s,
sysmaster:systabextents e
WHERE t.tabid > 99
and t.tabtype =3D \"T\"
and t.partnum !=3D 0
and s.dbsnum =3D trunc(t.partnum / 1048576)
and t.partnum =3D e.te_partnum
GROUP BY 1,2,3,4,5,6
UNION
SELECT UNIQUE partn,
name,
tabname,
fragtype,
t.rowsize,
f.nrows,
(ROUND(f.nrows*(t.rowsize+4)/1024)) USED_KB,
(ROUND((f.nrows/${PAGE_SIZE_LO}/(t.rowsize+4))=

*${PAGE_SIZE})) KB_4_ROWS,
(SUM(te_size)*${PAGE_SIZE}) ALLOCATED_KB,
(ROUND((f.nrows*(t.rowsize+4)/1024)/(SUM(te_si=
ze)
*${PAGE_SIZE}))*100) PERCENT_ROWS
FROM systables t, sysfragments f, sysmaster:sysdbspaces s,
sysmaster:systabextents e
WHERE t.tabid =3D f.tabid
and f.fragtype =3D \"T\"
and s.dbsnum =3D trunc(f.partn / 1048576)
and f.partn =3D e.te_partnum
GROUP BY 1,2,3,4,5,6
ORDER BY 3,2;" | dbaccess 2>/dev/null ${DB}

#######################################################################=
#########
# Create a few integer variables...
#######################################################################=
#########
typeset -i PARTN=3D0
typeset -i NROWS=3D0
typeset -i ROWSIZE=3D0
typeset -i USED_KB=3D0
typeset -i KB_4_ROWS=3D0
typeset -i ALLOC_KB=3D0
typeset -i PERCENT_ROWS=3D0

#######################################################################=
#########
# Print a heading.
#######################################################################=
#########
printf "%-9s %-18s %-18s %4s %9s %9s %7s s s %5s\n" \
PARTN DBS TAB TYPE ROWSIZE NROWS USED_KB KB_4_ROWS ALLOC_KB PERCENT_R=
OWS
> ${TXT_FILE} > ${TXT_FILE}

#######################################################################=
#########
# Just an echo so that when I hit an error, I know for which file the e=
rror
# occurred. Take it out later...
#######################################################################=
#########
echo "${UNL_FILE}"

#######################################################################=
#########
# Create a report.
#######################################################################=
#########
cat ${UNL_FILE} | while read PARTN NAME TAB TYPE ROWSIZE NROWS USED_K=
B
KB_4_ROWS ALLOC_KB PERCENT_ROWS;do
printf "%-9d %-18s %-18s %4s } .0f d .2f\n" \
${PARTN} ${NAME} ${TAB} ${TYPE} ${ROWSIZE} ${NROWS} ${USED_KB}
${KB_4_ROWS} ${ALLOC_KB} ${PERCENT_ROWS} >> ${TXT_FILE}
done
rm ${UNL_FILE}
fi
done

#######################################################################=
#########
# Run a script to report the tables that appear to require a greater
allocation
# of space than is actually allocated.
#######################################################################=
#########
echo "Bad Logic nunning now"
t2d_badlogic.ksh > t2d_badlogic.txt
echo "Bad Logic complete"

=






Messages In This Thread

  • Level 0 restore
    Scott O'Rourke -- Thursday, 16 January 2003, at 5:36 a.m.
    • RE: Level 0 restore
      Simmons, Keith -- Thursday, 16 January 2003, at 7:02 a.m.
    • Antw: Level 0 restore
      Andreas.KUTSCHE@spar.at -- Thursday, 16 January 2003, at 7:24 a.m.
    • Re: Antw: Level 0 restore
      Scott O'Rourke -- Thursday, 16 January 2003, at 7:42 a.m.
    • Re: Level 0 restore
      ART KAGEL, BLOOMBERG/ 65E 55TH -- Thursday, 16 January 2003, at 8:39 a.m.
    • RE: Tablespace Allocation versus Storage Needs (More Scripting [9 [985]
      Mark Scranton -- Monday, 28 April 2003, at 8:22 a.m.

[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

IDS Forum is maintained by Administrator with WebBBS 5.12.

©2001 - 2007 International Informix Users Group.   All rights reserved.     Terms of use    
*** Powered By IBM Informix Dynamic Server V10.00 ***