Db2look command to extract database object information

Source: Internet
Author: User

Extract the DDL statement for the replicated database:
db2look-d bcdljs-e-O db2look.sql-a

-A: Export DDL for all users
-O: Directed results to file
-D: Database name
-E: Extracting the DDL files required to replicate the database


SELECT Tbspace, bufferpoolid from SYSCAT. Tablespaces

C:\Documents and Settings\db2admin. ZTE637-52CFHNX1>DB2LOOK-E-TW%cmcs3_out%-D
Bcdl-i cmbbcd-w Cmbbcd-o D:/outtabledll.sql

Syntax: db2look-d DBname [-e] [-xs] [-xdir Path] [-u Creator] [-Z Schema]
[-t Tname1 Tname2 ... Tnamen] [-TW tname] [-h]
[-O Fname] [-A] [-M] [-c] [-R] [-l] [-X] [-xd] [-F]
[-FD] [-td x] [-noview] [-I UserID] [-W Password]
[-V Vname1 Vname2 ... Vnamen] [-DP] [-CT]
[-wrapper Wrappername] [-server ServerName] [-nofed]
[-WLM] [-ap]

[-wrapper Wrappername] [-server ServerName] [-fedonly]
[-nofed]

Db2look [-h]

-D: Database name: This must specify

-E: Extracting the DDL files required to replicate the database
-XS: Exporting XSR objects and generating scripts that contain DDL statements
-xdir: Pathname: The directory that will be used to place the XSR object
-U: Create program ID: if both-u and-A are not specified, the $USER will be used
-Z: Mode name: If both-Z and-A are specified, the-Z is ignored
-T: Generate statistics for the specified table
-TW: Generate DDL for tables that match the schema condition (wildcard character) of the name with the table name (wildcard uses% instead of *)
-ap: Generating a AUDIT USING statement
-WLM: Generating WLM-specific DDL statements
-H: More detailed help message
-o: Redirect output to the given file name
-A: Generate statistics for all creation programs
-M: Running the Db2look utility in analog mode
-C: Do not generate a mock COMMIT statement
-r: Do not generate a simulated RUNSTATS statement
-L: Generate Database layout: Database partition group, buffer pool, and table space.
-X: The "Authorization" statement of the original definition program that generated the Exclude object DDL
-XD: Generate an "authorization" statement DDL that includes the original definition program of the object
-F: Extracting configuration parameters and environment variables
-TD: Specifies x as the statement delimiter (the default delimiter is a semicolon (;))
-I: User ID used when logging on to the server where the database resides
-W: the password used to log on to the server where the database resides
-noview: Do not generate create VIEW DDL statement
-wrapper: Generating DDL for federated objects that apply to this wrapper
-server: Generating DDL for federated objects that apply to this server
-fedonly:only created Federated DDL statements
-nofed: Do not generate federated DDL
-FD: Generate db2fopt for Opt_buffpage and Opt_sortheap and other configuration and environment parameters
Statement.
-V: DDL is generated for the view only, this option is ignored when-T is specified
-DP: Generate a DROP statement before the CREATE statement
-CT: Generating DDL Statements by object creation time

Db2look command to extract database object information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.