周末进行生产数据库迁移及搭建的时候由于数据比较大报 ORA-01653: unable to extend table
这是个较为常见的错误,就是TABLESPACE没有空间了。以下为ORACLE给出的错误解释和解决方法。
10635, 00000, "Invalid segment or tablespace type"
// *Cause: Cannot shrink the segment because it is not in auto segment space
// managed tablespace or it is not a data, index or lob segment.
// *Action: Check the tablespace and segment type and reissue the statement
解决方法:
select * from dba_data_files;
drop user XXMS_HIS cascade;
drop tablespace "XXMSHISDATA" including contents and datafiles cascade constraint;
--创建表空间
CREATE SMALLFILE TABLESPACE "XXMSHISDATA"
LOGGING DATAFILE '/home/oracle/app/product/oradata/XXDB/XXMS_HIS.dbf'
SIZE 1000M
AUTOEXTEND ON NEXT 10204K
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
grant connect,resource,imp_full_database, exp_full_database,create database link,unlimited tablespace to xxms_his;
--按数据量计算建立数据文件防止数据文件32G限制
alter tablespace XXMSHISDATA add datafile '/home/oracle/app/product/oradata/XXDB/xxmshisdata02.dbf' size 1000M autoextend on next 100M maxsize UNLIMITED;
alter tablespace XXMSHISDATA add datafile '/home/oracle/app/product/oradata/XXDB/xxmshisdata03.dbf' size 1000M autoextend on next 100M maxsize UNLIMITED;
--执行数据导入
$imp kams_his/kams_his file=/home/oracle/data/xxms_his20190802.dmp log=/home/oracle/data/xxms_his20190830.dmp.implog ignore=y full=y