DB2 Instructions guide for operating on machine

Source: Internet
Author: User
Tags definition create index db2 db2 connect db2 connect to db2 insert port number backup

1. Startup instance (DB2INST1):

Db2start

2. Stop instance (DB2INST1):

Db2stop

3. List all instances (DB2INST1)

Db2ilist

5. List the current instance:

DB2 Get Instance

4. View the sample configuration file:

DB2 Get DBM Cfg|more

5. Update Database Manager parameter information:

DB2 update dbm CFG using Para_name para_value

6. Create a database:

DB2 Create DB Test

7. View database configuration parameter information

DB2 get DB CFG for Test|more

8. Update database parameter configuration information

DB2 Update DB CFG for test using Para_name para_value

10. Delete database:

DB2 Drop DB Test

11. Connecting to the database

DB2 Connect to test

12. List the details of all tablespaces.

DB2 List tablespaces Show Detail

13. Query data:

DB2 SELECT * FROM TB1

14. Data:

DB2 Delete from TB1 where id=1

15. CREATE INDEX:

DB2 CREATE INDEX IDX1 on tb1 (ID);

16. Create a view:

DB2 CREATE VIEW VIEW1 as select ID from TB1

17. Query view:

DB2 SELECT * FROM View1

18. Node Cataloging

DB2 catalog TCP node Node_name remote SERVER_IP Server Server_port

19. See the port number

DB2 Get dbm Cfg|grep SVCENAME

20. Attach to test node

DB2 Attach to Node_name

21. View Local nodes

DB2 List Node Direcotry

22. Node Reverse Cataloging

DB2 uncatalog Node Node_name

23. Database Cataloging

DB2 Catalog DB db_name as Db_alias at node Node_name

24. Viewing the catalogue of databases

DB2 List DB Directory

25. Connecting to the database

DB2 Connect to Db_alias user user_name using User_password

26. Database Reverse Cataloging

DB2 Uncatalog DB Db_alias

27. Export Data

DB2 Export to MyFile of IXF messages MSG select * FROM TB1

28. Import data

DB2 import from MyFile to IXF messages msg replace into TB1

29. Export all table data for a database

Db2move Test Export

30. Creating a Database definition

db2look-d db_alias-a-e-m-l-x-f-o db2look.sql

31. Create a Database

DB2 Create DB Test1

32. Build Definition

DB2-TVF Db2look.sql

33. Import all data from the database

Db2move Db_alias Import

34. Reorganization Inspection

DB2 Reorgchk

35. Reorganization Table TB1

DB2 reorg Table TB1

36. Update statistical information

DB2 runstats on table TB1

37. Backup DATABASE Test

DB2 Backup DB Test

38. Restore DATABASE Test

DB2 Restore DB Test

399\. List information for a container

DB2 list tablespace containers for tbs_id Show Detail

40. Create a table:

DB2 ceate table tb1 (ID integer not null,name char (10))

41. List all Tables

DB2 List Tables

42. Insert Data:

DB2 INSERT INTO TB1 values (1, ' Sam ');

DB2 INSERT INTO TB2 values (2, ' Smitty ');

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.