Archiving a table partition

You can reduce Db2 storage space by archiving table partitions to IBM® Db2 Analytics Accelerator for z/OS® (IDAA).

Before you begin

To archive a table, the table must meet the criteria that is listed in Freeing up storage in Db2 for z/OS (IBM DB2 Analytics Accelerator for z/OS 7.5).

About this task

When you archive a table partition to IDAA, Db2 stores active data only and archive data is moved to the accelerator, thus reducing Db2 storage space. Archiving a table partition is valid only when you are using Db2 10 or later.

You can select partitions to archive from a selected table on the following panels: ADB21T, ADB21S, ADB21SP, and ADBPZAT. The following procedure uses the ADB21T panel.

Procedure

To archive a table partition:

  1. On the DB2 Administration Menu (ADB2) panel, specify option 1, and press Enter.
  2. On the System Catalog (ADB21) panel, specify option T, and press Enter.
  3. On the Tables, Views, and Aliases (ADB21T) panel, specify the AR line command next to the table to be archived, and press Enter.
    The Archive Partitions (ADBP1ARC) panel lists the partitions for the specified table:
    Figure 1. Archive Partitions (ADBP1ARC) panel
    ADBP1ARC  ------------------- DD1A Archive Partitions ------ Row 1 to 10 of 10 
                                                                                   
    Commands: ALL   RESET   ARCHIVE                                                
                                                                                   
    Table schema . : SYSADM                                                        
    Table name . . : TB1                                                        
                                                                                   
    Line commands:  S - Select part  D - Deselect part                             
                                                                                   
    Input partition range . . .                      (See help for details)        
                                                                                   
    Sel Part   A Archive Limit Key Value                                           
    --- ------ - ------- --------------------------------------------------------->
             1                                    '100000'                         
    s        2                                    '199999'                         
             3                                    '299999'                         
    s        4                                    '399999'                         
             5                                    '499999'                         
             6                                    '599999'                         
             7                                    '699999'                         
             8                                    '799999'                         
             9                                    '899999'                         
            10                                    '999999'                         
    ******************************* END OF DB2 DATA *******************************
  4. Specify the partitions that you want to archive by taking one or more of the following actions:
    • Use the S line command to select individual partitions.
    • Use the D line command to deselect a partition.
    • Specify ALL to select all partitions.
    • Specify RESET to clear all selections.
    • Specify a partition range in the Input partition range field. Input the partitions to archive by using the same syntax as the SYSPROC.ACCEL_ARCHIVE_TABLES stored procedure. Use a colon (:) to specify a range. Use a negative number to specify partitions that start from the last partition. For example, -2 specifies the second-to-last partition. The following examples show valid partition range values:
      1, 2
      Specifies partitions 1 and 2.
      1, 2:3
      Specifies partitions 1, 2, and 3.
      1:2,3
      Specifies partitions 1, 2, and 3.
      -2
      Selects the second to last partition.
      -2:-1
      Selects the second to last partition and the last partition.
      -3,-1
      Selects the third to last partition and the last partition.

    After you press Enter, the tables that are marked for archiving display Y in the Archive column.

    Important: You can archive table partitions in batch to reduce wait time. You can run batch by specifying YES for Run Accelerator functions in batch on the DB2 Admin Defaults (ADB2P2) panel.
  5. After all of the partitions have been specified, issue the ARCHIVE primary command, and press Enter.

    Db2 Admin Tool calls the stored procedure that archives the partitions to the accelerated table database.