Summary of DB2 Common commands

Source: Internet
Author: User
Tags db2 create database
DB2 Common commands: DB2 get dbm CFG # Displays the current value of the Database Manager configuration parameter Db2ilist #查看系统中存在的实例 DB2 get instance #明确当前运行中的实例 db2cmd db2licm-l #查看版本信息 DB2 DB2 LIS T db directory

To delete a database:

DB2 Force applications All
Drop DB Database

To import a database command set:

DB2 => CREATE Databasedb_nameOn' C: 'Using CodeSet UTF-8 Territory CN
DB2 => Connect todb_nameUserDb2adminUsing123321
DB2 => Commit Work
DB2 => Connect Reset
DB2 => Terminate
CD Y:\backup\
Db2movedb_nameImport-uDb2admin-P123321 DB2 Practical SQL statement: SELECT * FROMAll_tablesFetch i rows only SELECT tabname fromSyscat.columnsWHERE colname like '% field name% ' SELECT colname fromSyscat.columnsWHERE tabname = ' data table name ' SELECTTabname,count (tabname)From Syscat.columnsGROUP byTabName SELECT * from database name. The pattern name. Data table name WHERE field name not in(SELECT field name from database name. Schema name. data table name FETCH 5 of ROWS only) FETCH I ROWS only SELECTDISTINCTColumn name from table name #返回唯一不同的值 SELECT persons.lastname, Persons.firstname, Orders.orderno from PersonsLeft JOINOrders on Persons.id_p=orders.id_p The order of Persons.lastname SELECT table_name fromAll_tablesWHEREnum_rows> 0 #筛选掉空表 SELECT Field 1, SUM (field 2) from table name GROUP by field 1

[1] sum with GROUP by

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.