一臺開發機的空間不夠了,想挪也沒地方挪,檢查了一下,UNDOTBS01.DBF文件比較大了,有8個多G,決定重建一下回收。 原來的UNDO表空間名字是UNDOTBS1,DB版本是10G
1.新建一個新的UNDO表空間
C:\Documents and Settings\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 3月 28 14:59:37 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
鏈接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create undo tablespace undotbs2 datafile ‘E:\oracle\product\oradata\orcl\undotbs02.dbf’ size 10M
2.切換到新的UNDO
SQL> alter system set undo_tablespace=’UNDOTBS2′ scope=both;
System altered
3.檢查新的表空間
SQL> show parameter undo;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS2
SQL>
4.老的表空間OFFLINE
SQL> alter tablespace undotbs2 offline;
Tablespace altered
5.刪除老的表空間並檢查
SQL> drop tablespace undotbs2 including contents and datafiles;
Tablespace dropped
SQL> select tablespace_name,segment_name,status from dba_rollback_segs;
TABLESPACE_NAME SEGMENT_NAME STATUS
------------------------------ ------------------------------ ---------
SYSTEM SYSTEM ONLINE
UNDOTBS2 _SYSSMU19$ ONLINE
UNDOTBS2 _SYSSMU20$ ONLINE
UNDOTBS2 _SYSSMU21$ ONLINE
UNDOTBS2 _SYSSMU22$ ONLINE
UNDOTBS2 _SYSSMU23$ ONLINE
UNDOTBS2 _SYSSMU24$ ONLINE
UNDOTBS2 _SYSSMU25$ ONLINE
UNDOTBS2 _SYSSMU26$ ONLINE
UNDOTBS2 _SYSSMU27$ ONLINE
UNDOTBS2 _SYSSMU28$ ONLINE
已選擇11行。
6.刪除物理文件UNDOTBS01.DBF 7.其它說明 刪除物理文件時一開始沒有OFFLINE表空間,結果提示程序在用,這臺機子非生產機,重啓服務可刪除,至此空間回收,僅以此記。