Opening the Database with the RESETLOGS Option

本文介绍如何在Oracle数据库中使用RESETLOGS选项来打开数据库,特别是在进行不完整恢复或使用备份控制文件恢复之后。文章详细解释了RESETLOGS选项的作用,包括归档当前在线重做日志、重置日志序列号、创建新的数据库化身等关键步骤。
导读:




Opening the Database with the RESETLOGS Option


Whenever
you perform incomplete recovery or recovery with a backup control file,
you must reset the online logs when you open the database. The new
version of the reset database is called a new incarnation.


This section contains the following topics:





About Opening with the RESETLOGS Option


The RESETLOGS option is always required after incomplete media recovery or recovery using a backup control file. Resetting the redo log does the following:



  • Archives the current online redo logs (if they are accessible) and
    then erases the contents of the online redo logs and resets the log
    sequence number to 1. For example, if the current online redo logs are
    sequence 1000 and 1001 when you open RESETLOGS, then the database archives logs 1000 and 1001 and then resets the online logs to sequence 1 and 2.



  • Creates the online redo log files if they do not currently exist.



  • Reinitializes the control file metadata about online redo logs and redo threads.



  • Updates all current datafiles and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp.



Because the database will not apply an archived log to a datafile unless the RESETLOGS SCN and time stamps match, the RESETLOGS
prevents you from corrupting datafiles with archived logs that are not
from direct parent incarnations of the current incarnation.


In prior releases, it was recommended that you back up the database immediately after the RESETLOGS. Because you can now easily recover a pre-RESETLOGS
backup like any other backup, making a new database backup is optional.
In order to perform recovery through resetlogs you must have all
archived logs generated since the last backup and at least one control
file (current, backup, or created).


Figure 18-1
shows the case of a database that can only be recovered to log sequence
2500 because an archived redo log is missing. When the online redo log
is at sequence 4000, the database crashes. You restore the sequence
1000 backup and prepare for complete recovery. Unfortunately, one of
your archived logs is corrupted. The log before the missing log
contains sequence 2500, so you recover to this log sequence and open RESETLOGS. As part of the RESETLOGS, the database archives the current online logs (sequence 4000 and 4001) and resets the log sequence to 1.


You generate changes in the new incarnation of the database,
eventually reaching log sequence 4000. The changes between sequence
2500 and sequence 4000 for the new incarnation of the database are
different from the changes between sequence 2500 and sequence 4000 for
the old incarnation. You cannot apply logs generated after 2500 in the old incarnation to the new incarnation, but you can apply the logs generated before sequence 2500 in the old incarnation to the new incarnation. The logs from after sequence 2500 are said to be orphaned in the new incarnation because they are unusable for recovery in that incarnation.



Figure 18-1 Creating a New Database Incarnation




Description of "Figure 18-1 Creating a New Database Incarnation"







Executing the ALTER DATABASE OPEN Statements


To preserve the log sequence number when opening a database after media recovery, execute either of the following statements:


ALTER DATABASE OPEN NORESETLOGS;
ALTER DATABASE OPEN;


To reset the log sequence number when opening a database after
recovery and thereby create a new incarnation of the database, execute
the following statement:


ALTER DATABASE OPEN RESETLOGS;


If you open with the RESETLOGS option, the database
returns different messages depending on whether recovery was complete
or incomplete. If the recovery was complete, then the following message
appears in the alert_SID.log file:


RESETLOGS after complete recovery through change scn


If the recovery was incomplete, then this message is reported in the alert_SID.log file, where scn refers to the end point of incomplete recovery:


RESETLOGS after incomplete recovery UNTIL CHANGE scn


If you attempt to OPEN RESETLOGS when you
should not, or if you neglect to reset the log when you should, then
the database returns an error and does not open the database. Correct
the problem and try again.



See Also:


"About User-Managed Media Recovery Problems" for descriptions of situations that can cause ALTER DATABASE OPEN RESETLOGS to fail





Checking the Alert Log After a RESETLOGS Operation



After opening the database with the RESETLOGS option, check the alert_SID.log
to see whether the database detected inconsistencies between the data
dictionary and the control file, for example, a datafile that the data
dictionary includes but which is not listed in the new control file.
The following table describes two possible scenarios.




















