Oracle tablespace to view SQL usage, oracle tablespace SQL

Source: Internet
Author: User

Oracle tablespace to view SQL usage, oracle tablespace SQL

In daily work, the most important thing for DBA is to check the usage of the tablespace to check whether the tablespace is full.

The procedure is as follows:

Step 1: Open PLSQL

Step 2: Create an SQL window

Step 3: Enter the code:

select a.tablespace_name tablespace_name,nvl(ceil((1 - b.free / a.total) * 100), 100) "usage_of_tablespace%",nvl(b.free, 0) "left_space(M)",c.extent_management "Extent_management"from (select tablespace_name, sum(nvl(bytes, 0)) / 1024 / 1024 totalfrom dba_data_filesgroup by tablespace_name) a,(select tablespace_name, sum(nvl(bytes, 0)) / 1024 / 1024 freefrom dba_free_spacegroup by tablespace_name) b,dba_tablespaces cwhere a.tablespace_name = c.tablespace_nameand c.tablespace_name = b.tablespace_name(+);

Step 4: view the resultIf the tablespace is full, you need to process it immediately.

Friendly reminder of the customer's house:

If the tablespace is full, it should be processed in time to avoid system crash.

The preceding section describes how to use Oracle tablespace to view SQL statements. I hope it will be helpful to you. If you want more information, please stay tuned to the help House website!

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.