以下的SQL将呈现表空间及其包含的数据文件和使用情况。

————————————————————————
Ending。

打赏

历史上的今天:

  1. 2018:  Cloudera CDH - Hadoop + MySQL - Sqoop - Error:ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@54d9d12d is still active.(0)
  2. 2018:  Sqoop + MySQL,error:Error: java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure(0)
  3. 2017:  XAMPP,WordPress + ProFTP:配置与使用(0)
  4. 2017:  Linux,CentOS 7:不重启系统,重新扫描硬盘的变更(0)

5
说点什么

avatar
5 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
5 Comment authors
GDSHelloworldDatabase Sourceadamhuan@wsit钻石之门 Recent comment authors

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

  Subscribe  
提醒
adamhuan@wsit
游客

col “Datafile List” for a90
set linesize 900
set pagesize 300

select
b.tablespace_name “Tablespace Name”,b.datafilelist “Datafile List”,b.totalmb “Total MB”,(b.totalmb – a.freemb) “Used MB”,a.freemb “Free MB”,
Round((1- a.freemb/b.totalmb)*100,2)||’ %’ “Usage Percent”
from
(select tablespace_name,sum(bytes)/1024/1024 freemb from dba_free_space group by tablespace_name) a,
(select tablespace_name,sum(bytes)/1024/1024 totalmb,wm_concat(file_name) datafilelist from dba_data_files group by tablespace_name) b
where
a.tablespace_name=b.tablespace_name
order by 6;

Database Source
游客
Database Source

col “Datafile List” for a80col “Tablespace Name” for a23set linesize 400

Helloworld
游客
Helloworld

set linesize 400col “Tablespace Name” for a23selectb.tablespace_name “Tablespace Name”,b.totalmb “Total MB”,a.freemb “Free MB”,Round((1- a.freemb/b.totalmb)*100,2)||’ %’ “Usage Percent”from(select tablespace_name,sum(bytes)/1024/1024 freemb from dba_free_space group by tablespace_name) a,(select tablespace_name,sum(bytes)/1024/1024 totalmb,wm_concat(file_name) datafilelist from dba_data_files group by tablespace_name) bwherea.tablespace_name=b.tablespace_nameorder by “Usage Percent” desc;

GDS
游客
GDS

set linesize 400col “Tablespace Name” for a23selectb.tablespace_name “Tablespace Name”,b.totalmb “Total MB”,a.freemb “Free MB”,Round((a.freemb/b.totalmb)*100,2)||’ %’ “Free Percent”from(select tablespace_name,sum(bytes)/1024/1024 freemb from dba_free_space group by tablespace_name) a,(select tablespace_name,sum(bytes)/1024/1024 totalmb,wm_concat(file_name) datafilelist from dba_data_files group by tablespace_name) bwherea.tablespace_name=b.tablespace_nameorder by “Free Percent” desc;