Control FileData DictionaryResult
Datafile is listedDatafile is not listedReferences to the unlisted datafile are removed from the control file. A message in the alert log indicates what was found.
Datafile is not listedDatafile is listedThe database creates a placeholder entry in the control file under MISSINGnnnnn (where nnnnn is the file number in decimal). MISSINGnnnnn is flagged in the control file as offline and requiring media recovery. You can make the datafile corresponding to MISSINGnnnnn accessible by using ALTER DATABASE RENAME FILE for MISSINGnnnnn so that it points to the datafile. If you do not have a backup of this datafile, then drop the tablespace.

本文转自

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/osrecov009.htm
已经博主授权,源码转载自 https://pan.quark.cn/s/053f1da40351 在计算机科学领域,MIPS(Microprocessor without Interlocked Pipeline Stages)被视作一种精简指令集计算机(RISC)的架构,其应用广泛存在于教学实践和嵌入式系统设计中。 本篇内容将深入阐释MIPS汇编语言中涉及数组处理的核心概念与实用操作技巧。 数组作为一种常见的数据结构,在编程中能够以有序化的形式储存及访问具有相同类型的数据元素集合。 在MIPS汇编语言环境下,数组通常借助内存地址与索引进行操作。 以下列举了运用MIPS汇编处理数组的关键要素:1. **数据存储**: - MIPS汇编架构采用32位地址系统,从而能够访问高达4GB的内存容量。 - 数组元素一般以连续方式存放在内存之中,且每个元素占据固定大小的字节空间。 例如,针对32位的整型数组,其每个元素将占用4字节的存储空间。 - 数组首元素的地址被称为基地址,而数组任一元素的地址可通过基地址加上元素索引乘以元素尺寸的方式计算得出。 2. **寄存器运用**: - MIPS汇编系统配备了32个通用寄存器,包括$zero, $t0, $s0等。 其中,$zero寄存器通常用于表示恒定的零值,$t0-$t9寄存器用于暂存临时数据,而$s0-$s7寄存器则用于保存子程序的静态变量或参数。 - 在数组处理过程中,基地址常被保存在$s0或$s1寄存器内,索引则存储在$t0或$t1寄存器中,运算结果通常保存在$v0或$v1寄存器。 3. **数组操作指令**: - **Load/Store指令**:这些指令用于在内存与寄存器之间进行数据传输,例如`lw`指令用于加载32位数据至寄存器,`sw`指令...
根据原作 https://pan.quark.cn/s/cb681ec34bd2 的源码改编 基于Python编程语言完成的飞机大战项目,作为一项期末学习任务,主要呈现了游戏开发的基本概念和技术方法。 该项目整体构成约500行代码,涵盖了游戏的核心运作机制、图形用户界面以及用户互动等关键构成部分。 该项目配套提供了完整的源代码文件、相关技术文档、项目介绍演示文稿以及运行效果展示视频,为学习者构建了一个实用的参考范例,有助于加深对Python在游戏开发领域实际应用的认识。 我们进一步研究Python编程技术在游戏开发中的具体运用。 Python作为一门高级编程语言,因其语法结构清晰易懂和拥有丰富的库函数支持,在开发者群体中获得了广泛的认可和使用。 在游戏开发过程中,Python经常与Pygame库协同工作,Pygame是Python语言下的一款开源工具包,它提供了构建2D游戏所需的基础功能模块,包括窗口系统管理、事件响应机制、图形渲染处理、音频播放控制等。 在"飞机大战"这一具体游戏实例中,开发者可能运用了以下核心知识点:1. **Pygame基础操作**:掌握如何初始化Pygame环境,设定窗口显示尺寸,加载图像和音频资源,以及如何启动和结束游戏的主循环流程。 2. **面向对象编程**:游戏中的飞机、子弹、敌人等游戏元素通常通过类的设计来实现,利用实例化机制来生成具体的游戏对象。 每个类都定义了自身的属性(例如位置坐标、移动速度、生命值状态)和方法(比如移动行为、碰撞响应、状态更新)。 3. **事件响应机制**:Pygame能够捕获键盘输入和鼠标操作事件,使得玩家可以通过按键指令来控制飞机的移动和射击行为。 游戏会根据这些事件的发生来实时更新游戏场景状态。 4. **图形显示与刷新**:...
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值