- そのまま縮小しようとすると失敗する。
conn / as sysdba alter database datafile '/export/home/oracle/app/oracle/oradata/orcl/undotbs01.dbf' resize 100M; ERROR at line 1: ORA-03297: file contains used data beyond requested RESIZE value
- UNDO表領域名とデータファイルのパスを確認する。
col tablespace_name for a10 col file_name for a60 col mb for 999999 select tablespace_name,file_name,bytes/1024/1024 mb from dba_data_files order by tablespace_name; TABLESPACE FILE_NAME MB ---------- ------------------------------------------------------------ ------- CWMLITE /export/home/oracle/app/oracle/oradata/orcl/cwmlite01.dbf 20 DRSYS /export/home/oracle/app/oracle/oradata/orcl/drsys01.dbf 20 EXAMPLE /export/home/oracle/app/oracle/oradata/orcl/example01.dbf 149 INDX /export/home/oracle/app/oracle/oradata/orcl/indx01.dbf 25 ODM /export/home/oracle/app/oracle/oradata/orcl/odm01.dbf 20 SYSTEM /export/home/oracle/app/oracle/oradata/orcl/system01.dbf 470 TOOLS /export/home/oracle/app/oracle/oradata/orcl/tools01.dbf 10 UNDOTBS1 /export/home/oracle/app/oracle/oradata/orcl/undotbs01.dbf 10100 USERS /export/home/oracle/app/oracle/oradata/orcl/users01.dbf 32768 XDB /export/home/oracle/app/oracle/oradata/orcl/xdb01.dbf 47 10 rows selected.
- 一時的にUNDO表領域を UNDOTBS2 に切替える。
create undo tablespace UNDOTBS2 datafile '/export/home/oracle/app/oracle/oradata/orcl/undotbs02.dbf' size 10m; alter system set undo_tablespace = 'UNDOTBS2';
- UNDOTBS1 を作り直す。
drop tablespace UNDOTBS1; create undo tablespace UNDOTBS1 datafile '/export/home/oracle/app/oracle/oradata/orcl/undotbs01.dbf' size 100m reuse autoextend off;
- UNDO表領域を UNDOTBS1 に戻す。
alter system set undo_tablespace = 'UNDOTBS1';
- UNDOTBS2 を削除する。
drop tablespace UNDOTBS2 including contents cascade constraints;
!rm /export/home/oracle/app/oracle/oradata/orcl/undotbs02.dbf
確認環境: Oracle 9iR2 9.2.0.7.0 on Solaris 10