情景:前段时间测试丢失undo数据文件,rm删除的undo1 的表空间数据文件,并建了个undo2设为数据库默认,今天删除一个用户报错
SQL> drop user icme cascade;
drop user icme cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 2
ORA-00376: file 2 cannot be read at this time
ORA-01110: data file 2: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_6cgckx9x_.dbf'
SQL> select file_name,tablespace from dba_data_files;
select file_name,tablespace from dba_data_files
*
ERROR at line 1:
ORA-00904: "TABLESPACE": invalid identifier
SQL> select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------------------------------------
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_6cgckxds_.dbf USERS
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_6cgckx9p_.dbf SYSAUX
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_6cgckx9x_.dbf UNDOTBS1
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_6cgckx95_.dbf SYSTEM
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_6cgckxc7_.dbf EXAMPLE
/u01/app/oracle/oradata/ORCL/datafile/tt.dbf TT
+ASMDATA/asmts01.dbf ASMTS
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_tbs4_6cgcmnfg_.dbf TBS4
/u01/app/oracle/oradata/ORCL/datafile/tt1.dbf TT
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_tbs1_6okmoslq_.dbf TBS1
/u01/app/oracle/oradata/ORCL/datafile/undotbs2.dbf UNDOTBS2
11 rows selected.
SQL> drop tablespace undotbs1;
drop tablespace undotbs1
*
ERROR at line 1:
ORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping tablespace
SQL> select segment_name,status,tablespace_name from dba_rollback_segs;
SEGMENT_NAME STATUS TABLESPACE_NAME
------------------------------------------------------------ -------------------------------- ------------------------------------------------------------
SYSTEM ONLINE SYSTEM
_SYSSMU1$ NEEDS RECOVERY UNDOTBS1
_SYSSMU2$ NEEDS RECOVERY UNDOTBS1
_SYSSMU3$ NEEDS RECOVERY UNDOTBS1
_SYSSMU4$ NEEDS RECOVERY UNDOTBS1
_SYSSMU5$ NEEDS RECOVERY UNDOTBS1
_SYSSMU6$ NEEDS RECOVERY UNDOTBS1
_SYSSMU7$ NEEDS RECOVERY UNDOTBS1
_SYSSMU8$ NEEDS RECOVERY UNDOTBS1
_SYSSMU9$ NEEDS RECOVERY UNDOTBS1
_SYSSMU10$ NEEDS RECOVERY UNDOTBS1
SEGMENT_NAME STATUS TABLESPACE_NAME
------------------------------------------------------------ -------------------------------- ------------------------------------------------------------
_SYSSMU11$ ONLINE UNDOTBS2
_SYSSMU12$ ONLINE UNDOTBS2
_SYSSMU13$ ONLINE UNDOTBS2
_SYSSMU14$ ONLINE UNDOTBS2
_SYSSMU15$ ONLINE UNDOTBS2
_SYSSMU16$ ONLINE UNDOTBS2
_SYSSMU17$ ONLINE UNDOTBS2
_SYSSMU18$ ONLINE UNDOTBS2
_SYSSMU19$ ONLINE UNDOTBS2
_SYSSMU20$ ONLINE UNDOTBS2
21 rows selected.
SQL> ! ls /u01/app/oracle/oradata/ORCL/datafile/
o1_mf_example_6cgckxc7_.dbf o1_mf_system_6cgckx95_.dbf o1_mf_tbs4_6cgcmnfg_.dbf o1_mf_users_6cgckxds_.dbf temp2.tmp tt.dbf
o1_mf_sysaux_6cgckx9p_.dbf o1_mf_tbs1_6okmoslq_.dbf o1_mf_temp_6cgcv90w_.tmp tbsg1.gdbf tt1.dbf undotbs2.dbf
sql>alter system set undo_management=manual;
sql>create pfile from spfile;
sql>shutdown immediate
修改启动参数initorcl.ora
*._CORRUPTED_ROLLBACK_SEGMENTS =(_SYSSMU1$,_SYSSMU2$,_SYSSMU3$,_SYSSMU3$,_SYSSMU4$,_SYSSMU5$,_SYSSMU6$,_SYSSMU7$,_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)
或
*._offline_rollback_segments="_SYSSMU1$","_SYSSMU2$","_SYSSMU3$","_SYSSMU4$","_SYSSMU5$","_SYSSMU6$","_SYSSMU7$","_SYSSMU8$","_SYSSMU9$","_SYSSMU10$"
sql>starup pfile='xxx';
如果上面是配置的offline_rollback,就需要多做一下sql>drop rollback segment _SYSSMU[N]$;...
sql>drop tablespace undotbs1 including contents;
sql>drop user icme cascade;
完成
SQL> drop user icme cascade;
drop user icme cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 2
ORA-00376: file 2 cannot be read at this time
ORA-01110: data file 2: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_6cgckx9x_.dbf'
SQL> select file_name,tablespace from dba_data_files;
select file_name,tablespace from dba_data_files
*
ERROR at line 1:
ORA-00904: "TABLESPACE": invalid identifier
SQL> select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------------------------------------
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_6cgckxds_.dbf USERS
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_6cgckx9p_.dbf SYSAUX
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_6cgckx9x_.dbf UNDOTBS1
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_6cgckx95_.dbf SYSTEM
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_6cgckxc7_.dbf EXAMPLE
/u01/app/oracle/oradata/ORCL/datafile/tt.dbf TT
+ASMDATA/asmts01.dbf ASMTS
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_tbs4_6cgcmnfg_.dbf TBS4
/u01/app/oracle/oradata/ORCL/datafile/tt1.dbf TT
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_tbs1_6okmoslq_.dbf TBS1
/u01/app/oracle/oradata/ORCL/datafile/undotbs2.dbf UNDOTBS2
11 rows selected.
SQL> drop tablespace undotbs1;
drop tablespace undotbs1
*
ERROR at line 1:
ORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping tablespace
SQL> select segment_name,status,tablespace_name from dba_rollback_segs;
SEGMENT_NAME STATUS TABLESPACE_NAME
------------------------------------------------------------ -------------------------------- ------------------------------------------------------------
SYSTEM ONLINE SYSTEM
_SYSSMU1$ NEEDS RECOVERY UNDOTBS1
_SYSSMU2$ NEEDS RECOVERY UNDOTBS1
_SYSSMU3$ NEEDS RECOVERY UNDOTBS1
_SYSSMU4$ NEEDS RECOVERY UNDOTBS1
_SYSSMU5$ NEEDS RECOVERY UNDOTBS1
_SYSSMU6$ NEEDS RECOVERY UNDOTBS1
_SYSSMU7$ NEEDS RECOVERY UNDOTBS1
_SYSSMU8$ NEEDS RECOVERY UNDOTBS1
_SYSSMU9$ NEEDS RECOVERY UNDOTBS1
_SYSSMU10$ NEEDS RECOVERY UNDOTBS1
SEGMENT_NAME STATUS TABLESPACE_NAME
------------------------------------------------------------ -------------------------------- ------------------------------------------------------------
_SYSSMU11$ ONLINE UNDOTBS2
_SYSSMU12$ ONLINE UNDOTBS2
_SYSSMU13$ ONLINE UNDOTBS2
_SYSSMU14$ ONLINE UNDOTBS2
_SYSSMU15$ ONLINE UNDOTBS2
_SYSSMU16$ ONLINE UNDOTBS2
_SYSSMU17$ ONLINE UNDOTBS2
_SYSSMU18$ ONLINE UNDOTBS2
_SYSSMU19$ ONLINE UNDOTBS2
_SYSSMU20$ ONLINE UNDOTBS2
21 rows selected.
SQL> ! ls /u01/app/oracle/oradata/ORCL/datafile/
o1_mf_example_6cgckxc7_.dbf o1_mf_system_6cgckx95_.dbf o1_mf_tbs4_6cgcmnfg_.dbf o1_mf_users_6cgckxds_.dbf temp2.tmp tt.dbf
o1_mf_sysaux_6cgckx9p_.dbf o1_mf_tbs1_6okmoslq_.dbf o1_mf_temp_6cgcv90w_.tmp tbsg1.gdbf tt1.dbf undotbs2.dbf
sql>alter system set undo_management=manual;
sql>create pfile from spfile;
sql>shutdown immediate
修改启动参数initorcl.ora
*._CORRUPTED_ROLLBACK_SEGMENTS =(_SYSSMU1$,_SYSSMU2$,_SYSSMU3$,_SYSSMU3$,_SYSSMU4$,_SYSSMU5$,_SYSSMU6$,_SYSSMU7$,_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)
或
*._offline_rollback_segments="_SYSSMU1$","_SYSSMU2$","_SYSSMU3$","_SYSSMU4$","_SYSSMU5$","_SYSSMU6$","_SYSSMU7$","_SYSSMU8$","_SYSSMU9$","_SYSSMU10$"
sql>starup pfile='xxx';
如果上面是配置的offline_rollback,就需要多做一下sql>drop rollback segment _SYSSMU[N]$;...
sql>drop tablespace undotbs1 including contents;
sql>drop user icme cascade;
完成
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【专家有话说第五期】在不同年龄段,DBA应该怎样规划自己的职业发展?
墨天轮编辑部
1320次阅读
2025-03-13 11:40:53
Oracle RAC ASM 磁盘组满了,无法扩容怎么在线处理?
Lucifer三思而后行
790次阅读
2025-03-17 11:33:53
Oracle+Deepseek+Dify 实现数据库数据实时分析
bicewow
722次阅读
2025-03-06 09:41:49
【ORACLE】ORACLE19C在19.13版本前的一个严重BUG-24761824
DarkAthena
577次阅读
2025-03-04 14:33:31
Oracle避坑指南|同名表导出难题:如何精准排除指定用户下的表?
szrsu
552次阅读
2025-03-05 00:42:34
2月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
462次阅读
2025-03-13 14:38:19
Ogg23ai高手必看-MySQL Innodb Cluster跟oracle的亲密接触
曹海峰
461次阅读
2025-03-04 21:56:13
【ORACLE】char类型和sql优化器发生的“错误”反应
DarkAthena
411次阅读
2025-03-04 23:05:01
Oracle 如何修改 db_unique_name?强迫症福音!
Lucifer三思而后行
352次阅读
2025-03-12 21:27:56
Oracle DataGuard高可用性解决方案详解
孙莹
314次阅读
2025-03-26 23:27:33
热门文章
移除DataGuard Standby配置导致Primary启动失败
2023-08-17 21244浏览
使用dblink产生的”SELECT /*+ FULL(P) +*/ * FROM XXXXX P ” 解析
2023-06-20 20873浏览
Troubleshooting 'ORA-28041: Authentication protocol internal error' change password 12c R2 DB
2020-04-08 13573浏览
浅谈ORACLE免费数据库Oracle Database XE (Express Edition) 版
2018-10-31 7475浏览
High wait event ‘row cache mutex’ in 12cR2、19c
2020-08-14 5518浏览