Moh*_*ani 7 oracle oracle-11g rac
我们在两台不同的服务器上有 Oracle 11gR1 RAC 两个实例,新的 undo 表空间UNDOTBS20140508创建了 30G,我想删除旧的UNDOTBSX02,我做了以下操作:
CREATE UNDO TABLESPACE UNDOTBS20140508 DATAFILE '+DATA/....../UNDOTBS20140508' SIZE 20G;
ALTER SYSTEM SET UNDO_TABLESPACE = UNDOTBS20140508;
DROP TABLESPACE UNDOTBSX02 INCLUDING CONTENTS AND DATAFILES;
Run Code Online (Sandbox Code Playgroud)
尝试删除UNDOTBSX02 时,它显示以下错误:
Run Code Online (Sandbox Code Playgroud)Error starting at line : 13 in command - DROP TABLESPACE UNDOTBSX02 INCLUDING CONTENTS AND DATAFILES Error report - SQL Error: ORA-00604: error occurred at recursive SQL level 1 ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 57 ORA-30013: undo tablespace 'UNDOTBSX02' is currently in use 00604. 00000 - "error occurred at recursive SQL level %s" *Cause: An error occurred while processing a recursive SQL statement (a statement applying to internal dictionary tables). *Action: If the situation described in the next error on the stack can be corrected, do so; otherwise contact Oracle Support.
我检查了UNDOTBSX02是否有任何待处理的交易,它是空的。那么怎么掉呢?
注意:我不是 Oracle DBA,但我必须执行此任务。
错误消息意味着正在tablespace
使用,并且由于撤消tablespace
至关重要,tablespace
因此您需要首先使用以下命令将其关闭:
SELECT a.name,b.status , d.username , d.sid , d.serial#
FROM v$rollname a,v$rollstat b, v$transaction c , v$session d
WHERE a.usn = b.usn
AND a.usn = c.xidusn
AND c.ses_addr = d.saddr
AND a.name IN (
SELECT segment_name
FROM dba_segments
WHERE tablespace_name = 'UNDOTBSX02'
);
Run Code Online (Sandbox Code Playgroud)
然后使用以下命令杀死撤消表空间的 SID
alter system kill session 'SID,serial'; --change the values of sid and serial by the ones that being retrived from the previouse command
Run Code Online (Sandbox Code Playgroud)
现在你应该可以放弃它了。