zoukankan      html  css  js  c++  java
  • ORACLE 表空间扩展

    最近公司在对即将上线的系统做数据迁移和压力测试,于是乎需要和 Oracle 经常的打交道。今天正好碰到了表空间的问题,记录下来以后备用。也是最近才学习到的,原来 Oracle 表空间也是有大小限制的,比如公司安装的 Oracle 单个 dbf 最大 31GB,所以当一个表空间文件达到最大值后就无法再增长了。需要再开辟一个表空间文件。

    查看表空间的名字和物理路径

    select tablespace_name, file_id, file_name,
    round(bytes/(1024*1024),0) total_space
    from dba_data_files
    order by tablespace_name
    

    增加表空间大小

    -- chenglongoraclexxx.dbf 为表空间物理路径
    alter database datafile 'chenglongoraclexxx.dbf' resize 1000M
    

    设置表空间自动扩展

    alter database datafile 'chenglongoraclexxx.dbf'
    autoextend on next 100M [maxsize 10000M]
    

    增加表空间数据文件

    alter tablespace XXXTableSpace
    add datafile 'chenglongoraclexxx2.dbf' size 1000m
    

    查看表空间使用情况

    select a.tablespace_name,a.bytes/1024/1024 "sum MB",
    (a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",
    round (((a.bytes-b.bytes)/a.bytes)*100,2) "used%" from
    (select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
    (select tablespace_name,sum(bytes) bytes,max (bytes) largest from dba_free_space group by tablespace_name)b
    where a.tablespace_name=b.tablespace_name
    order by ((a.bytes-b.bytes)/a.bytes) desc;
    

    本文由个人 hexo 博客 co2fe.com 迁移
    date: 2017-09-28 22:08:03

  • 相关阅读:
    jsack
    生产BackPressure 的代码
    org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint
    https://www.callicoder.com/java-8-completablefuture-tutorial/
    microservices kubernetes
    flink metrics
    numRecordsIn 在哪里实现?
    flink Job提交过程
    https://jzh.12333sh.gov.cn/jzh/
    blocking
  • 原文地址:https://www.cnblogs.com/manastudent/p/10190911.html
Copyright © 2011-2022 走看看