DB2: Redimensionar Tablespace

Com o primeiro comando abaixo, eu altero todos os containers da tablespace TESTE para 256 MB cada.
Com o segundo, defino que os containers devem se autoincrementar em 10 MB de cada vez, até um tamanho máximo de 1024 MB.

db2 => ALTER TABLESPACE TESTE RESIZE (ALL 256 M)
DB20000I  The SQL command completed successfully.
db2 => ALTER TABLESPACE TESTE AUTORESIZE YES INCREASESIZE 10 M MAXSIZE 1024 M
DB20000I  The SQL command completed successfully.
db2 =>

E agora confiro que a tablespace tem 130944 páginas livres (de 8k cada) de um total de 131072.

db2 => LIST TABLESPACES SHOW DETAIL

           Tablespaces for Current Database

 Tablespace ID                        = 0
 Name                                 = SYSCATSPACE
 Type                                 = Database managed space
 Contents                             = All permanent data. Regular table space.
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 16384
 Useable pages                        = 16380
 Used pages                           = 12808
 Free pages                           = 3572
 High water mark (pages)              = 12808
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 4
 Prefetch size (pages)                = 4
 Number of containers                 = 1

 Tablespace ID                        = 1
 Name                                 = TEMPSPACE1
 Type                                 = System managed space
 Contents                             = System Temporary data
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 1
 Useable pages                        = 1
 Used pages                           = 1
 Free pages                           = Not applicable
 High water mark (pages)              = Not applicable
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 32
 Prefetch size (pages)                = 32
 Number of containers                 = 1

 Tablespace ID                        = 2
 Name                                 = USERSPACE1
 Type                                 = Database managed space
 Contents                             = All permanent data. Large table space.
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 4096
 Useable pages                        = 4064
 Used pages                           = 1824
 Free pages                           = 2240
 High water mark (pages)              = 1824
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 32
 Prefetch size (pages)                = 32
 Number of containers                 = 1

 Tablespace ID                        = 3
 Name                                 = IBMDB2SAMPLEREL
 Type                                 = Database managed space
 Contents                             = All permanent data. Large table space.
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 1933312
 Useable pages                        = 1933280
 Used pages                           = 1929888
 Free pages                           = 3392
 High water mark (pages)              = 1929888
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 32
 Prefetch size (pages)                = 32
 Number of containers                 = 1

 Tablespace ID                        = 4
 Name                                 = IBMDB2SAMPLEXML
 Type                                 = Database managed space
 Contents                             = All permanent data. Large table space.
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 4096
 Useable pages                        = 4064
 Used pages                           = 1440
 Free pages                           = 2624
 High water mark (pages)              = 1440
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 32
 Prefetch size (pages)                = 32
 Number of containers                 = 1

 Tablespace ID                        = 5
 Name                                 = SYSTOOLSPACE
 Type                                 = Database managed space
 Contents                             = All permanent data. Large table space.
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 4096
 Useable pages                        = 4092
 Used pages                           = 112
 Free pages                           = 3980
 High water mark (pages)              = 112
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 4
 Prefetch size (pages)                = 4
 Number of containers                 = 1

 Tablespace ID                        = 6
 Name                                 = TESTE
 Type                                 = Database managed space
 Contents                             = All permanent data. Large table space.
 State                                = 0x0000
   Detailed explanation:
     Normal
 Total pages                          = 131072
 Useable pages                        = 130944
 Used pages                           = 96
 Free pages                           = 130848
 High water mark (pages)              = 96
 Page size (bytes)                    = 8192
 Extent size (pages)                  = 32
 Prefetch size (pages)                = 128
 Number of containers                 = 4

db2 =>

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

This site uses Akismet to reduce spam. Learn how your comment data is processed.