1、模拟误删undo表空间

rm -rf undotbs01.dbf

2、解决步骤

SQL> shutdown immediate
ORA-01116: error in opening database file 3
ORA-01110: data file 3: '/u01/app/oracle/oradata/PROD1/undotbs01.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 849530880 bytes
Fixed Size 1348244 bytes
Variable Size 499125612 bytes
Database Buffers 343932928 bytes
Redo Buffers 5124096 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/u01/app/oracle/oradata/PROD1/undotbs01.dbf'

SQL> alter database datafile 3 offline drop;

Database altered.

SQL> alter system set undo_management='MANUAL' scope=spfile;

System altered.

SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 849530880 bytes
Fixed Size 1348244 bytes
Variable Size 499125612 bytes
Database Buffers 343932928 bytes
Redo Buffers 5124096 bytes
Database mounted.
Database opened.

SQL> create pfile='/tmp/initPROD1.ora' from spfile;

File created.

SQL> shutdown immediate
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: '/u01/app/oracle/oradata/PROD1/undotbs01.dbf'

SQL> shutdown abort
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@edgzrip1-PROD1 PROD1]$ vi /tmp/initPROD1.ora   --添加如下一行

*._CORRUPTED_ROLLBACK_SEGMENTS=(_SYSSMU10_2490256178$,_SYSSMU9_3593450615$,  _SYSSMU8_1909280886$,_SYSSMU7_1924883037$,_SYSSMU6_2460248069$,_SYSSMU5_3787622316$,  _SYSSMU4_1455318006$,_SYSSMU3_2210742642$,_SYSSMU2_4228238222$,_SYSSMU1_3138885392$)

[oracle@edgzrip1-PROD1 PROD1]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Aug 21 23:06:00 2019

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup pfile='/tmp/initPROD1.ora';
ORACLE instance started.

Total System Global Area 849530880 bytes
Fixed Size 1348244 bytes
Variable Size 499125612 bytes
Database Buffers 343932928 bytes
Redo Buffers 5124096 bytes
Database mounted.
Database opened.
SQL> drop tablespace undotbs1 including contents and datafiles;

Tablespace dropped.

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PROD1/users01.dbf
/u01/app/oracle/oradata/PROD1/sysaux01.dbf
/u01/app/oracle/oradata/PROD1/system01.dbf
/u01/app/oracle/oradata/PROD1/example01.dbf

SQL> create undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/PROD1/undotbs01.dbf' size 100m;

Tablespace created.

SQL> show parameter undo

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> alter system set undo_tablespace='UNDOTBS1' scope=spfile;
alter system set undo_tablespace='UNDOTBS1' scope=spfile
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE is in use

SQL> shutdown immedaite
SP2-0717: illegal SHUTDOWN option
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@edgzrip1-PROD1 dbs]$ cp /tmp/initPROD1.ora .

SQL> create spfile from pfile;

File created.

SQL> startup force
ORACLE instance started.

Total System Global Area 849530880 bytes
Fixed Size 1348244 bytes
Variable Size 499125612 bytes
Database Buffers 343932928 bytes
Redo Buffers 5124096 bytes
Database mounted.
Database opened.

SQL> alter system set undo_tablespace='UNDOTBS1' scope=spfile;

System altered.

SQL> startup force
ORACLE instance started.

Total System Global Area 849530880 bytes
Fixed Size 1348244 bytes
Variable Size 499125612 bytes
Database Buffers 343932928 bytes
Redo Buffers 5124096 bytes
Database mounted.
Database opened.
SQL>

