Calculate the size of a table space that can be shrunk

Source: Internet
Author: User

1 SelectA.file#,a.name,a.bytes/1024x768/1024x768CURRENTMB,2Ceil (HWM*A.block_size)/1024x768/1024x768Resizeto,3(a.bytes-HWM*A.block_size)/1024x768/1024x768Releasemb,4        'ALTER DATABASE datafile" "||A.name||" "Resize'||5Ceil (HWM*A.block_size/1024x768/1024x768)|| 'M;'Resizecmd6  fromV$datafile A,7(Select file_id,Max(block_id+Blocks-1) HWM8         fromdba_extents e9        where exists(Select 1  fromDba_data_filesTen                              whereTablespace_name='lmps_users_201307'  and file_id=E.file_id) One        Group  by file_id) b A whereA.file#=B.file_id(+) -  and(a.bytes-HWM*Block_size)>0 - Order  by 5

Calculate the size of a table space that can be shrunk

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.