DBA Common SQL table space and data file

Source: Internet
Author: User

Select round (sum/ (1024x768*1024x7680) ts_size  from  where=Group by T.tablespace_name;
1. View the table space name and size
SelectA.tablespace_name, A.bytes/ 1024x768 / 1024x768"SumMB ", (A.bytes-B.bytes)/ 1024x768 / 1024x768"Used MB", B.bytes/ 1024x768 / 1024x768"Free MB",round(((A.bytes-B.bytes)/A.bytes)*  -,2) "percent_used" from(SelectTablespace_name,sum(bytes) bytes fromDba_data_filesGroup  byTablespace_name) A, (SelectTablespace_name,sum(bytes) Bytes,Max(bytes) Largest fromDba_free_spaceGroup  bytablespace_name) bwhereA.tablespace_name=B.tablespace_nameOrder  by((a.bytes-B.bytes)/A.bytes)desc;
2. View Table space usage
Select Tablespace_name,        file_id ,        file_name ,       STATUS,       online_status,       round/ (1024x768 /1024x768) 0 ) total_space  fromorder by tablespace_name;
3. View the table space physical file name and size
Select segment_name,       tablespace_name,       r.status,       /1024x768) initialextent,        /1024x768) nextextent,       max_extents,       v.curext curextent  from   Where = V.usn (+ ORDER by Segment  _name;
4. View the rollback segment name and size
Select file_name  from Dba_data_files
5. Query tablespace or data file Auto-expansion
Select df.tablespace_name name,       DF. file_name       " file ",       f.phyrds           pyr,       f.phyblkrd         PBR,       f.phywrts          pyw,       f.phyblkwrt        PBW  From where F.file= df.  file_id Order  by Df.tablespace_name;
6. Monitoring the I/O ratio of table spaces

DBA Common SQL table space and data file

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.