当前位置: 移动技术网 > IT编程>数据库>Oracle > oracle 的表空间实例详解

oracle 的表空间实例详解

2017年12月08日  | 移动技术网IT编程  | 我要评论
oracle 的表空间实例详解 查询表空间 select upper(f.tablespace_name) "表空间名",   d.tot_grootte_

oracle 的表空间实例详解

查询表空间

select upper(f.tablespace_name) "表空间名", 
  d.tot_grootte_mb "表空间大小(m)", 
  d.tot_grootte_mb - f.total_bytes "已使用空间(m)", 
  to_char(round((d.tot_grootte_mb - f.total_bytes) / d.tot_grootte_mb * 100, 
  2), 
  '990.99') "使用比", 
  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; 

添加一个表空间文件:

alter tablespace testtbs
add datafile 'd:/ora/datafile/users.ora' size 500m
autoextend on
 

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网