DB2 rename a table and view table information

Source: Internet
Author: User
Tags db2 describe table

I believe everyone has some knowledge about the DB2 RENAME TABLE. The following describes how to rename a table in DB2 and view the table information. If you are interested, take a look.

DB2 RENAME TABLE
You can use the RENAME statement to RENAME an existing table. For example:

C: \> db2 rename table tta to rn_tab

The DB20000I SQL command is successfully completed.

When you rename a table, the source table cannot be referenced in any existing definition (view or materialized query table), trigger, SQL function, or constraint. It cannot have any generated columns (except the ID column), or be a parent or slave table. Directory entries are updated to reflect the new table name.

View table information
You can use the commands shown in the table to obtain table information.

Life order Description
List tables List the tables used for the current user
List tables for all List all tables defined in the database
List tables for schema schemaname List tables in the specified mode
(Continued table)
Life order Description
List tables for schema List tables in the current user name Mode
Describe table tablename Display the structure of the specified table

For example, the following command:

Db2 describe table department
 

DB2 mount command performance factors

How to back up all tables in DB2

How to Implement DB2 row-to-column Conversion

Implementation of Online DB2 backup

Implementation of deleting duplicate data in DB2

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.