Oracle undo 表空间数据文件丢失强制启动数据库(没有未提交的事务)

发布时间:2020-08-11 13:01:25 作者:东北胖子
来源:ITPUB博客 阅读:170

环境:RHEL 6.5   Oracle 11.2.0.3


如果有RMAN备份的话,如果恢复数据文件就可以完成,本次我们测试在没有备份的情况下如何拉起数据库


[oracle@test-db orcl]$ mv undotbs02.dbf undotbs02.dbf_bak
SYS@orcl> startup
ORACLE instance started.
Total System Global Area  784998400 bytes
Fixed Size                  2232472 bytes
Variable Size             591400808 bytes
Database Buffers          188743680 bytes
Redo Buffers                2621440 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/oradata/orcl_data/orcl/undotbs02.dbf'



ALTER DATABASE OPEN
Errors in file /u01/app/oracle/diag/rdbms/primary_orcl/orcl/trace/orcl_dbw0_2532.trc:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/oradata/orcl_data/orcl/undotbs02.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Block change tracking file is current.
Errors in file /u01/app/oracle/diag/rdbms/primary_orcl/orcl/trace/orcl_ora_2621.trc:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/oradata/orcl_data/orcl/undotbs02.dbf'
ORA-1157 signalled during: ALTER DATABASE OPEN...
Sun Jan 13 15:32:08 2019
Checker run found 1 new persistent data failures



###########################################################################

开始强制拉起数据库


SYS@orcl> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SYS@orcl> startup mount;
ORACLE instance started.
Total System Global Area  784998400 bytes
Fixed Size                  2232472 bytes
Variable Size             591400808 bytes
Database Buffers          188743680 bytes
Redo Buffers                2621440 bytes
Database mounted.


SYS@orcl> alter database datafile 7 offline drop;
Database altered.
SYS@orcl> alter database open;
Database altered.


SYS@orcl> create undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/orcl_data/orcl/undotbs1.dbf' size 500m ;
Tablespace created.
SYS@orcl> show parameter undo
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS2
SYS@orcl> alter system set undo_tablespace='UNDOTBS1' scope=spfile;
System altered.


SYS@orcl> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@orcl> startup
ORACLE instance started.
Total System Global Area  784998400 bytes
Fixed Size                  2232472 bytes
Variable Size             591400808 bytes
Database Buffers          188743680 bytes
Redo Buffers                2621440 bytes
Database mounted.
Database opened.
SYS@orcl> show parameter undo
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1
SYS@orcl>


总结:

这是最简单的一种情况下恢复undo表空间丢失的情况,也是很容易的。

 直接  offile 相关数据文件,打开数据库重新创建UNDO表空间并默认为数据库默认表空间

推荐阅读:
  1. Oracle之体系结构详解,基本操作管理及客户端远程连接
  2. Oracle12C基本管理(持续更新)

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

undo 丢失 强制

上一篇:理解SSL必须要理解的密码技术

下一篇:MyCat分库分表--实战01--垂直分库

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》