15.00 - SCANDISK - 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

SCANDISK

Purpose  

The SCANDISK command validates the file system and reports any errors found, including discrepancies in the following:

  • Key file system data structures, such as master index, cylinder index, and data blocks, including those associated with the WAL log.
  • The RowIDs, including the partition numbers, for key physical rows should match the values stored for those rows in the cylinder index and master index.
  • Note: “Physical row” means the low-level row structure that is managed by the file system. A physical row may store a table row or the data from one or more column partitions.

  • Within a subtable, the internal partition number of a physical row being greater than or equal to the internal partition number in the preceding row, if any.
  • Within a partition, physical rows occur in row hash order.
  • Within a subtable, all physical rows are either partitioned or nonpartitioned. (All physical rows within a subtable have a partition value in their RowIDs, or all rows do not.)
  • In addition, SCANDISK calculates, modifies, and verifies a file system checksum for tables with checksumming defined, and reports any discrepancies.

    Note: The internal partition number is not validated for consistency with the result of the partitioning expression applied to the partitioning columns in a logical row, or for consistency with currently defined column partition numbers.

    Syntax  

     

    Syntax Element

    Description

     

    /Y

    Prevents Ferret from displaying a confirmation message.

    /S

    Scans the MI and WMI.

    /M

    Scans the MI, CIs, WMI, and WCIs.

    /L

    Scans the MI, CIs, DBs, WMI, WCIs, and WDBs.

    CI

    Scans the MI and CIs. If the scope is AMP or all subtables, rather than selected subtables, the free CIs are also scanned.

    DB

    Scans the MI, CIs, and DBs. This is the default for the normal file system, which can be overridden by the CI, MI, or FREECIS options. If the scope is AMP or all subtables, rather than selected subtables, the free CIs are also scanned.

    FREECIS

    Scans the free CIs only. This option also detects missing WAL and Depot cylinders.

    MI

    Scans the MI only.

    WCI

    Scans the WMI and WCIs.

    WDB

    Scans the WMI, WCIs, and WDBs. This is the default for the WAL log, which can be overridden by the WCI or WMI options.

    WMI

    Scans the WMI only.

    WITHSPOOL

    Causes scandisk to check all spool data in addition to checking non-spool data.

    If WITHSPOOL is not specified, only the first few spool cylinders are checked. If the scope of the command is limited to the MI, the entire MI is always scanned including non-spool and spool data.

    inquire_opt

    Displays the lowest tid and rowid being scanned among the AMPS involved. This option also reports SCANDISK progress as a percentage of total time to completion and displays the number of errors encountered so far.

    The online help refers to tid as tableid. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 541.

    The syntax for the INQUIRE option is as follows:

     

     

     

     

    Syntax Element

    Description

     

     

     

    NONE

    Specifies that only one INQUIRE request is sent for the SCANDISK job.

     

     

     

    number

    An integer which defines the time interval to send an INQUIRE request to display SCANDISK progress.

    If you do not specify timeopt, then number defaults to SECONDS.

     

     

     

    timeopt

    Specifies the time unit which number represents. The default is SECONDS. It should be one of the following:

  • SECONDS, SECOND, SECON, SECO, SECS, SEC, S
  • MINUTES, MINUTE, MINUT, MINU, MINS, MIN, M
  • HOURS, HOUR, HOU, HO, HRS, HR, H
  • DAYS, DAY, DA, D
  •  

     

     

     

     

     

     

     

     

     

    For example, scandisk inquire 5 m will start a SCANDISK job which reports SCANDISK progress every five minutes.

    Note: The maximum time interval allowed is seven days.

    NOCR

    Specifies to use regular data block preloads instead of cylinder reads. This is the default.

    CR

    Specifies to use cylinder reads instead of regular data block preloads.

    MAXERRCNT n

    MAXERR n

    Specifies the maximum number of errors SCANDISK should show per subtable per vproc. SCANDISK stops when it finds the specified number of errors. Use this setting to reduce the SCANDISK running time when there are an excessive number of errors reported.

    The Ferret INQUIRE (or INQ) and ABORT commands can be used to check on the progress or halt this operation during command execution.

    Usage Notes

    You can run SCANDISK while the system is online and the Teradata Database is available for normal operations.

    Teradata recommends you run SCANDISK in the following situations:

  • To validate data integrity before or after a system upgrade or expansion.
  • If you suspect data corruption.
  • As a routine data integrity check (perhaps weekly).
  • Note: A slight performance impact might occur while SCANDISK is running.

    You can rearrange the order of the syntax following the SCANDISK command. For example, the command SCANDISK NOCR MI is the same as the command SCANDISK MI NOCR.

    If you do not type any options, SCANDISK defaults to DB and all subtables on the vproc. The default scope is to scan both the normal file system and the WAL log, each from the lowest (DB, WDB) level through the highest (MI, WMI). The free CIs are also scanned.

    The SCANDISK command can be limited by the SCOPE command to scan, for example, just one table, just the WAL log, or just certain AMPs. For more information, see “SCOPE” on page 591.

    By default, SCANDISK uses regular data block preloads instead of cylinder reads. The CR option allows you to run SCANDISK using cylinder reads to preload data into cylinder slots which may improve SCANDISK performance. However, if other work also requires the use of cylinder slots, the competition for slots could slow down SCANDISK and the other work. In addition, the performance gain is dependent on the amount of data loaded, the distribution of the data, and the average block I/O size.

    The NOCR option lets you turn off cylinder slot usage by SCANDISK, which could result in slower SCANDISK performance, but which will allow other work requiring cylinder slots to progress unimpeded.

    SCANDISK reports only what it finds when scanning is completed.

    The output from SCANDISK may include table row identifiers (RowIDs).

    A RowID consists of a 16-byte value, that includes the following information:

  • The first 8-bytes is the internal partition number of the row.
    For a nonpartitioned table, the internal partition number is zero, and the internal partition number is not actually stored in the row itself.
  • The next 8-bytes include a hash bucket value and uniqueness value for the row.
  • For more information on internal table row formats, see Database Design.

    SCANDISK start, finish, abort, and system reset times are logged to the Linux
    /var/log/messages file and also to the DBS.SW_Event_Log table.

    Example  

    The following is an example of output that SCANDISK generates.

    Ferret ==> 
    scandisk 
    Tue Feb 28, 1995 15:16:50 :Scandisk has been started on all AMP Vprocs in the SCOPE.
    Vproc 0 response
    DB @ Cylinder 0 2 (0000 0002) Sector 16 (0010) length 1 (0001)
    DB ref count doesn’t match DBD row Count
     
    Tue Feb 28, 1995 15:16:50 : The scandisk found problems
    Vproc 1 response
    Tue Feb 28, 1995 15:16:50 : The scandisk found nothing wrong

    Example  

    The following is an example of output that SCANDISK generates when it finds an LSI interrupted write pattern in a CI.

    Ferret ==> 
    scandisk ci
    Mon May 06, 2002  15:12:20 :Scandisk has been started on all AMP Vprocs in the SCOPE.
    vproc  0 (0000)  response
    Mon May 06, 2002  15:55:21 : CI @ Cylinder 0 7 (0000 000007)
    Mon May 06, 2002  15:55:21 : LSI interrupted write pattern found in CI.
    0120 MAY 05  05:02:35 LUN 1111, Start Block 00004545, Blocks 0400
     
    SRD
    num     table id        firstdbd  dbdcount offset
           u0    u1   tai
    ---- ----- ----- -----  --------  -------- ------
    0001 0000  0494  0800     FFFF      0014   001E
    Mon May 06, 2002  15:55:21 : Invalid DBD sector length of 14901 (3A35) found
    Mon May 06, 2002  15:55:21 : Invalid DBD sector length of 26912 (6920) found
    Mon May 06, 2002  15:55:21 : Invalid DBD sector length of 25972 (6574) found
    Mon May 06, 2002  15:55:21 : Invalid DBD sector length of 12336 (3030) found
    Mon May 06, 2002  15:55:21 : First rowid out of order dbds 18 (0012) and 19 (0013)

    Example  

    The following is an example of output that SCANDISK generates when it finds an LSI interrupted write pattern in a DB.

    Ferret ==> 
    scandisk db
    Tue Feb 28, 1995 15:16:50 :Scandisk has been started on all AMP Vprocs in the SCOPE.
    vproc  0 (0000)  response
    Mon May 06, 2002  15:12:20
    1 of 1 vprocs responded with no messages or errors.
    Type 'ABORT' to stop the command before completion
    Type 'INQUIRE' to check on progress of command
    Reading
    vproc  0 (0000)  response
    Mon May 06, 2002  15:11:11 : CI @ Cylinder 0 7 (0000 000007)
    Mon May 06, 2002  15:11:11 : LSI interrupted write pattern found in DB.
    0120 MAY 05  05:02:35 LUN 1111, Start Block 00004545, Blocks 0400
    Mon May 06, 2002  15:11:11 : rows  -1 (FFFFFFFF) and 0 (0000) are out of order

    Example  

    The following example limits the scan to just the WAL log.

    scope wal
    scandisk

    Example  

    The following example scans one user data subtable.

    scope table 'employee.emp' p
    scandisk 

    Example  

    In the following example, an INQUIRE command is sent per minute. Therefore, you get a display of SCANDISK progress every minute.

    Ferret ==>
    > scandisk inq 1 m
     
    > Mon Jul 17, 2012 05:02:45 
    SCANDISK STATUS : 
    Slowest vproc 2 is 44% done
    Fastest vproc 3 is 64% done
    The scandisk is about 55% done

    Aborting SCANDISK

    Since SCANDISK DB verifies that every byte in the file system is accounted for, this process can be very time consuming. Therefore, you have the option of stopping the process by typing the following command:

    ABORT can take up to 30 seconds to process.

    After it is initiated, ABORT stops the SCANDISK process and reports the current status.

    When the abort is successful, the following appears:

    Are you sure you want to scandisk?  (Y/N)  y
    Tue Feb 28, 1995 15:16:50 : Scandisk has been started on all AMP Vprocs in the SCOPE.
    Type ‘ABORT‘ to stop them before completion
    Type ‘INQUIRE‘ to check on progress of command
    ABORT
    Abort request has been sent
    Vproc 0 response
    DB @ Cylinder 0 2 (0000 0002) Sector 16 (0010) length 1 (0001)
    DB ref count doesn’t match DBD row Count
    Tue Feb 28, 1995 15:16:50 : The scandisk found problems
    Vproc 1 response
    Tue Feb 18, 1995 15:16:50 : The scandisk found nothing wrong
    Ferret ==>

    Checking SCANDISK Status

    Because SCANDISK can take a long time to run, you might want to do a status check. You can do this using the INQUIRE command:

    INQUIRE displays the lowest tid and rowid being scanned among the AMPS involved, and reports SCANDISK progress as a percentage of total time to completion. It also displays a list of errors that occurred since the last INQUIRE command. Sample INQUIRE output is shown below.

    Ferret  ==>
    scandisk
     
    Wed Apr 11, 2007  16:46:24 : Scandisk will be started
                               On All AMP vprocs 
        Do you wish to continue based upon this scope?? (Y/N)
    y
     
    Wed Apr 11, 2007  16:46:26 : Scandisk has been started
    Type 'ABORT' to stop the command before completion
    Type 'INQUIRE' to check on progress of command
    inq
     
    Inquire request has been sent
     
    Wed Apr 11, 2007  16:46:30
    SCANDISK STATUS : 
    Slowest vproc      0  is   2% done
    Fastest vproc      0  is   2% done
    The scandisk is about    2% done
     
    Scanning Table: 0 1434 1024
     
    Scanning Row: 0 1972 32488 0 1 
     
    Nobody has reached the SCANFREE stage
     
     
     
    Wed Apr 11, 2007  16:46:30
    2 of 2 vprocs responded with no messages or errors.
    Type 'ABORT' to stop the command before completion
    Type 'INQUIRE' to check on progress of command
    inq
     
    Inquire request has been sent
     
    Wed Apr 11, 2007  16:46:36
    SCANDISK STATUS : 
    Slowest vproc      1  is   4% done
    Fastest vproc      0  is   5% done
    The scandisk is about    4% done
     
    Scanning Table: 0 1434 1024
     
    Scanning Row: 0 28847 58771 0 95 
     
    Nobody has reached the SCANFREE stage
     
     
    vproc  1 (0001)  response
     
     
    Wed Apr 11, 2007  16:46:33 : CI @ Cylinder 0 100 (0000 000064)
    Wed Apr 11, 2007  16:46:33 : CID's First TID doesn't Match CI's First TID
        0  1434  1024 (0000 059A 0400)  ( test.trans )
        0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    /nWed Apr 11, 2007  16:46:33 : CID's Last TID doesn't Match CI's Last TID
        0  1434  1024 (0000 059A 0400)  ( test.trans )
        0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
     
    Wed Apr 11, 2007  16:46:33 : Table Header is missing. May be in the process of being dropped
        0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3418 (0D5A) length 126 (007E)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3629 (0E2D) length 70 (0046)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3699 (0E73) length 70 (0046)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 48 (0030) length 65 (0041)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 432 (01B0) length 65 (0041)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 113 (0071) length 66 (0042)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 179 (00B3) length 66 (0042)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2646 (0A56) length 122 (007A)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1953 (07A1) length 66 (0042)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2346 (092A) length 66 (0042)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2932 (0B74) length 72 (0048)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3004 (0BBC) length 72 (0048)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 684 (02AC) length 72 (0048)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 756 (02F4) length 72 (0048)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1191 (04A7) length 109 (006D)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1606 (0646) length 74 (004A)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2768 (0AD0) length 74 (004A)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3150 (0C4E) length 119 (0077)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1056 (0420) length 69 (0045)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
    Wed Apr 11, 2007  16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3544 (0DD8) length 69 (0045)
                               : TID :     0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
    Wed Apr 11, 2007  16:46:34 : SRD TID.uniq doesn't match DB tid.uniq
        0  1435 (0000 059B)
        0  1434 (0000 059A)
     
     
    Wed Apr 11, 2007  16:46:34 : CI @ Cylinder 0 266 (0000 00010A)
    Wed Apr 11, 2007  16:46:34 : Table Ids are out of order 
        0  1435  1024 (0000 059B 0400)  ( TEST.data1 )
        0  1434  1024 (0000 059A 0400)  ( test.trans )
     
     
     
     
     
     
     
    Wed Apr 11, 2007  16:46:36
    1 of 2 vprocs responded with no messages or errors.
    Wed Apr 11, 2007  16:46:36
    1 of 2 vprocs responded with messages or errors as specified above
    Type 'ABORT' to stop the command before completion
    Type 'INQUIRE' to check on progress of command