Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2005
    Posts
    19

    Unanswered: Calculate/Increase tablespace

    Hi,

    Iam looking at
    * How to calculate the tablespace size? (Before creation of tablespace, assuming the database may hold around 100TB of data).
    * How to increase the tablespace size (after creation)? (A customer requests that he is inserting 5,00,000 rows of data through import).

    Any easy calculation, dirty tricks to implement the same.
    The OS and database version is given below.

    OS - LINUX Red Hat Enterprise Linux AS 4 (32-bit)
    DB - DB2 V8 DB2 8.1 FP12

    Please let me know how to go about. (Any links, documents etc, that you would like to share with me)?

    thanks
    Mane

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    To automatically increase the size of a tablespace you may use:

    Alter tablespace your_tablespace Autoresize Yes Increasesize 1 M

  3. #3
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    Also take a look at the RESIZE clause of the ALTER TABLESPACE staement:
    http://publib.boulder.ibm.com/infoce...n/r0000890.htm

  4. #4
    Join Date
    Jul 2005
    Posts
    19
    Thanks aflorin for your input and link.
    Iam looking at how to arrive at the size, means
    to increase the tablespace size by certain % or number.
    Eg: I want to add 4,00,000 rows and how much space should i increase in my tablespace?
    The information and the link you provided lists the resize/alter tablespace command to increase, but does not show me how to calcuate.

    Can you do let me know the same?
    Thanks for your time.

  5. #5
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    number_of_rows * row_length

    to compute the row_length, take a look a the Length column of the syscat.columns catalog view.

    But I am quite sure that the Autoresize clause is a better idea - you don't have to compute the increase size or percent; let DB2 fulfill this job.

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by aflorin27
    number_of_rows * row_length
    Note that this does not account for index sizes and LOB storage. The DB2 Administration guide has detailed formulae for the table and index size estimates.
    ---
    "It does not work" is not a valid problem statement.

  7. #7
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    not sure if the auto resize was available before v9 on luw.
    in db2cc go to > table> estimate size .... to get a better idea
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •