View the number of records in a file group in a partition table

Source: Internet
Author: User

1. First, find the partition number corresponding to the file group

[SQL]View plaincopy
  1. Use [dB]
  2. Go
  3. -- File group to be split
  4. Select FG. Name
  5. , Sp. destination_id
  6. From SYS. destination_data_spaces sp
  7. Inner join SYS. partition_schemes SCM on sp. partition_scheme_id = SCM. data_space_id
  8. Inner join SYS. filegroups FG on FG. data_space_id = sp. data_space_id
  9. Where SCM. Name = 'partition Scheme'
  10. And FG. Name = 'file group logical name ';

2. Obtain the number of records based on the Partition Number

Select count (*) from [Partition Table] where $ partition. Partition Function (partition by column) = Partition Number

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.