15.00 - PATCH - Teradata Database

Teradata Database Support Utilities

Teradata Database



The PATCH command does the following:

  • Modifies file system segments while the segment is in memory, whether the segment is a CI, a DB, the FIB, the MI, a row, or a WAL log segment or object. The modified segments can later be forced to disk with the WRITE command. The PATCH command can also be used with interior file system objects, such as a CID, SRD, DBD, WCID, and WDBD.
  • Automatically updates the checksum of the segment being modified when the modified segment is written.
  • Syntax  

    Note: The online help lists the patch options (/B, /C, /W, /S, /D, /L) as /patchopt. The syntax diagram only shows the options at the beginning of the command, but you can type the options at the beginning or end of the command.

    where the following tells how to address the segment being patched:


    Syntax Element


    /B or /C

    Input is one byte at a time. You can type input as a number (0x0 to 0xFF) or a character string delimited by apostrophes or double quotation marks (a character is a string of length 1).

    /W or /S

    Input is one numeric Half Word (Short Integer, two bytes) at a time (0x0 to 0xFFFF). This is the default.

    /D or /L

    Input is one numeric Word (Long Integer, four bytes) at a time (0x0 to 0xFFFFFFFF).


    the first location to be patched is specified as offset bytes from the beginning of the current selected object. In most cases, the current selected object is reflected by the prompt, but in some cases, this might not be true. For example, even though the prompt shows Row==>, the last selected object can be one row or a range of rows. With a range of rows, the offset is displaced from the beginning of the first row in the range.

    Usage Notes  

    The prompt changes to indicate that Filer has entered Patch Mode.

    The PATCH command syntax is the same, regardless of the current input prompt, except when you are in PATCH mode already, in which case offset is optional. If omitted, offset defaults to the current location.

    If you type an invalid command, an error message is displayed, and the command is ignored.

    When you type the PATCH command, it must be the only command on the command line because the command switches from general command syntax to a specific command syntax. Therefore, both the following command entries will generate an error:

    CI /P 200; PATCH /W 1567H
    PATCH /W 1567H;WRITE

    After you issue the PATCH command, the prompt changes to reflect the Patch mode and the object and address being patched. The current value of the cell open for patching is displayed in both HEX and DECIMAL. Prompting continues until the DONE or CANCEL command is issued, at which time the prompt is restored to what it was before patching started. The following table describes what happens when exiting Patch Mode.


    IF you exit Patch Mode using …

    THEN …


    changes are saved to the segment and other tasks will see the changes immediately.


    changes are not saved and the segment will be left exactly the same as when you entered Patch Mode.

    Because the checksum is stored externally, patching a single file system segment causes an additional segment to be updated with the new checksum of the segment if checksums are enabled on the block.

    The commands allowed while patching are listed in the following table.





    Replace the contents of the current cell with the input.

    The general syntax for a patchstuff is as follows:

    element, element, . . .






    Syntax Element





    For a description, see “Numeric Input” on page 75.




    A list of characters delimited by apostrophes or double quotation marks (only valid in /B or /C mode). A closing delimiter is required. Two consecutive delimiter characters translates to a single character of the same type.




    Skips the contents of the current cell and moves to the next cell.







    Note: You can use a number, a string, or a combination of a number and a string.

    Do not change the value of this cell and move back the specified number of cells. The default for number is 1.

    Exit from Patch Mode and do not save the changes. Leave the segment exactly as it looked when Patch Mode was entered.

    Exit from Patch Mode and save the changes to the segment. Now the segment is patched, and modifications are visible to the outside world. Specifying the /NOCHECKSUM option means that if checksums are enabled on the segment being modified or written, the checksum is not updated and written to the external segment that contains the checksum.

    Change the options. The offset is counted from the start of the current selected entity. If omitted, the current location is not changed.

    You can type the options at the beginning or end of the command. The syntax diagram only shows the options at the beginning.

    Take the patchstuff and repeat it the designated number of times or until the end of segment if you specify ALL or *.

    Press Enter to move to the next cell without changing anything.

    Any global command except QUIT command

    All global commands behave exactly as they do in Command Mode. For additional information, see “Filer Command Types” on page 91.


    DB ==> patch /b 0 
    Now entering PatchMode  
    Patch: DB :  0000 : 0000 (    0)  ==> 2 
    Patch: DB :  0001 : 0008 (    8)  ==> 4 
    Patch: DB :  0002 : 0006 (    6)  ==> sk 
    Patch: DB :  0003 : 00f0 (  240)  ==> done 
    Exiting Patch Mode 
    DB ==>>