Oracle Common Scripts

Source: Internet
Author: User

Oracle Database Storage Usage queries

Create a view using the system SYS or DBA authority account as follows:

    1. This is mainly obtained from table dba_data_files,dba_segments two tables in the database.
    2. The default database holds a byte unit and the conversion relationship is as follows:
      1024bytes = 1kb
      1024KB = 1M
      1024M = 1G
      CREATE OR REPLACE VIEWV_get_diskspace as SELECTa.tablespace_name, A. Use"Used (MB)", (B.total-A. Use) "Free (MB)", B.total "Total (MB)",round((b.total-A. Use)/B.total,5)* -||'%'"Per_free" from ( SelectTablespace_name,sum(bytes)/(1024x768*1024x768) as  Use  fromdba_segments/*where Tablespace_name not in (' USERS ', ' sysaux ', ' UNDOTBS1 ', ' SYSTEM ', ' UNDOTBS2 ')*/ GROUP  bytablespace_name) A, ( withTablespace_total as ( SELECTTablespace_name,sum(MaxBytes)/(1024x768*1024x768) Total fromdba_data_files TWHERE /*T.tablespace_name not in (' USERS ', ' sysaux ', ' UNDOTBS1 ', ' SYSTEM ', ' UNDOTBS2 ') and*/T.autoextensible='YES' Group  byTablespace_nameUNION  All SELECTTablespace_name,sum(bytes) Total fromdba_data_files TWHERE /*T.tablespace_name not in (' USERS ', ' sysaux ', ' UNDOTBS1 ', ' SYSTEM ', ' UNDOTBS2 ') and*/T.autoextensible='NO' Group  bytablespace_name)SELECTTablespace_name,SUM(total) Total fromTablespace_totalGROUP  bytablespace_name) BWHEREA.tablespace_name=B.tablespace_name;

      Linux Server queries

        1. Du-sch * Use this command to query the space occupied by folders under the current directory

        2. DF-HL Querying disk space remaining

Oracle Common Scripts

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.