zoukankan      html  css  js  c++  java
  • 【ORACLE】 表空间信息

    Linux 查看磁盘空间命令
    格式: df -hl

    显示格式为:

    文件系统 容量 已用 可用 已用% 挂载点

    [root@localhost opt]# df
    Filesystem     1K-blocks      Used Available Use% Mounted on
    /dev/sda3      416502068 103330280 313171788  25% /
    devtmpfs         1899236         0   1899236   0% /dev
    tmpfs            1907804         0   1907804   0% /dev/shm
    tmpfs            1907804      9056   1898748   1% /run
    tmpfs            1907804         0   1907804   0% /sys/fs/cgroup
    /dev/sda1       51175000  51164908     10092 100% /home
    tmpfs             381564         8    381556   1% /run/user/42
    tmpfs             381564         0    381564   0% /run/user/1001
    tmpfs             381564         0    381564   0% /run/user/0
    其中
    /dev/sda1       51175000  51164908     10092 100% /home 可见  /home 使用已经100%
     
    表空间信息可以通过以下脚本查询:
     
    select a.tablespace_name 表空间,
           c.file_name 表空间数据文件,
           c.bytes / 1024 / 1024 || 'M' 该数据文件大小,
           a.total_bytes || 'M' 总计,
           a.total_bytes - nvl(b.free_bytes, 0) || 'M' 已使用,
           round((a.total_bytes - nvl(b.free_bytes, 0)) / a.total_bytes, 4) * 100 || '%' 表空间已使用百分比,
           nvl(b.free_bytes, 0) || 'M' 表空间剩余,
           round(nvl(b.free_bytes, 0) / a.total_bytes, 4) * 100 || '%' 表空间剩余百分比
      from (select df.tablespace_name, sum(df.bytes) / 1024 / 1024 Total_bytes
              from dba_data_files df
             group by df.tablespace_name) a,
           (select fs.tablespace_name, sum(fs.bytes) / 1024 / 1024 Free_bytes
              from dba_free_space fs
             group by fs.tablespace_name) b,
           dba_data_files c
     where a.tablespace_name = b.tablespace_name(+)
       and a.tablespace_name = c.tablespace_name
     order by a.total_bytes desc
     
    如果磁盘空间足够大,可以通过自动扩展表空间的方法扩大表空间
    alter database datafile 'C:APPADMINISTRATORPRODUCT11.2.0DBHOME_1DATABASEPRMMS_GIS2' autoextend on;
     
    如果磁盘空间不足,可以通过增加表空间文件的方法再其他磁盘创建表空间文件扩展表空间 
    alter tablespace TBLSMS add datafile '/opt/oracle/oradata/starboss/tblsms.dbf' size 5000M autoextend on maxsize 20G;

     
     
  • 相关阅读:
    Qt消息机制和事件、事件过滤
    QTableview 获取鼠标坐标的item(QModelIndex)
    qt 拖放dropEvent
    Qt获取控件位置,坐标总结
    Quick Easy FTP Server FTP工具文件传输使用
    Qt QDialog将窗体变为顶层窗体(activateWindow(); 和 raise() )
    makefile 通配符了解% $@ $^ $<
    QLocalServer和QLocalSocket单进程和进程通信
    RC4 加解密
    qt 拷贝文件设置进度条
  • 原文地址:https://www.cnblogs.com/liuyongcn/p/5433228.html
Copyright © 2011-2022 走看看