View oracle tablespace and table size

Source: Internet
Author: User

Check the table space and table size in the oracle database today. It seems that the table space is too large. Find the following information and first query the space occupied BY the TABLE. Use the following statement: SQL code SELECT SEGMENT_NAME, SUM (BYTES)/1024/1024 MBYTESE FROM USER_SEGMENTS WHERE SEGMENT_TYPE = 'table' GROUP BY SEGMENT_NAME; alternatively, when the SQL code Select Segment_Name, Sum (bytes)/1024/1024 as sizeof From User_Extents Group By Segment_Name order by sizeof desc deletes full table data in a large amount of data, using truncate tabletruncate table will release the tablespace. To delete a table, you need to alter tablespace *** COALESCE; only when the spatial truncate table has no transaction concept, and the data is completely cleared after execution. Truncate will return highwatermark to 0. Now it will be faster when new records are inserted again. Truncate table Index will also be deleted, not the drop index. Note: deleting data cannot reduce the tablespace, but it is more reusable. to reduce the size of the table and make it available to the operating system, you need to move the table tablespace to the original tablespace and then narrow down the tablespace. example: alter table your_table move tablespace yourtablespace;

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.