1. 先查询表空间在物理磁盘上存放的位置,注意使用sysdba的账号登陆。

SELECT tablespace_name,
file_id,
file_name,
round(bytes / (1024 * 1024), 0) total_space
FROM dba_data_files
ORDER BY tablespace_name;

2. 需要扩容的表空间是DW_STG_TBS,目前的文件分配序号是DW_STG_TBS20.dbf,

所以在接下来的要增加的文件的名称从21开始,我们一次行增加20个文件,脚本如下。

其中设置的每个文件初始分配空间为7g, autoextend on为自动增长大小,oracle单个文件大小最大不超过32g.

--增加Stage层表空间
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS21.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS22.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS23.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS24.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS25.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS26.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS27.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS28.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS29.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS30.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS31.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS32.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS33.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS34.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS35.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS36.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS37.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS38.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS39.dbf' size 7167M autoextend on ;
alter tablespace DW_STG_TBS
add datafile '/u01/app/oracle/oradata/crm001/DW_STG_TBS40.dbf' size 7167M autoextend on ;

3. 将以上SQL在PL/SQL中执行,完成后查询结果如下:

4. 使用本博客中另外一篇文章[ORACLE数据库存储空间使用情况查询]中的SQL语句查询表空间大小

oracle数据库表空间扩容方法的更多相关文章

  1. oracle数据库表空间追加数据库文件方法

    oracle数据库表空间追加数据库文件方法   针对非大文件方式表空间,允许追加文件进行表空间的扩展,单个文件最大大小是32G  第一种方式:表空间增加数据文件    www.2cto.com   1 ...

  2. Oracle数据库表空间与数据文件的关系描述正确的是( )

    Oracle数据库表空间与数据文件的关系描述正确的是( ) A.一个表空间只能对应一个数据文件 B.一个表空间可以对应多个数据文件 C.一个数据文件可以对应多个表空间 D.表空间与数据文件没任何对应关 ...

  3. Oracle数据库表空间与用户的关系是 ( )

    Oracle数据库表空间与用户的关系是 ( )? A.一对一 B.一对多 C.多对一 D.多对多 解答: D 一个用户可以使用一个或多个表空间,一个表空间也可以供多个用户使用.

  4. 查看Oracle数据库表空间大小(空闲、已使用),是否要增加表空间的数据文件

    查看Oracle数据库表空间大小(空闲.已使用),是否要增加表空间的数据文件 1.查看表空间已经使用的百分比 Sql代码 select a.tablespace_name,a.bytes/1024/1 ...

  5. 创建oracle数据库表空间并分配用户

    我们在本地的oracle上或者virtualbox的oracle上 创建新的数据库表空间操作:通过system账号来创建并授权/*--创建表空间create tablespace YUJKDATAda ...

  6. oracle表空间扩容方法

    1.使用navicat连接要扩容的数据库,进入其他-表空间 2.添加数据文件和设置配置项即可

  7. oracle数据库表空间文件收缩实例

    Oracle数据文件收缩实例 数据文件的作用 HWM的基本概念 查看数据文件的使用情况 包括内容:数据文件大小,已经used空间,free空间,hwm信息 select /*+ ordered use ...

  8. oracle数据库表空间及归档

    --表空间(TableSpace)是Oracle的开创性理念.表空间使得数据库管理更加灵活,而且极大地提高了数据库性能. --作用 :1.避免磁盘空间突然耗竭的风险 2.规划数据更灵活 3.提高数据库 ...

  9. 新建oracle数据库表空间及删除表空间和用户

    进入oracle的命令控制台,按具体情况执行以下命令: sqlplus 默认数据库普通用户登录sqlplus / as sysdba 默认数据库管理员登录sqlplus username/passwo ...

随机推荐

  1. codevs 1432 总数统计

    1432 总数统计 时间限制: 1 s空间限制: 128000 KB题目等级 : 钻石 Diamond   题目描述 Description 给出n个数,统计两两之和小于k的方案数之和. 输入描述 I ...

  2. Visual Studio 创建WebServer

    1.文件-->新建-->项目 2.Web-->Visual Studio 2012-->ASP.NET 空Web应用程序 3.右键项目-->添加-->新建项 4.选 ...

  3. 【Beta版本】冲刺-Day2

    队伍:606notconnected 会议时间:12月10日 目录 一.行与思 二.站立式会议图片 三.燃尽图 四.代码Check-in 一.行与思 张斯巍(433) 今日进展:对登录界面做了相应的修 ...

  4. springMVC的注解详解

    springmvc常用注解标签详解 1.@Controller 在SpringMVC 中,控制器Controller 负责处理由DispatcherServlet 分发的请求,它把用户请求的数据经过业 ...

  5. java编程思想-java注解

    注解(也被称为元数据)为我们在代码中添加信息提供了一种形式化的方法,使我们可以在稍后某个时刻非常方便的使用这些数据. 一.定义注解 注解的定义看起来很像接口的定义.事实上,与其他任何Java接口一样, ...

  6. Eclipse自动补全+常用快捷键

    一,Eclipse自动补全增强方法 在Eclipse中,从Window -> preferences -> Java -> Editor -> Content assist - ...

  7. chmod 和 chown 的用法

    一.chown 命令 用途:更改文件的所有者或组.命令由单词change owner组合而成. 使用示例: 1,更改文件的所有者: chown jim program.c 文件 program.c 的 ...

  8. JavaWeb学习笔记——开发动态WEB资源(四)打印当前使用的是get方法

    该工程的名称是testhttp,功能是在页面中表格打印浏览过程中的相关头信息. 新建一个工程,然后在这个工程里面新建一个servlet,这样便可以省去编写web.xml的过程 以下是TestHttpS ...

  9. python中的not具体使用及意思

    python中的not具体使用及意思 name='' while not name: name=raw_input(u'请输入姓名:') print name python中的not具体表示是什么: ...

  10. *** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory

    报错提示: *** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndex ...