查看Oracle的表空间的使用情况

WBOY
リリース: 2016-06-07 17:20:47
オリジナル
1032 人が閲覧しました

1. 查看所有表空间大小 SQLgt; select tablespace_name,sum(bytes)/1024/1024 from dba_data_files 2 group by tablespace_na

1. 查看所有表空间大小

SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_data_files
  2  group by tablespace_name;

2. 查看空闲的表空间大小
SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_free_space
  2  group by tablespace_name;

3. 所以使用空间可以这样计算

select a.tablespace_name,total,free,total-free used from
( select tablespace_name,sum(bytes)/1024/1024 total from dba_data_files
   group by tablespace_name) a,
( select tablespace_name,sum(bytes)/1024/1024 free from dba_free_space
   group by tablespace_name) b
where a.tablespace_name=b.tablespace_name;

4. 下面这条语句查看所有segment的大小。
Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name

注意查询的结果都是以M为单位

linux

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!