473,769 Members | 7,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to compute storage utilization per schema

Hi,

Environment:
Only one database per instance however each application is given it's
own schema.

My objective is to compute the space utilized by each application on
the DB2 Database.
Following is my approach and request you to suggest / advise for
correctness.

SELECT T.TABSCHEMA AS SCHEMA_NAME
, count(T.TABNAME ) AS NUM_TABLES
, sum(T.NPAGES) AS TOT_NPAGES
FROM
SYSCAT.TABLES T where T.NPAGES 0 group by T.TABSCHEMA ;

DBSIZE=SUM of all NPAGES ( from above query) * PAGE SIZE

Summing up all the NPAGES for all schema from above result set and
multiplying by Page Size.
The DBSIZE as computed above is no where close enough to the Database
size given by DB2 procedure GET_DBSIZE_INFO .

Would appreciate if someone can inform what i'm missing or my approach
is incorrect.

Thanks,
Naveen.

Oct 19 '07 #1
2 2790
On 19 Okt., 04:02, nbhara...@gmail .com wrote:
Hi,

Environment:
Only one database per instance however each application is given it's
own schema.

My objective is to compute the space utilized by each application on
the DB2 Database.
Following is my approach and request you to suggest / advise for
correctness.

SELECT T.TABSCHEMA AS SCHEMA_NAME
, count(T.TABNAME ) AS NUM_TABLES
, sum(T.NPAGES) AS TOT_NPAGES
FROM
SYSCAT.TABLES T where T.NPAGES 0 group by T.TABSCHEMA ;

DBSIZE=SUM of all NPAGES ( from above query) * PAGE SIZE

Summing up all the NPAGES for all schema from above result set and
multiplying by Page Size.
The DBSIZE as computed above is no where close enough to the Database
size given by DB2 procedure GET_DBSIZE_INFO .

Would appreciate if someone can inform what i'm missing or my approach
is incorrect.

Thanks,
Naveen.
IIRC, pages where LOB's are stored are not counted for NPAGES

Oct 19 '07 #2
Joachim Klassen wrote:
>
IIRC, pages where LOB's are stored are not counted for NPAGES
If your schema contains exclusive tablespaces (SMS or DMS in a file) you
can also just query the size of the tablespace(s) on OS level (du -hs
--max-depth=1). At least, that's how I do it. Not really fancy, but
effective nevertheless. CRON executes a script every night that gives a
sorted directory overview for each tablespace (every client of ours has
his own tablespace) and puts that in a table.
Oct 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2184
by: Leif K-Brooks | last post by:
I'm writing a relatively simple multi-user public Web application with Python. It's a rewrite of a similar application which used PHP+MySQL (not particularly clean code, either). My opinions on various Web frameworks tends to vary with the phase of the moon, but currently, I'm planning to use Quixote. Needless to say, my application will need some kind of persistent data storage. The previous PHP+MySQL application uses around 1.1GB of...
3
3760
by: Dathon | last post by:
I have a Windows service that's built with .NET. The process is meant to run in the background and not suck up too much CPU time. I set the thread priority for the various threads in the service to Below Normal, but I'm still getting reports that the service is making a noticable impact on overall machine performance. I stuck some Thread.Sleep calls in a various places in the code, but that doesn't help much, since the service makes...
3
2464
by: john | last post by:
I don't want to know what the CPU utilization is right now. I want to get the average utilization over the last, for example, hour. So I came up with a method where I would get a Process object representing the "Idle" process. I would figure out what percentage of time the idle process has been running since my function last was called. Then the average CPU utilization would be 100 - average idle percentage. I figure out the average idle...
0
1089
by: Joe Maldonado | last post by:
Hello all, I am in the process of planning disk utilization for postgres and was wondering what was the storage size was for btree, rtree and hash indexes. Thanks, -Joe -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
7
4190
by: StupidScript | last post by:
>From the manual "Storage Requirements": "ENUM('value1','value2',...) =1 or 2 bytes, depending on the number of enumeration values (65,535 values maximum)" This seems to mean: "a" = 1 byte of storage "prestidigitation" = 1 byte of storage
4
2348
by: 2803stan | last post by:
Hi, I need to know if my regular relational database, now in DB2 v9.1 can be transformed to an XML database easily? The data can very easily be represented in XML, but can I convert a regular table into an XML table and retain Stored Procedures and Triggers. I know that the latter would have to be modified, but how much work is it, and is it even doable?
1
520
by: nbharatha | last post by:
Hi, Environment: Only one database per instance however each application is given it's own schema. My objective is to compute the space utilized by each application on the DB2 Database. Following is my approach and request you to suggest / advise for correctness.
0
2251
by: PRR | last post by:
with WMI class Win32_Process i can get most details of Processes running one Pc.. except CPU utilization... THe class for CPU utilization u need to use Win32_PerfFormattedData_PerfProc_Process However it doesnt work in Windows XP... i wanna know wat class to use to get CPU utilization in win xp... also Processid is to be compared to get CPU utilization for Process to get info from both classes?
0
1005
by: kwartz | last post by:
Can somebody please help me with specify storage parameters for a database schema. The schema is locally managed. The database should be setup to handle 1,000,000 studies. Each study is about 50mb? Please help need urgently and asap. Thanks
1
6630
by: Kaheru | last post by:
memory utilization increase? This is because when i try to keep track of the CPU utilization and memory utilization of my FTP server process (ftpserver.exe), the CPU utilization increase, but the memory utilization decrease. Why is this happening? PS: CPU Utilization is taken from Process\% Processor Time Memory Utilization is taken from Process\Working Set (I want to measure the physical memory it uses) Any help is appreciated....
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.