What commands does DB2 database provide in linux?

Source: Internet
Author: User
Tags db2 connect db2 connect to

The following articles mainly describe the commands of the DB2 database in the linux operating system, if you are interested in the commands of the DB2 database in the linux operating system, you can click the following article to view the instructions. The following is a detailed introduction of the article. I hope you can learn from it.

DB2 database commands

1. Start the database

DB2start

2. Stop the database

DB2stop

DB2 database commands in linux 3. Connect to the database

DB2 connect to o_yd user DB2 using pwd

4. Read Database Management Program Configuration

DB2 get dbm cfg

5. Write Database Management Program Configuration

DB2 update dbm cfg using parameter name parameter value

6. Read Database Configuration

DB2 connect to o_yd user DB2 using pwd

DB2 get db cfg for o_yd

7. Write Database Configuration

DB2 connect to o_yd user DB2 using pwd

DB2 update db cfg for o_yd using parameter name parameter value

8. Close all application connections

DB2 force application all

DB2 force application ID1, ID2, Idn MODE ASYNC

(DB2 list application for db o_yd show detail)

9. Back up the database

DB2 force application all

DB2 backup db o_yd to d:

(DB2 initialize tape on \. tape0)

(DB2 rewind tape on \. tape0)

DB2 backup db o_yd to \. tape0

10. Restore the database

DB2 restore db o_yd from d: to d:

DB2 restore db o_yd from \. tape0 to d:

DB2 database commands related to linux 11. Stored Procedure binding

DB2 connect to o_yd user DB2 using pwd

DB2 bind c: dfplus. bnd

Copy the stored procedure to the C: sqllibfunction directory on the server.

12. Sort the table

DB2 connect to o_yd user DB2 using pwd

DB2 reorg table ydd

DB2 runstats on table ydd with distribution and indexes all

13. Export table data

DB2 export to c: dftz.txt of del select * from dftz

DB2 export to c: dftz. ixf of ixf select * from dftz

14. Import table data

Import from c: 123.txt of del insert into ylbx. czyxx

DB2 import to c: dftz.txt of del commitcount 5000 messages c: dftz. msg insert into dftz

DB2 import to c: dftz. ixf of ixf commitcount 5000 messages c: dftz. msg insert into dftz

DB2 import to c: dftz. ixf of ixf commitcount 5000 insert into dftz

DB2 import to c: dftz. ixf of ixf commitcount 5000 insert_update into dftz

DB2 import to c: dftz. ixf of ixf commitcount 5000 replace into dftz

DB2 import to c: dftz. ixf of ixf commitcount 5000 create into dftz (IXF only)

DB2 import to c: dftz. ixf of ixf commitcount 5000 replace_create into dftz (IXF only)

15. Execute a batch file

DB2-tf batch processing file name

Run or end each command in the file)

16. automatically generate a batch file

Document: temp. SQL

Select 'runstats on table DB2. '| tabname |'

With distribution and detailed indexes all ;'

From syscat. tables where tabschema = 'db2 'and type = 'T ';

DB2-tf temp. SQL> runstats. SQL

17. automatically generate the table Creation View) Statement

On the server: C: sqllibmisc directory

DB2 connect to o_yd user DB2 using pwd

DB2look-d o_yd-u DB2-e-p-c: o_yd.txt

DB2 database commands in linux 18. Other commands

Grant dbadm on database to user bb

19 select * from czyxx fetch first 1 rows only

20DB2look-d ylbx-u DB2admin-w-asd-a-e-o a.txt 21. Show All Tables of the current user

List tables

22. list all system tables

List tables for system

23. view the table structure

DB2 describe select * from user. tables

Related Article

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.