扩展数据文件大小

 表空间不足时,需要查看表空间对应的数据文件是否字段扩展、最大大小等。
查看各表空间的使用情况:
SQL> 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) "percent_used"
    from
    (select tablespace_name,sum(bytes) bytes from dba_data_files group by table
space_name) a,
    (select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_s
pace group by tablespace_name) b
    where a.tablespace_name=b.tablespace_name
    order by ((a.bytes-b.bytes)/a.bytes) desc
    ;

TABLESPACE_NAME                    Sum MB    used MB    free MB percent_used
------------------------------ ---------- ---------- ---------- ------------
SYSTEM                                500   498.4375     1.5625        99.69
SYSAUX                                380    369.375     10.625         97.2
UNDOTBS1                               40     10.625     29.375        26.56
SDE                                   400       52.5      347.5        13.13
USERS                                   5      .4375     4.5625         8.75

 

查看表空间对应的数据文件是否字段扩展,大小、最大大小等。
SQL> col file_name for a30
SQL> select file_id,file_name,tablespace_name,autoextensible,
  2  bytes/1024/1024 "MB",maxbytes/1024/1024 "max MB"
  3  from dba_data_files;

如果数据文件不足,扩展大小如下:设置最大为1G。
SQL> alter database datafile
  2  'E:\GISDATA\SDEDATA\SDE.DBF' autoextend on next 10M maxsize 1G;

如果数据文件不足,扩展大小如下:设置最大为无限扩大

SQL> alter database datafile
  2  'E:\GISDATA\SDEDATA\SDE.DBF' autoextend on next 10M maxsize unlimited;


备注:如果表空间的为small file的表空间,则不能使用下面的语法.
SQL> alter tablespace USERS
  2  autoextend on next 10M
  3  maxsize 1G;
alter tablespace USERS
*
第 1 行出现错误:
ORA-32773: 不支持对小文件表空间 USERS 的操作

表空间是smallfile tablespace不能用resize tablespace
只有bigfile tablespace才可以resize tablespace

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12778571/viewspace-605523/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12778571/viewspace-605523/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值