Correct application of Table and Tablespaces commands in the DB2 database

Source: Internet
Author: User

Today we will mainly describe the commands for Table and Tablespaces In the DB2 database. If you are interested in the commands for Table and Tablespaces In the DB2 database, you can click to view the following articles. The following describes the specific solution and hope it will be helpful for your future study.

1. query the Tablespaces method of the Table.

 
 
  1. db2 "select tbspaceid from syscat.tables where tabname='<Table_NAME>'"  
  2. Exp:  
  3. [db2inst1@localhost ~]$ db2 "select tbspaceid from syscat.tables where tabname='ACT'"  
  4. TBSPACEID  

1. The record is selected.

2. query all the Table methods included in Tablespaces.

 
 
  1. db2 "select tabname from syscat.tables where tbspaceid=<Tablespaces_ID>"  
  2. Exp:  
  3. [db2inst1@localhost ~]$ db2 "select tabname from syscat.tables where tbspaceid=2"  
  4. TABNAME  
  5. CL_SCHED  
  6. PROJECT  
  7. DEPARTMENT  
  8. EMPLOYEE  
  9. EMP_PHOTO  
  10. EMP_RESUME  
  11. PROJACT  
  12. EMPPROJACT  
  13. ACT  
  14. IN_TRAY  
  15. ORG  
  16. STAFF  
  17. SALES  
  18. STAFFG  
  19. ADEFUSR  

You selected a record

3. query the tableiners method of Tablespaces.

 
 
  1. db2 list tablespace containers for <Tablespaces_ID> show detail  
  2. Exp:  
  3. [db2inst1@localhost ~]$ db2 list tablespace containers for 2 show detail  

The above content is an introduction to the commands for Table and Tablespaces In the DB2 database. I hope you will have some gains.

The above content is an introduction to the commands for Table and Tablespaces In the DB2 database. I hope you will have some gains.

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.