我们先来看一下这个现象:

[oracle@djp ora12]$ pwd
/u01/app/oracle/oradata/ora12
[oracle@djp ora12]$ mv undotbs01.dbf undotbs01.dbfbak
这里,我们把unto表空间对应的数据文件作了一个更改,表面该文件已经丢失。
 
下面,我们使用SQL*Plus,进行对数据库的启动:
idle> conn / as sysdba
Connected to an idle instance.
idle> startup mount;
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2293880 bytes
Variable Size             469766024 bytes
Database Buffers          356515840 bytes
Redo Buffers                6529024 bytes
Database mounted.
idle> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/u01/app/oracle/oradata/ora12/undotbs01.dbf'
 
 
idle>
这时,发现启动失败。对于该现象, 我们可以进行如下的处理:
(1)设置undo_management为auto,由自动(auto)设置为手动(manual)。这因为,当设置为auto时,系统采用undo表空间管理回滚段,当设置manual时,系统使用回滚段。这里,相当于是禁用undo tablespace。
idle> alter system set undo_management = manual scope=spfile;
 
System altered.
 
idle>
(2)再次启动数据库,使用其生效
idle> shutdown immediate;
ORA-01109: database not open
 
 
Database dismounted.
ORACLE instance shut down.
idle> startup;
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2293880 bytes
Variable Size             444600200 bytes
Database Buffers          381681664 bytes
Redo Buffers                6529024 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/u01/app/oracle/oradata/ora12/undotbs01.dbf'
 
 
idle>
(3)对丢失的数据库文件进行一个离线删除,如下:
idle> alter database datafile '/u01/app/oracle/oradata/ora12/undotbs01.dbf'
  2  offline drop
  3  /
 
Database altered.
 
idle>
(4)打开数据库,并对undo tablespace重新创建。
idle> alter database open;
 
Database altered.
 
idle> drop tablespace undotbs
  2  /
 
Tablespace dropped.
 
idle> create undo tablespace undotbs
  2  datafile '/u01/app/oracle/oradata/ora12/undotbs01.dbf'
  3  size 100M
  4  autoextend on
  5  next 50M
  6  maxsize unlimited
  7  /
 
Tablespace created.
 
idle>
(5)再次设置undo_management为auto,并重启数据库:
idle> alter system set undo_management = auto scope=spfile
  2  /
 
System altered.
 
idle> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
idle> startup;
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2293880 bytes
Variable Size             469766024 bytes
Database Buffers          356515840 bytes
Redo Buffers                6529024 bytes
Database mounted.
Database opened.
idle> desc dba_objects;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(128)
 OBJECT_NAME                                        VARCHAR2(128)
 SUBOBJECT_NAME                                     VARCHAR2(128)
 OBJECT_ID                                          NUMBER
 DATA_OBJECT_ID                                     NUMBER
 OBJECT_TYPE                                        VARCHAR2(23)
 CREATED                                            DATE
 LAST_DDL_TIME                                      DATE
 TIMESTAMP                                          VARCHAR2(19)
 STATUS                                             VARCHAR2(7)
 TEMPORARY                                          VARCHAR2(1)
 GENERATED                                          VARCHAR2(1)
 SECONDARY                                          VARCHAR2(1)
 NAMESPACE                                          NUMBER
 EDITION_NAME                                       VARCHAR2(128)
 SHARING                                            VARCHAR2(13)
 EDITIONABLE                                        VARCHAR2(1)
 ORACLE_MAINTAINED                                  VARCHAR2(1)
 
idle>
到此,该问题成功解决。

最新文章

  1. HBA相关知识
  2. (转)深入浅出 妙用Javascript中apply、call、bind
  3. PHP面向对象 三大特性
  4. RDIFramework.NET V2.9版本 WinFom部分新增与修正的功能
  5. Git 一次性 pull push 所有的分支
  6. 安装uwsgi记录
  7. android图像处理系列之三--图片色调饱和度、色相、亮度处理
  8. java 自动装箱和自动拆箱
  9. C#上传图片和生成缩略图以及图片预览
  10. thinkphp之wampserver安装
  11. 移动UI自动化-Page Objects Pattern
  12. This compilation unit is not on the build path SVN
  13. RMI,RPC,SOAP对比分析
  14. python+opencv2相机位姿估计
  15. 前端面试题集锦及答案解析--HTML、 HTTP、web综合问题
  16. os模块 与 sys模块
  17. 【ARC102E】Stop. Otherwise...(容斥原理,动态规划)
  18. python魔法方法-属性访问控制
  19. Java代码里利用Fiddler抓包调试设置
  20. Linux进程内存分析和内存泄漏定位

热门文章

  1. Entityframework core 动态添加模型实体
  2. 源码安装mysql
  3. BZOJ 1026 【SCOI2009】 windy数
  4. JSON拾遗
  5. 对《重建中国.NET生态系统》评论贴的总结
  6. Realm Java的学习、应用、总结
  7. Linux C中结构体初始化
  8. Entity Framework 出现 "此 ObjectContext 实例已释放,不可再用于需要连接的操作" 的错误
  9. android服务之MP3播放(2)
  10. Collection中list集合的应用常见的方法