zoukankan      html  css  js  c++  java
  • oracle tablespace

    oracle tablespace

    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

    5. 还有在命令行情况下如何将结果放到一个文件里。
    SQL> spool out.txt
    SQL> select * from v$database;
    SQL> spool off
  • 相关阅读:
    Socket listen 简要分析
    Socket connect 等简要分析
    HIVE函数大全
    元数据管理
    flume
    shell编程
    数据仓库集锦
    数据库知识
    hive sql 转化mapreduce原理
    Hadoop 学习笔记
  • 原文地址:https://www.cnblogs.com/huak/p/3459804.html
Copyright © 2011-2022 走看看