Oracle View what objects the data file contains

Source: Internet
Author: User

In the previous Oracle view Tablespace object, I explained how to query a table space for those database objects, so can we have a data file that contains those database objects? As shown below

SELECT  as Segment_type
 as Segment_name
 as file_name
SUM  as Segment_size
 from Dba_extents E
INNER JOIN  on E.file_id= f.file_id
WHERE f.file_id =109
GROUP   by E.segment_type,e.segment_name,f.file_name
ORDER  by DESC;

SELECT  as Segment_type
 as Segment_name
 as file_name
SUM  as Segment_size
 from Dba_extents E
INNER JOIN  on E.file_id= f.file_id
WHERE F.file_name =&file_name
GROUP   by E.segment_type,e.segment_name,f.file_name
ORDER  by DESC;

The wrong wording, as shown below, Dba_segments's header_file represents the ID of the file containing the segment header, mainly because it contains only the files where the Chito of the segment object resides.

SELECT  as OWNER
 as file_name
 as Segment_name
 as Segment_type
,SUM as Segment_size
From
 Left JOIN  on DS. Header_file = df. file_id
WHERE ds. Tablespace_name=&tablespace_name
 and DF. file_id=&file_id
GROUP  by Owner,file_name,segment_name,segment_type
ORDER  by 4;

Oracle View what objects the data file contains

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.