给你一个语句,查看剩余表空间
SELECT upper(f.tablespace_name) 表空间名,
d.Tot_grootte_Mb "表空间大小(M)",
d.Tot_grootte_Mb - f.total_bytes "已使用空间(M)",
round((d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_Mb * 100,2) "使用比",
f.total_bytes "空闲空间(M)",
f.max_bytes "最大块(M)"
FROM
(SELECT tablespace_name,
round(SUM(bytes)/(1024*1024),2) total_bytes,
round(MAX(bytes)/(1024*1024),2) max_bytes
FROM sys.dba_free_space
GROUP BY tablespace_name) f,
(SELECT dd.tablespace_name, round(SUM(dd.bytes)/(1024*1024),2) Tot_grootte_Mb
FROM sys.dba_data_files dd
GROUP BY dd.tablespace_name) d
WHERE d.tablespace_name = f.tablespace_name
ORDER BY 4 DESC
SELECT upper(f.tablespace_name) 表空间名,
d.Tot_grootte_Mb "表空间大小(M)",
d.Tot_grootte_Mb - f.total_bytes "已使用空间(M)",
round((d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_Mb * 100,2) "使用比",
f.total_bytes "空闲空间(M)",
f.max_bytes "最大块(M)"
FROM
(SELECT tablespace_name,
round(SUM(bytes)/(1024*1024),2) total_bytes,
round(MAX(bytes)/(1024*1024),2) max_bytes
FROM sys.dba_free_space
GROUP BY tablespace_name) f,
(SELECT dd.tablespace_name, round(SUM(dd.bytes)/(1024*1024),2) Tot_grootte_Mb
FROM sys.dba_data_files dd
GROUP BY dd.tablespace_name) d
WHERE d.tablespace_name = f.tablespace_name
ORDER BY 4 DESC
解决方案 »
- 如何获取一条记录的md5码?
- 问一下after insert触发器的问题。
- 如何统计想要的数据
- oracle执行存储过程怎么能返回多条记录?
- 怎么取得上月的今天的日期和去年的今天的日期最方便?
- 实在无奈求助
- v$session中的status状态不准阿!我刚刚登录,但是status还是INACTIVE!!请问哪里可以获得当前正登录着的用户/会话信息呢????
- 请教一个关于程序用户的问题
- 请问:类似于select id,isnull(name,'test') from table where....在oracle 中怎么写?
- 麻烦的SQL语句,救我啊!!!
- oracle 给硬盘加锁?
- 使用动态语句子如何处理单条记录急~~~
alter tablespace user_tabs add datafile 'x:\yyy.dbf' sizeof 250m autoextend on;autoextend 设置为 on 就好啦!
看帮助或是用楼上诸位的脚本都可以,若实在不会,DBA Studio傻瓜式的也可以啊。
ORA-01119: error in creating database file '/dev/rora_data207.dbf'
ORA-27040: skgfrcre: create error, unable to create file
IBM AIX RISC System/6000 Error: 13: Permission denied