Search

Saturday, September 29, 2012

DB2 Commands for Table Space

Access Commands


Steps to  go DB2 Commands panel:
       
    1. Go to DB2 DATA BASE INTERACTIVE FUNCTIONS MENU
    2. Go to DB2I PRIMARY OPTION
    3. Select MENU in the list (It is generally at position 1).

    4. Select DB2 COMMANDS from the list(It is at 7th position generally).
    These commands help while database goes in various statuses while loading/unloading etc

    Display Table space Status

    Type below command on DB2 Commands panel.
     
    -tso dsn s(DB2 System Name) : This will work only if rexx is setup for TSO. (This can be issued on normal mainframe ISPF screen.)

    -display database(Database Name) spacename(TableSpace Name) 

    OR

    -dis db(Database name) sp(Table Space name) 

    Display from Mainframes

    This is the result of the display command presented above. The status in the below example is “RW” -> READ WRITE. We can even see table parts of the table space in the below table space has 15 table parts.

    It shows:
    • Name of Tablespace
    • Type: Object of DB2
    • PART: Tablespace is divided into how many parts
    • Status: Status of the tablespace
    • DBD length


    DSNT360I  -D ***********************************                          

    DSNT361I  -D *  DISPLAY DATABASE SUMMARY                                            

                 *    GLOBAL                                                                                              

    DSNT360I  -D ***********************************                          

    DSNT362I  -D     DATABASE = Database Name  STATUS = RW                            

                    DBD LENGTH = 819704                                        

    DSNT397I  -D                                                               

    NAME     TYPE PART  STATUS            PHYERRLO PHYERRHI CATALOG  PIECE    

    -------- ---- ----- ----------------- -------- -------- -------- -----    

    Tablename    TS    0001 RW                                                    

        -THRU      0015                                                       

    ******* DISPLAY OF DATABASE Database Name    ENDED      **********************    

    DSN9022I  -D DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION                

    DSN

        Different Statuses of Table Space

        A detailed list of all possible statuses of table space is listed below. 
      1. RW => READ WRITE    
      2. RO => READ ONLY
      3. UT => Access allowed only for DB2 Utilities, (e.g. Table space Unload, Load, Reorg, Image copy, etc.)
      4. (No SQL statements, SELECT/INS/UPDATE/DEL allowed)
      5. STOP => STOPPED
      6. RECP => RECOVER PENDING  
      7. COPY => COPY PENDING
      8. UTRO = UTILITY READ PENDING
      9. UTUT = UTITLITY PENDING (need to terminate the utility using below command)
         


       

      No comments:

      Post a Comment