切换undo的一些步骤和基本原则
SHOW PARAMETER UNDO;
create undo tablespace undo_x datafile 'E:\ORACLE\ORADATA\XIFENFEI\undo_xifenfei.dbf' size 10M autoextend on next 10M maxsize 30G;
SELECT a.tablespace_name, a.segment_name, b.ktuxesta, b.ktuxecfl, b.ktuxeusn || '.' || b.ktuxeslt || '.' || b.ktuxesqn trans FROM dba_rollback_segs a, x$ktuxe b WHERE a.segment_id = b.ktuxeusn AND a.tablespace_name = UPPER('&tsname') AND b.ktuxesta <> 'INACTIVE';
alter system set undo_tablespace='undo_x';
Sun Jun 17 20:10:45 2012 Successfully onlined Undo Tablespace 7. [36428] **** active transactions found in undo Tablespace 2 - moved to Pending Switch-Out state. [36428] active transactions found/affinity dissolution incompletein undo tablespace 2 during switch-out. ALTER SYSTEM SET undo_tablespace='undo_xifenfei' SCOPE=BOTH; Sun Jun 17 20:11:38 2012 [36312] **** active transactions found in undo Tablespace 2 - moved to Pending Switch-Out state. Sun Jun 17 20:16:15 2012 [36312] **** active transactions found in undo Tablespace 2 - moved to Pending Switch-Out state.
select tablespace_name,segment_name,status from dba_rollback_segs;
alter tablespace undotbs1 offline;
drop tablespace undotbs1 including contents and datafiles;
切换undo表空间一句话:新建undo几乎是任何时候都可以执行切换undo表空间命令,如果要删除历史undo需要等到该undo空间所有回滚段全部offline.千万别在尚有回滚段处于online状态,强制删除数据文件.