手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

undo 表空间损坏导致无法open

[日期:2013-07-31] 来源:Linux社区  作者:linusfay [字体:大 中 小]

undo 表空间损坏导致无法open

在数据库undo表空间文件损坏,或者undo表空间文件缺失的情况,无法打开数据库。

这两种情况都可以视为一种情况处理,解决方法一样。

启动数据库时 出现:

SQL> startup

Oracle instance started.

Total System Global Area  709836800 bytes
Fixed Size                  2231752 bytes
Variable Size            536871480 bytes
Database Buffers          167772160 bytes
Redo Buffers                2961408 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Process ID: 4098

Session ID: 1 Serial number: 5

可以很明显的看到,由于undo表空间损坏或丢失,导致无法打开。

解决思路很简单:新建一个undo表空间,然后将undo_tablespace指向新的undo表空间。但是,但是。。。新建表空间只能在数据库open状态下才能进行。

所以。。

因为oracle system 表空间还有回滚段,因为我们先可以让oracle使用回滚段打开数据库,然后就可以新建undo表空间了

解决思路:

1、将数据库启动到mount


2、alter system set undo_management=manual scope=spfile;

3、shutdown immediate

4 、startup 然后新建一个undo表空间 new_undotbsxx

5、修改undo_tablespace参数指向new_undotbsxx

6、记得 将undo_manageme参数修改回来。 alter system set undo_management=auto scope=spfile;

SQL> alter system set undo_management=manual scope=spfile;

System altered.

然后打开数据库---

SQL> startup
ORACLE instance started.

Total System Global Area  709836800 bytes
Fixed Size                  2231752 bytes
Variable Size            536871480 bytes
Database Buffers          167772160 bytes
Redo Buffers                2961408 bytes
Database mounted.
Database opened.

--已经顺利打开数据库

查看 --undo_management


NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      MANUAL
undo_retention                      integer    900
undo_tablespace                      string      UNDOTBS11


现在可以新建一个undo_tablespace 然后将undo_tablespace参数指向过去。


SQL> create undo tablespace undotbs11 datafile '/u01/app/oracle/oradata/orcl/undotbs11.dbf' size 100m;

Tablespace created.

--然后将undo_tablespace指向为刚刚新建的undo表空间

SQL> alter system set undo_tablespace=undotbs11 scope=spfile;

System altered.


--最后一定一定要记得把undo_management  给改回来

SQL> alter system set undo_management=auto scope=spfile;

System altered.

然后关闭数据库,再打开

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  709836800 bytes
Fixed Size                  2231752 bytes
Variable Size            536871480 bytes
Database Buffers          167772160 bytes
Redo Buffers                2961408 bytes
Database mounted.
Database opened.

--没有问题,可以将以前损坏的undo表空间数据文件删除了

SQL> drop tablespace undotbs1 including contents and datafiles;

Tablespace dropped.

推荐阅读:

[Oracle] 在没有备份的情况下undo损坏怎么办? http://www.linuxidc.com/Linux/2013-06/86143.htm

UNDO表空间失败的处理方法 http://www.linuxidc.com/Linux/2013-05/83974.htm

undo表空间故障和ORA-01548处理 http://www.linuxidc.com/Linux/2013-01/77748.htm

RAC下丢失undo表空间的恢复 http://www.linuxidc.com/Linux/2012-10/71709.htm

UNDO表空间备份恢复 http://www.linuxidc.com/Linux/2012-09/69953.htm

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

linux
相关资讯       undo表空间 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款