Oracle notes: Tables and fields (3)

Source: Internet
Author: User

Oracle notes: Tables and fields (3) 4. change the field name, size, TYPE, and so on: Change the name: alter table mytable rename (OLD_FIELD) TO (NEW_FIELD); size and TYPE: alter table mytable modify FIELD_NAME TYPE (LENGTH ); where: when the table is empty, you can change the type and size of the field and change the length from large to small. However, when a record exists, it can only be changed from small to large in some cases, only compatible type. 5. change TABLE name: alter table MYTABLE_OLD rename to MYTABLE_NEW; 6. copy TABLE: create table NEW_TABLE nologigng as select * frm mytable; data is copied at the same time, but its primary key, constraint, trigger, and so on are not copied. 7. alter table mytable move tablespace SPACE_NAME; 8. view the tablespace of the current table: SELECT DEFAULT_TABLESPACE FROM USER_TABLES; 9. view all tables in the current tablespace: SELECT TABLE_NAME, TABLESPACE_NAME 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: 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.