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.
- db2 "select tbspaceid from syscat.tables where tabname='<Table_NAME>'"
- Exp:
- [db2inst1@localhost ~]$ db2 "select tbspaceid from syscat.tables where tabname='ACT'"
- TBSPACEID
1. The record is selected.
2. query all the Table methods included in Tablespaces.
- db2 "select tabname from syscat.tables where tbspaceid=<Tablespaces_ID>"
- Exp:
- [db2inst1@localhost ~]$ db2 "select tabname from syscat.tables where tbspaceid=2"
- TABNAME
- CL_SCHED
- PROJECT
- DEPARTMENT
- EMPLOYEE
- EMP_PHOTO
- EMP_RESUME
- PROJACT
- EMPPROJACT
- ACT
- IN_TRAY
- ORG
- STAFF
- SALES
- STAFFG
- ADEFUSR
You selected a record
3. query the tableiners method of Tablespaces.
- db2 list tablespace containers for <Tablespaces_ID> show detail
- Exp:
- [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.