Skip to main content

Freespace by Tablespace

set pagesize 86
ttitle skip 2 center 'FREE - Free space by Tablespace' skip 2
column dummy noprint
column pct_used format 999.9 heading "Percentage_Used"
column name format a16 heading "Tablespace Name"
column bytes format 999,999,999,999,999 heading "Total MBytes"
column used format 999,999,999,999,999 heading "Used MB"
column free format 999,999,999,999,999 heading "Free MB"
break on report
compute sum of bytes on report
compute sum of free on report
compute sum of used on report
spool freespace.lst
set termout on



select a.tablespace_name name,
sum(b.bytes/1024/1024)/count( distinct a.file_id||'.'||a.block_id ) Megabytes,
sum(b.bytes/1024/1024)/count( distinct a.file_id||'.'||a.block_id ) -
sum(a.bytes/1024/1024)/count( distinct b.file_id ) usedSpace,
sum(a.bytes/1024/1024)/count( distinct b.file_id ) freespace,
100 * ( (sum(b.bytes)/count( distinct a.file_id||'.'||a.block_id )) -
(sum(a.bytes)/count( distinct b.file_id ) )) /
(sum(b.bytes)/count( distinct a.file_id||'.'||a.block_id )) pct_used
from sys.dba_free_space a, sys.dba_data_files b
where a.tablespace_name = b.tablespace_name
group by a.tablespace_name, b.tablespace_name
order by pct_used;



spool off
set termout on

Comments

Popular posts from this blog

CLSRSC-430: Failed to start rolling patch mode

############################################################ GRID PSU Failed on Node2: =========================== [root@server1 tmp]# /oracrs/oracle/product/12102/OPatch/opatchauto apply /path1/patches/23273629 -oh /oracrs/oracle/product/12102 -ocmrf /tmp/ocm.rsp OPatch Automation Tool Copyright (c)2014, Oracle Corporation. All rights reserved. OPatchauto Version : 12.1.0.1.10 OUI Version        : 12.1.0.2.0 Running from       : /oracrs/oracle/product/12102 opatchauto log file: /oracrs/oracle/product/12102/cfgtoollogs/opatchauto/23273629/opatch_gi_2016-11-25_06-13-44_deploy.log Parameter Validation: Successful Configuration Validation: Successful Patch Location: /path1/patches/23273629 Grid Infrastructure Patch(es): 21436941 23054246 23054327 23054341 DB Patch(es): 23054246 23054327 The following patch(es) are duplicate patches with patches installed in the Oracle Home.  [ 20299023] You hav...

SQL Plan Management [ SPM ]

============================================= SQL> SHOW parameter baselines NAME                                 TYPE        VALUE ------------------------------------ ----------- ------- optimizer_capture_sql_plan_baselines boolean     FALSE optimizer_use_sql_plan_baselines     boolean     TRUE SQL> ============================================= Connect as SPM user and create a table as follows. -------------------------------------------------- SQL> CREATE TABLE EMPLOYEE (code number,dept char(100),address char(1000)); Table created. SQL> ============================================= Populate some rows in the table =================================== declare c1 number; begin for c1 IN 1..10000 ...