广告
返回顶部
首页 > 资讯 > 数据库 >Oracle undo 表空间数据文件丢失强制启动数据库(没有未提交的事务)
  • 498
分享到

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

2024-04-02 19:04:59 498人浏览 薄情痞子
摘要

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

环境:RHEL 6.5   oracle 11.2.0.3


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


  • 重命名UNDO表空间的数据文件


[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'


  • 根据提示信息数据 7  有问题,查看alert.log文件



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


  • 日志文件中也显示 7号数据文件找不到了


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

开始强制拉起数据库


  • 启动数据库至MOUNT状态


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.


  • 将 文件号为 7 的数据库文件offline 并 打开数据库


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


  • 创建新的UNDO表空间,并设置为数据库默认表空间


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表空间并默认为数据库默认表空间

您可能感兴趣的文档:

--结束END--

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

本文链接: https://www.lsjlt.com/news/48619.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作