15.00 - ROWKEY - Teradata Database

Teradata Database Utilities

Product
Teradata Database
Release Number
15.00
Content Type
Configuration
Publication ID
B035-1102-015K
Language
English (United States)
Last Update
2018-09-25

ROWKEY

Purpose  

The ROWKEY command identifies a rowhash-level lock request.

Syntax  

 

Syntax element...

Specifies...

DBname.Tablename

the name of a database and the name of a table separated by a required period (.).

TypeAndIndex

a subtable identifier.

A table is composed logically of one or more subtables. TypeAndIndex specifies one of these subtables. For example:

  • 0 is the table header.
  • hex 400 (decimal 1024) is a primary subtable.
  • hex values 404, 408, and 40C (decimal values 1028, 1032, and 1036), and other +4 incremental values, are secondary index subtables.
  • hex values 800, C00, and 1000 (decimal values 2048, 3072, and 4096), and other multiples of hex 400 (decimal 1024) are fallback subtables.
  • Partition

    a partition identifier. This must be zero.

    RowHash1

    a Teradata Database system-assigned rowhash value used to acquire a rowhash lock.

    Normally, this value is specified in decimal notation.

    RowHash2

    a Teradata Database system-assigned rowhash value used to acquire a rowhash lock.

    Normally, this value is specified in decimal notation.

    ALL

    that all tables that have a rowhash-level lock applied are considered.

    ALL is the default if you do not specify an object name.

    Usage Notes

    The following table shows the components of ROWKEY command output.

     

    Component...

    Specifies...

    Tran

    currently running transactions with locks being applied.

    Host

    the logical host ID (origin of the transaction).

    Session

    the session number for the transaction.

    Mode

    the type of lock mode:

  • Access
  • Read
  • Write
  • Exclusive
  • User

    the logon-ID for whom the lock is being requested.

    Database

    the name of the database being locked.

    Table

    the name of the locked table.

    Row Hash

    the locked row hash.

    Note: The rowhash lock information is provided also.

    Example  

    The following example shows locks on AMPs 0 and 2 on Database RECBDQTAC and Table T1.

    rowkey

    - The following amps are available:

    0     1     2     3 

    -> Which amp(s) do you want to request on (S=Sampling/A=all/C=cancel/Q=quit):
    > a
    a


    ---------------- AMP 0 REPORTS 1 LOCK ENTRIES -------------


                       GRANTED LOCK REQUEST(S):

    Tran: 16383 00000114
    Host:  2049 Session:     0, 1000 Mode: WR   User: DBC
    Database: RECBDQTAC                       Table: T1 
    Row Hash Lock                       Subtable ID:  1536
    Row Hash1: 62321,15470


    ---------------- AMP 2 REPORTS 2 LOCK ENTRIES -------------


                       GRANTED LOCK REQUEST(S):

    Tran: 16383 00000114
    Host:  2049 Session:     0, 1000 Mode: WR   User: DBC
    Database: RECBDQTAC                       Table: T1 
    Row Hash Lock                       Subtable ID:  1024
    Row Hash1: 31158,40503

    Host:  2049 Session:     0, 1000 Mode: WR   User: DBC
    Database: RECBDQTAC                       Table: T1
    Row Hash Lock                       Subtable ID:  1536
    Row Hash1: 59106,30941

    Example

    The following example shows two locks on AMP 0 on the primary data subtable (TypeAndIndex value of 400) of database TEMP and Table T1.

    rowkey TEMP.t1 400, 0 0 1
     
    - The following amps are available: 
     
        0     1     2     3 
     
    -> Which amp(s) do you want to request on (S=Sampling/A=all/C=cancel/Q=quit):
     
    0
    > 0
     
     
    ---------------- AMP 0 REPORTS 2 LOCK ENTRIES -------------
     
     
                       GRANTED LOCK REQUEST(S): 
     
    Tran: 16383 00000000
    Hash Locks:     1
     
    Host:     0 Session:     0,    0 Mode: WR   User: TEMP
    Database: TEMP  Table: T1 
    Row Hash Lock                       Subtable ID:  1024
     Row Hash1:     0,    1 
     
     
     
                      BLOCKED LOCK REQUEST(S): 
     
    Tran: 20479 00000000
    Host:     0 Session:     0,    0 Mode: WR   User: TEMP
    Database: TEMP  Table: T1 
    Row Hash Lock                       Subtable ID:  1024
     Row Hash1:     0,    1#