• Undo表空间数据文件损坏


       UNDO表空间数据文件和system表空间数据文件都是数据库的关键数据文件,如果损坏会导致sql执行失败,用户无法登录,甚至实例崩溃等。同样恢复UNDO表空间数据文件也必须在数据库mount状态下进行。

       数据库在运行过程中发现UNDO表空间数据文件损坏,此时是无法正常关闭数据库的:

    SQL> shutdown immediate;

    ORA-01122: database file 3 failed verification check

    ORA-01110: data file 3: '/u01/app/oracle/oradata/orcl/undotbs01.dbf'

    ORA-01210: data file header is media corrupt

       只能强制关闭数据库,再启动实例到mount状态下,利用备份恢复损坏的数据文件:

    步骤:

    A、          关闭数据库

    SQL> shutdown abort

    ORACLE instance shut down.

    B、           启动数据库到mount状态

    SQL> startup mount;

    C、           在RMAN中,执行restore命令还原UNDO表空间数据文件

    RMAN> restore datafile '/u01/app/oracle/oradata/orcl/undotbs01.dbf';

    Starting restore at 02-DEC-12

    using target database control file instead of recovery catalog

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID=18 device type=DISK

    channel ORA_DISK_1: starting datafile backup set restore

    channel ORA_DISK_1: specifying datafile(s) to restore from backup set

    channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dbf

    channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/full_ORCL_20121201_6_1.bak

    channel ORA_DISK_1: piece handle=/u01/app/oracle/backup/full_ORCL_20121201_6_1.bak tag=TAG20121201T193434

    channel ORA_DISK_1: restored backup piece 1

    channel ORA_DISK_1: restore complete, elapsed time: 00:00:08

    Finished restore at 02-DEC-12

    D、          在RMAN中,执行recover database 恢复数据文件。

    RMAN> recover database;

    Starting recover at 02-DEC-12

    using channel ORA_DISK_1

    starting media recovery

    media recovery complete, elapsed time: 00:00:00

    Finished recover at 02-DEC-12

    E、           打开数据库,恢复完成

    RMAN> alter database open;

            database opened

    如果在数据库启动时,发现UNDO表空间数据文件损坏,数据库只能启动到mount状态,其恢复方法相同。

     

  • 相关阅读:
    我cnblogs的主题
    Scala Error: error while loading Suite, Scala signature Suite has wrong version expected: 5.0 found: 4.1 in Suite.class
    Spark之路 --- Scala用JFreeChart画图表实例
    Spark之路 --- Scala IDE Maven配置(使用开源中国的Maven库)和使用
    Spark之路 --- Windows Scala 开发环境安装配置
    epoll函数
    Linux网络编程目录
    函数wait和waitpid
    会话
    进程组
  • 原文地址:https://www.cnblogs.com/liang545621/p/9406074.html
Copyright © 2020-2023  润新知