Join IIUG
 for   
 

Informix News
18 Nov 13 - ZDNet - Top 20 mobile skills in demand... Read
09 Sep 13 - telecompaper - Shaspa and Tatung have shown a new smart home platform at Ifa in Berlin. Powered by the IBM Informix software... Read
06 Sep 13 - IBM data magazine - Mission Accomplished - Miami, Florida will be the backdrop for the 2014 IIUG Informix Conference... Read
01 Feb 13 - IBM Data Magazine - Are your database backups safe? Lester Knutsen (IBM Champion) writes about database back up safety using "archecker"... Read
14 Nov 12 - IBM - IBM's Big Data For Smart Grid Goes Live In Texas... Read
3 Oct 12 - The Financial - IBM and TransWorks Collaborate to Help Louisiana-Pacific Corporation Achieve Supply Chain Efficiency... Read
28 Aug 12 - techCLOUD9 - Splunk kicks up a SaaS Storm... Read
10 Aug 12 - businessCLOUD9 - Is this the other half of Cloud monitoring?... Read
3 Aug 12 - IBM data management - Supercharging the data warehouse while keeping costs down IBM Informix Warehouse Accelerator (IWA) delivers superior performance for in-memory analytics processing... Read
2 Aug 12 - channelbiz - Oninit Group launches Pay Per Pulse cloud-based service... Read
28 May 12 - Bloor - David Norfolk on the recent Informix benchmark "pretty impressive results"... Read
23 May 12 - DBTA - Informix Genero: A Way to Modernize Informix 4GL Applications... Read
9 Apr 12 - Mastering Data Management - Upping the Informix Ante: Advanced Data Tools... Read
22 Mar 12 - developerWorks - Optimizing Informix database access... Read
14 Mar 12 - BernieSpang.com - International Informix User Group set to meet in San Diego... Read
1 Mar 12 - IBM Data Management - IIUG Heads West for 2012 - Get ready for sun and sand in San Diego... Read
1 Mar 12 - IBM Data Management - Running Informix on Solid-State Drives.Speed Up Database Access... Read
26 Feb 12 - BernieSpan.com - Better results, lower cost for a broad set of new IBM clients and partners... Read
24 Feb 12 - developerWorks - Informix Warehouse Accelerator: Continuous Acceleration during Data Refresh... Read
6 Feb 12 - PRLOG - Informix port delivers unlimited database scalability for popular SaaS application ... Read
2 Feb 12 - developerWorks - Loading data with the IBM Informix TimeSeries Plug-in for Data Studio... Read
1 Feb 12 - developerWorks - 100 Tech Tips, #47: Log-in to Fix Central... Read
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter

[ 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.