In DB2 Display a table's definition

后端 未结 11 1292
长情又很酷
长情又很酷 2021-02-04 03:35

Hello everybody I am learning DB2 and would like to know how to see a table\'s characteristics after I create one.

Similar to the EXPLAIN TABLE command in MySQL.

<
11条回答
  •  我寻月下人不归
    2021-02-04 03:47

    db2look -d -e -z -t -i -w > .sql

    For more information, please refer below:

        db2look [-h]
    
        -d: Database Name: This must be specified
    
        -e: Extract DDL file needed to duplicate database
       -xs: Export XSR objects and generate a script containing DDL statements
     -xdir: Path name: the directory in which XSR objects will be placed
        -u: Creator ID: If -u and -a are both not specified then $USER will be used
        -z: Schema name: If -z and -a are both specified then -z will be ignored
        -t: Generate statistics for the specified tables
       -tw: Generate DDLs for tables whose names match the pattern criteria (wildcard characters) of the table name
       -ap: Generate AUDIT USING Statements
      -wlm: Generate WLM specific DDL Statements
      -mod: Generate DDL statements for Module
      -cor: Generate DDL with CREATE OR REPLACE clause
     -wrap: Generates obfuscated versions of DDL statements
        -h: More detailed help message
        -o: Redirects the output to the given file name
        -a: Generate statistics for all creators
        -m: Run the db2look utility in mimic mode
            -c: Do not generate COMMIT statements for mimic
            -r: Do not generate RUNSTATS statements for mimic
        -l: Generate Database Layout: Database partition groups, Bufferpools and Tablespaces
        -x: Generate Authorization statements DDL excluding the original definer of the object
       -xd: Generate Authorization statements DDL including the original definer of the object
        -f: Extract configuration parameters and environment variables
       -td: Specifies x to be statement delimiter (default is semicolon(;))
        -i: User ID to log on to the server where the database resides
        -w: Password to log on to the server where the database resides
    

提交回复
热议问题