undo表空间丢失、损坏的更多相关文章

  1. UNDO表空间损坏导致数据库无法OPEN

    在数据库undo表空间文件损坏.或者undo表空间文件缺失的情况下.无法打开数据库. 这两种情况都能够视为一种情况处理,解决方法一样. 场景:在23:10的时候新建一个undo表空间undotbs02 ...

  2. 重建UNDO表空间遭遇ORA-01548

    今天开发那边的一套数据库的undo表空间不知道被谁设置成了自动扩展,然后所谓的屋漏偏逢连夜雨的是, 开发人员今天跑了一个很大的事物,然后直接后果就是undo表空间不断被扩展,直到把文件系统写爆了.没办 ...

  3. oracle的undo表空间

    undo表空间是Oracle特有的概念.undo表空间中会自动分配undo段,这些undo段用来保存事务中的DML语句的undo信息,也就是来保存数据在被修改之前的值.在rollback,实例恢复(回 ...

  4. 总结Oracle8i 的UNDO表空间损坏(ORA-01092及ORA-00600【4193】)情况下的数据库不完全恢复的经历

    服务器断电重启导致备份生产环境的恢复目录库无法进行启动,提示Ora-01092例程终止.强行断开连接 查看跟踪日志: Wed Jan 10 08:41:37 2018 Errors in file d ...

  5. 模拟数据库丢失undo表空间

    数据库无事务情况下丢失undo表空间数据文件 1. 查看当前undo表空间,并删除物理undo文件 SYS@userdata>show parameter undo_tablespace; NA ...

  6. UNDO表空间损坏,爆满,ORA-600[4194]/[4193]错误解决

    模拟手工删除UNDO表空间 在ORADATA 中把UNDOTBS01.DBF 删除 模拟启库 SQL> STARUP; * 第 1 行出现错误: ORA-01157: 无法标识/锁定数据文件 2 ...

  7. 如何删除回滚段状态为NEEDS RECOVERY的undo表空间

    环境:RHEL 6.4 + Oracle 11.2.0.4 背景:备份恢复的测试库在一次不完全恢复后,没有来及做有效的全备,又一次数据库故障导致数据库无法正常open. 只能离线部分数据文件打开数据库 ...

  8. Oracle备份恢复之无备份情况下恢复undo表空间

    UNDO表空间存储着DML操作数据块的前镜像数据,在数据回滚,一致性读,闪回操作,实例恢复的时候都可能用到UNDO表空间中的数据.如果在生产过程中丢失或破坏了UNDO表空间,可能导致某些事务无法回滚, ...

  9. [Oracle]理解undo表空间

    一.回退段介绍 在Oracle数据库中,当某个事物对数据进行修改时,Oracle首先将数据的原始值保存到一个回退段中.一个事物只能将它的回退信息保存到一个回退段中,而多个并行事物可以使用同一个回退段. ...

随机推荐

  1. C语言设计模式(命令模式)

    #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) typedef int (*parse_func)(const char *data,size_t len ...

  2. C函数 printf 拼接字符串

    C函数 printf 拼接字符串 从前学C语言,最常用的函数可能就是 printf 了,但是往往是这样: printf(年龄是:"%d",a); 由于不懂得怎么拼接字符串,有时候只 ...

  3. 企业级工作流解决方案(六)--微服务消息处理模型之与Abp集成

    身份认证传递 对于Abp比较熟悉的朋友应该对他里面的用户身份认证比较熟悉,他是通过实现微软提供的权限认证方式实现的,用户登录身份信息存储在System.Security.Claims.ClaimsPr ...

  4. CorelDRAW常用工具之手绘工具

    对于平面设计师来说,一个好用顺手的手绘工具是必不可少的,CorelDRAW的手绘工具能将手绘笔触转换成平滑的线条或者形状. 1.基础操作 CorelDRAW的手绘工具组包含手绘.2点线.贝塞尔.钢笔. ...

  5. mac中怎么完成移动硬盘分区这个操作

    移动硬盘在出厂时只有一个区,不方便我们存储和查阅文件,移动硬盘分区可以防止硬盘发生错误,以免造成资料丢失,也可以防止产生无用文件. 移动硬盘基本上都是用Windows系统进行分区的,但是现在很多人使用 ...

  6. vulnhub: DC 4

    信息收集: yurang@kali:~$ nmap -sn 192.168.76.1/24 Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-04 ...

  7. 对KVC和KVO的理解

    html { overflow-x: initial !important } :root { --bg-color: #ffffff; --text-color: #333333; --select ...

  8. Python判断是否为数字

    前言 Python isdigit()方法检测字符串是否只由数字组成. isdigit()方法语法: str.isdigit() 如果字符串只包含数字则返回 True 否则返回 False. 示例 x ...

  9. Meetings S 题解

    题目描述 题目链接 有两个牛棚位于一维数轴上的点 \(0\) 和 \(L\) 处.同时有 \(N\) 头奶牛位于数轴上不同的位置(将牛棚和奶牛看作点).每头奶牛 \(i\) 初始时位于某个位置 \(x ...

  10. LaTeX相关自学文档

    install-latex-guide-zh-cn: lshort-zh-cn: 百度网盘链接:https://pan.baidu.com/s/1cBv9Fu8KFaf0QFZ7_slxmw 提取码: ...