PLSQL NOTE--------表空间不足解决方法

oracle 表空间不足解决方法

表空间不足错误信息:ORA-01654: unable to extend index <name of the index> by 128 in tablespace <name of the Index tablespace>。

解决方案:

1、查询当前用户的所属表空间

select * from user_users;

2、增加表空间有两种方法:

  以sysdba登陆进数据库

   语法:

  alter tablespace 表空间名称

  add datafile 表空间存放路径  size 表空间大小 autoextend on next 增长的大小 maxsize 空间最大值(如果不限制空间最大值就用unlimited)

  例如:

    alter tablespace vgsm
    add datafile 'c:\oracle\product\10.2.0\oradata\vgsm\vgsm_01.dbf'
    size 1024M autoextend on next 50M maxsize unlimited;

查询表空间详情:

select f.* from dba_data_files f where f.tablespace_name='VGSM'

以修改表空间的方式增加:

  语法:

  alter database

  datafile 表空间文件路径

 AUTOEXTEND(自动扩展) ON NEXT 表空间满后增加的大小

例如:

  alter database
 datafile 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\VGSM\VGSM' AUTOEXTEND ON NEXT 200m

查询表空间详情:

select f.* from dba_data_files f where f.tablespace_name='VGSM'

查询表和表空间详情:

 select t.tablespace_name,round(SUM(bytes/(1024*1024)),0)  ts_size 
 from dba_tablespaces t,dba_data_files d
 where t.tablespace_name=d.tablespace_name
 group by t.tablespace_name;  
 
 SELECT SUM(bytes) / (1024 * 1024) AS free_space, tablespace_name  
 FROM dba_free_space
 GROUP BY tablespace_name;
 
 select file_name,tablespace_name from dba_data_files;     
 
 alter database datafile '/u01/app/oracle/oradata/XE/system.dbf' resize 5000M;  
 alter database datafile '/u01/app/oracle/oradata/XE/system.dbf' autoextend on NEXT 200M ;

 

你可能感兴趣的:(PLSQL NOTE--------表空间不足解决方法)