alter table move 遭遇ORA-01652: unable to extend temp segment
前面的试验的过程中遇到了,看这个提示首先怀疑是临时表空间不足但也有可能是目标表空间不足。
ORA-01652: unable to extend temp segment by 128 in tablespace ANBOB
system@ORCL> create tablespace anbob datafile ‘/u01/app/oracle/oradata/ORCL/datafile/anbob.dbf’ size 5m;
Tablespace created.
anbob@ORCL> create table testspace as select * from all_objects;
Table created.
anbob@ORCL> select segment_name,tablespace_name from user_segments where segment_name=’TESTSPACE’;
SEGMENT_NAME TABLESPACE_NAME
——————– ——————–
TESTSPACE TT
anbob@ORCL> select count(*) from testspace;
COUNT(*)
———-
40770
anbob@ORCL> insert into testspace select * from testspace;
40770 rows created.
anbob@ORCL> /
81540 rows created.
anbob@ORCL> /
163080 rows created.
anbob@ORCL> select count(*) from testspace;
COUNT(*)
———-
326160
anbob@ORCL> alter table testspace move tablespace anbob;
alter table testspace move tablespace anbob
*
ERROR at line 1:
ORA-01652: unable to extend temp segment by 128 in tablespace ANBOB
system@ORCL>exec dbam_stats.gather_table_states(‘ANBOB’,’TESTSPACE’);
system@ORCL> select file_name,tablespace_name,bytes/1024/1024 mb from dba_data_files where tablespace_name=’ANBOB’;
FILE_NAME TABLESPACE_NAME MB
———————————————————— ——————– ———-
/u01/app/oracle/oradata/ORCL/datafile/anbob.dbf ANBOB 5
system@ORCL> select owner,segment_name,bytes/1024/1024 from dba_segments where segment_name=’TESTSPACE’;
OWNER SEGMENT_NAME BYTES/1024/1024
—————————— ——————– —————
ANBOB TESTSPACE 37
sys@ORCL> select file#,bytes/1024/1024 from v$tempfile;
FILE# BYTES/1024/1024
———- —————
1 100
sys@ORCL> select * from V$TEMPSEG_USAGE;
no rows selected
临时表空间有100M,但没有使用,可以断定ORA-01652 不是临时表空间不足而是move 时目标 表空间不足
sys@ORCL> alter database datafile ‘/u01/app/oracle/oradata/ORCL/datafile/anbob.dbf’ resize 40m;
Database altered.
sys@ORCL> conn anbob/anbob
anbob@ORCL> alter table testspace move tablespace anbob;
Table altered.
目前这篇文章有1条评论(Rss)评论关闭。