oracle表空間

--查看錶空間文件及大小 select tablespace_name "表空間名", file_name "文件名稱", round(bytes / (1024 * 1024), 0) "表空間大小(m)" from dba_data_files order by tablespace_name, file_name;數據庫

--查看錶空間使用狀況oracle

select a.tablespace_name "表空間名",app

total "表空間大小",

   free "表空間剩餘大小",

   (total - free) "表空間使用大小",

   total / (1024 * 1024 * 1024) "表空間大小(g)",

   free / (1024 * 1024 * 1024) "表空間剩餘大小(g)",

   (total - free) / (1024 * 1024 * 1024) "表空間使用大小(g)",

   round((total - free) / total, 4) * 100 "使用率 %"

from (select tablespace_name, sum(bytes) freespa

from dba_free_space

     group by tablespace_name) a,

   (select tablespace_name, sum(bytes) total

      from dba_data_files

     group by tablespace_name) b

where a.tablespace_name = b.tablespace_name;code

--修改表空間爲自增加 alter database datafile 'd:\oracle\product\10.2.0\oradata\edwtest\app03.dbf' autoextend on next 5m maxsize 100m;table

--增長表空間文件 alter tablespace users add datafile 'e:\oracle\product\10.2.0\oradata\orcl\users03.dbf' size 10240m;test

alter tablespace users add datafile 'e:\oracle\product\10.2.0\oradata\orcl\users03.dbf' size 10240m autoextend on next 64m maxsize 512m;file

--改變數據庫文件大小 alter database datafile 'e:\oracle\product\10.2.0\oradata\orcl\users02.dbf' resize 10240m;select

相關文章
相關標籤/搜索