Oracle增加数据文件(表空间无法扩展)

现象报错:java.sql.SQLException: ORA-01654: unable to extend index table_student by 8192 in tablespace SF_INDEX

  一、表空间处理:

  1、查看现有情况

    select file_name,tablespace_name,autoextensible from dba_data_files where TABLESPACE_NAME='SF_INDEX';

  2、增加数据文件
    alter tablespace SF_INDEX add datafile '+ORADATA/PRO_BUSINESS/DATAFILE/sf_index9.dbf' size 100M autoextend on next 100M maxsize UNLIMITED;

  二、临时表空间处理

  1、查看现有情况

    select tablespace_name,
    file_name,
    user_bytes/bytes,
    bytes / 1024 / 1024 "file_size(M)",
    autoextensible
    from dba_temp_files t
    where t.TABLESPACE_NAME = 'TEMP';

  或  

    select c.tablespace_name,

 

    to_char(c.bytes/1024/1024/1024,'99,999.999') total_gb,

 

    to_char( (c.bytes-d.bytes_used)/1024/1024/1024,'99,999.999') free_gb,

 

    to_char(d.bytes_used/1024/1024/1024,'99,999.999') use_gb,

 

    to_char(d.bytes_used*100/c.bytes,'99.99') || '%'use

 

    from (select tablespace_name,sum(bytes) bytes

 

    from dba_temp_files GROUP by tablespace_name) c,

 

    (select tablespace_name,sum(bytes_cached) bytes_used

 

    from v$temp_extent_pool GROUP by tablespace_name) d

 

    where c.tablespace_name = d.tablespace_name;

 

  2、增加数据文件
    alter TABLESPACE TEMP ADD TEMPFILE '+ORADATA/PRO_BUSINESS/TEMPFILE/temp5.dbf' SIZE 1G AUTOEXTEND ON NEXT 128M MAXSIZE UNLIMITED;

posted @ 2021-08-12 14:20  0o飞行天下o0  阅读(1493)  评论(0编辑  收藏  举报