Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1134365
  • 博文数量: 276
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-24 20:31
文章分类

全部博文(276)

文章存档

2020年(1)

2015年(5)

2012年(2)

2011年(6)

2010年(7)

2009年(224)

2008年(31)

我的朋友

分类: Oracle

2009-08-07 11:39:46

恢复测试
数据库非正常关闭,有活动事务,回滚表空间的数据文件损坏
不使用recover datafile进行恢复
 
SQL> Shutdown abort;
#删除undo空间的数据文件
SQL> startup
ORACLE instance started.
Total System Global Area  704643072 bytes                                      
Fixed Size                  2006896 bytes                                      
Variable Size             184549520 bytes                                      
Database Buffers          511705088 bytes                                      
Redo Buffers                6381568 bytes                                      
Database mounted.
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: 'M:\WM\ UNDOTBS01.DBF'
SQL> shutdown abort
ORACLE instance shut down.
#修改pfile
*.undo_tablespace='UNDOTBS1'
*.undo_management='AUTO'
++++++++++++++++++++++++++++++++++++++>>>
*.undo_management='MANUAL'
*.undo_tablespace='SYSTEM'
*._CORRUPTED_ROLLBACK_SEGMENTS=(_SYSSMU1$,_SYSSMU2$,_SYSSMU3$,_SYSSMU4$,_SYSSMU5$,_SYSSMU6$,_SYSSMU7$,_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)

SQL> startup mount
ORACLE instance started.
Total System Global Area  704643072 bytes                                      
Fixed Size                  2006896 bytes                                      
Variable Size             184549520 bytes                                      
Database Buffers          511705088 bytes                                      
Redo Buffers                6381568 bytes                                      
Database mounted.
SQL> alter database datafile 'M:\WMS\UNDOTBS01.DBF' offline;
Database altered.
SQL> alter database datafile 'M:\WM\UNDOTBS02.DBF' offline;
Database altered.
SQL> alter database open;
Database altered.
SQL> select segment_name,tablespace_name,status from dba_rollback_segs;
SEGMENT_NAME                   TABLESPACE_NAME                STATUS
------------------------------ ------------------------------ ----------------
SYSTEM                         SYSTEM                         ONLINE
_SYSSMU1$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU2$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU3$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU4$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU5$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU6$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU7$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU8$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU9$                      UNDOTBS1                       NEEDS RECOVERY
_SYSSMU10$                     UNDOTBS1                       NEEDS RECOVERY
SEGMENT_NAME                   TABLESPACE_NAME                STATUS
------------------------------ ------------------------------ ----------------
_SYSSMU11$                     UNDOTBS1                       OFFLINE
_SYSSMU12$                     UNDOTBS1                       OFFLINE
_SYSSMU13$                     UNDOTBS1                       OFFLINE
_SYSSMU14$                     UNDOTBS1                       OFFLINE
_SYSSMU15$                     UNDOTBS1                       OFFLINE
_SYSSMU16$                     UNDOTBS1                       OFFLINE
_SYSSMU17$                     UNDOTBS1                       OFFLINE
_SYSSMU18$                     UNDOTBS1                       OFFLINE
19 rows selected.
SQL> drop rollback segment "_SYSSMU1$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU2$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU3$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU4$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU5$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU6$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU7$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU8$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU9$";
Rollback segment dropped.
SQL> drop rollback segment "_SYSSMU10$";
Rollback segment dropped.
SQL> select segment_name,tablespace_name,status from dba_rollback_segs;
SEGMENT_NAME                   TABLESPACE_NAME                STATUS
------------------------------ ------------------------------ ----------------
SYSTEM                         SYSTEM                         ONLINE
_SYSSMU11$                     UNDOTBS1                       OFFLINE
_SYSSMU12$                     UNDOTBS1                       OFFLINE
_SYSSMU13$                     UNDOTBS1                       OFFLINE
_SYSSMU14$                     UNDOTBS1                       OFFLINE
_SYSSMU15$                     UNDOTBS1                       OFFLINE
_SYSSMU16$                     UNDOTBS1                       OFFLINE
_SYSSMU17$                     UNDOTBS1                       OFFLINE
_SYSSMU18$                     UNDOTBS1                       OFFLINE
9 rows selected.
SQL> create undo tablespace undo2 datafile 'M:\wm\undo_2.dbf' size 10M;
Tablespace created.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
#修改pfile为
+++++++++++++++++++++
*.undo_management='auto'
*.undo_tablespace='undo2'
#*._CORRUPTED_ROLLBACK_SEGMENTS=(_SYSSMU1$,_SYSSMU2$,_SYSSMU3$,_SYSSMU4$,_SYSSMU5$,_SYSSMU6$,_SYSSMU7$,_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)
+++++++++++++++++++++
SQL> startup
ORACLE instance started.
Total System Global Area  704643072 bytes                                      
Fixed Size                  2006896 bytes                                      
Variable Size             184549520 bytes                                      
Database Buffers          511705088 bytes                                      
Redo Buffers                6381568 bytes                                      
Database mounted.
Database opened.
SQL> spool off
#分析所有对像,防止有坏的数据块
SQL> select 'analyze table '||table_name ||' validate structure cascade ' from dba_tables;
阅读(1295) | 评论(0) | 转发(0) |
0

上一篇:Undo数据文件offline

下一篇:MC/SG的配置

给主人留下些什么吧!~~