IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Space calculation for table creation.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinaya kumar

New User


Joined: 06 May 2009
Posts: 4
Location: Bangalore

PostPosted: Wed May 06, 2009 6:45 pm
Reply with quote

hi,

I am not much aware of how space is calculated during table space and table creation. I see below DDL format in our DB

CREATE TABLESPACE TSDEBPR IN CAPS002
NUMPARTS 7
(PART 1 USING STOGROUP CAPSG10
PRIQTY 21600
SECQTY 3600
ERASE NO
FREEPAGE 0
PCTFREE 10
TRACKMOD YES
COMPRESS NO
,PART 2 USING STOGROUP CAPSG10
PRIQTY 48
SECQTY 96
ERASE NO
FREEPAGE 0
PCTFREE 10
TRACKMOD YES
COMPRESS NO
and so on

now if I want to create a table space where table having a Lrecl of 120 and 7 000 000 records can be inserted and it should handle such amount of data. how should I calculate the value for primary and secondary quantity.

secondly when and where Partitioned TS should be defined, how to make the decision and how to set the space value for the same?

Please suggest.
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Wed May 06, 2009 10:29 pm
Reply with quote

Hi vinaya kumar

Quote:
now if I want to create a table space where table having a Lrecl of 120


What is Lrecl in table and how do you calculated this to 120?

Regards
Raghu
Back to top
View user's profile Send private message
vinaya kumar

New User


Joined: 06 May 2009
Posts: 4
Location: Bangalore

PostPosted: Thu May 07, 2009 11:31 am
Reply with quote

Raghu,

I calculate based on column length. My concern is how to calculate space now for creating TS for 7000000 record capacity.

Please suggest.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu May 07, 2009 1:44 pm
Reply with quote

Hi vinay,

Row Length = 120
Quantity = 7000000

I calculated for a segmented tablespace.
For partition tablespace, you must calculate for each partitions

Code:
PRIQTY  SECQTY  ERASE  FRPAGE  %FR  COMP  TRKMOD
1245216 124560  NO     3       10   NO    YES


Now, how did i do this ?
I have an in-house tool called SPACE CALCULATOR.

Get familiar with the tools used in your shop.

Thank You,
Sushanth
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu May 07, 2009 3:40 pm
Reply with quote

You need to compute how many rows will fit on each page. The "Administration Guide - Planning" has detailed information about how to do this. See the section "Space requirements for user table data" for detailed information.

A quick estimate for a 4k page size is: (1+freespace percentage)*num rows/(int(4028/(rowsize+10)))

Don't forget to plan for space for indexes.

Rows with varchar data in them will, as a general rule, take up less space than the maximum. This will (usually) allow more rows per page than the basic calculation indicates. Use the average length of the varchar column when computing row size.

At the other end of the scale, if the row size is very small, then you can hit the limit of maximum rows on a page.

There are also some other considerations that come into play when the row size is a large percentage of the page size. These relate the data manager's ability to find space for a new row to be inserted, getting in contact with your site-DBA might help further.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu May 07, 2009 3:47 pm
Reply with quote

sushanth bobby wrote:
Get familiar with the tools used in your shop.
Not necessarily every shop has such a tool (SPACE CALCULATOR) . . . icon_smile.gif and who knows what actually happens in the back-end . . .
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu May 07, 2009 4:32 pm
Reply with quote

Anuj,

Since this might be a usual scenario when a new tablespace is created. Every shop will be having their own strategy to deal with it.

Thank You,
Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top