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!