Adding a Temporary Tablespace to the Primary Database

Add a temporary tablespace to the primary database.

  1. Start the DB2 UDB command-line processor:
    %>bash
    %>source /db2home/db2inst1/sqllib/db2profile
    %>db2
  2. Connect to the primary DB2 UDB database:
    db2=>connect to pdb user db2_admin_user using db2_admin_password
    
    where db2_admin_user and db2_admin_password are the administrative user ID and password for the primary database.
  3. Create a buffer pool:
    db2=>create bufferpool pdb_buffer_name size 1000 pagesize same_pagesize_as_pdb
    where pdb_buffer_name is the buffer name, and same_pagesize_as_pdb is the page size at the primary database.
  4. Create a temporary tablespace:
    db2=>create user temporary tablespace pdb_temp_space_name 
    pagesize same_pagesize_as_pdb managed by automatic storage bufferpool 
    pdb_buffer_name
    where pdb_temp_space_name is the tablespace name, same_pagesize_as_pdb is the page size at the primary database, and pdb_buffer_name is the buffer name.
    Note: Determine the DB2 UDB page size using the LIST TABLESPACES SHOW DETAIL command.
    For example, to create a temporary tablespace named deep13 with a 16KB page size and buffer pool named tom_servo, enter:
    create user temporary tablespace deep13 pagesize 16K managed 
    by automatic storage bufferpool tom_servo