`

ResetLogs介绍(译)

阅读更多
目录

1 概述
2 运用场合
3 作用
4在RMAN中OPEN RESETLOGS与SQLPLUS中OPEN RESETLOGS的区别
5在重建控制文件的时候使用ResetLog


1 概述

      The primary function of resetlogs is to discard the redo that was not applied during incomplete recovery, ensuring that the skipped redo can never be accidentally applied by a subsequent recovery. To accomplish this, resetlogs effectively invalidates all existing redo in all online and archived redo logfiles. This has the side effect of making any existing datafile backups unusable for future recovery operations.Resetlogs also reinitializes the controlfile information about online logs and redo threads, clears the contents of any existing online redo log files, creates the online redo log files if they do not currently exist, and resets the log sequence number in all threads to one.
  resetlogs的主要功能是在不完全恢复过程中忽略不可用的重做日志,确保略过的日志不影响接下来的恢复。resetlogs把所有存在于在线或归档的日志文件中的重做信息都置为不可用。这带来一个副作用,使得已存在的数据文件备份对将来的数据恢复不再是安全可用的了。resetlogs同时还会:重新初使化控件文件中的在线日志信息及重做日志线程、清除已存在的重做日志文件、若重做日志不存在则创建日志文件、重置所有线程中的日志序号为1。

2 运用场合

以下条件需要使用resetlog
1)在不完全恢复(介质恢复)
2)使用备份控制文件(backup的控制文件一般从日志文件和数据库的信息以及SCN的信息,相比目前的状态都已经过期了)

3 ResetLog的作用

(1)将重做日志的序列号设为1
(2)一般以该子句打开数据库后,要立即备份数据库,因为这个子句会使数据库以前的备份不能用.
(3)在重做日志当前日志组出现错误时,要以该子句打开数据库.该子句会重新设置重做日志文件的状态.
(4)让数据库系统归档初始化,重新生成归档文件.

4在RMAN中OPEN RESETLOGS与SQLPLUS中OPEN RESETLOGS的区别

1) If you run the RMAN command (not the SQL statement) ALTER DATABASE OPEN RESETLOGS, then RMAN automatically creates a new database incarnation record in the recovery catalog. RMAN implicitly and automatically issues a RESET DATABASE command, which specifies that this new incarnation of the database is the current incarnation. RMAN associates all subsequent backups and log archiving done by the target database with the new database incarnation.

2) If you issue the SQL statement (not the RMAN command) ALTER DATABASE OPEN RESETLOGS, then RMAN does not automatically run a RESET DATABASE command. Hence, RMAN cannot access the recovery catalog because it cannot distinguish between a RESETLOGS command and an accidental restore of an old control file. To solve this problem, you must manually run the RESET DATABASE command in RMAN after executing the SQL statement ALTER DATABASE OPEN RESETLOGS.

The RESET DATABASE command updates the repository to indicate that the target database has been opened with the RESETLOGS option. In the rare situation in which you wish to restore backups of a prior incarnation of the database, use the RESET DATABASE TO INCARNATION key command to change the current incarnation to an older incarnation. For example, if you accidentally drop a table immediately after the most recent RESETLOGS, then you may want to
recover the database to just before the time of the most recent RESETLOGS and then open it with the RESETLOGS option, thereby creating a new incarnation.

5在重建控制文件的时候使用ResetLogs

create controlfile resetlogs/noresetlogs
  1)用noresetlogs重建控制文件时,控制文件中datafile Checkpoint SCN来自online logs中的Current log头

  2)用resetlogs重建控制文件时,控制文件中datafile Checkpoint SCN来自各数据文件头(Start SCN)。
分享到:
评论
2 楼 wallimn 2013-04-05  
在Oracle9之前,Resetlogs,会使之之前的归档日志不可用,也就是说之前做过的归档日志全部废掉了。好像10g不是这样了(请注意,我是说好像,具体记得不是很清楚)。
1 楼 flighting_sky 2013-04-02  
[size=xx-small]RESETLOGS会使得之前的备份不可用???这个有点不理解!!可以解释一下吗???[/size]

相关推荐

    Open resetlogs操作对Oracle数据库恢复的影响.pdf

    在这些情况下,Oracle数据库管理员常使用resetlogs选项打开数据库。resetlogs操作对于Oracle数据库的恢复会产生重大的影响,具体体现在数据库备份、恢复过程以及数据库形态(incarnation)的变化上。 首先,...

    在redolog都丢失的情况下,使用隐藏参数,尝试以open resetlogs的方式打开数据库.txt

    在redolog都丢失的情况下,使用隐藏参数,尝试以open resetlogs的方式打开数据库.txt

    Bug 18411339 Low performance or ORA-1220

    and lh.resetlogs_change# = di.resetlogs_change# and di.status = 'CURRENT' and lh.thread# is not null and lh.resetlogs_change# is not null and lh.resetlogs_time is not null group by lh....

    ORACLE DG日常运维手册

    下面将详细介绍这一过程中的具体步骤和技术要点。 #### 三、增量恢复的主要步骤 ##### 1. 在备用库上查找当前 SCN (System Change Number) 为了确定需要进行增量恢复的具体范围,首先需要获取备用库上的当前 SCN...

    oracle中FLASHBACK

    FLASHBACK DATABASE flashback data1base闪回到过去的某一时刻 闪回点之后的所有工作都将丢失 必须使用resetlogs创建新的场景并打开数据库(一旦resetlogs之后,将不能再闪回至resetlogs之前的时间点) .......

    备份与恢复测试

    本文主要介绍了Oracle数据库中备份与恢复的关键知识点,涵盖了从基础概念到具体操作的各个方面。通过对这些知识点的学习和理解,可以帮助数据库管理员更加高效地进行数据库的备份与恢复工作,有效提升数据安全性和...

    解决ORACLE联机日志文件无故全部消失问题

    下面,我们将详细介绍解决该问题的步骤。 故障描述 在启动测试数据库时,发现数据库无法启动,提示找不到联机日志文件。经检查,发现所有的联机日志文件都消失了。这个问题可能是由于某一次的 C 盘文件批量整理的...

    PS_ResetLogs:在重新生成日志文件之前,重置日志文件(可选),并通过电子邮件发送(可选)

    重置日志 什么是重置日志 Reset-Logs是一个小的实用程序,它接收一个日志文件(不能锁定),并且 [可选]以其他名称将其移至已存档状态 [可选]通过电子邮件将其发送到特定地址 使用[Optional]标头重新创建 ...

    Oracle9个_name介绍

    - 重建控制文件并以`resetlogs`方式打开数据库。 - 使用`nid`工具进行更改。 - **限制**:在创建数据库时,`db_name`的长度被限制为最多8个字符,尽管在Oracle 10g中创建时不会出现错误提示,但实际存储的字符长度...

    ORACLE日志丢失的恢复

    本文将围绕“Oracle日志丢失的恢复”这一主题,详细介绍如何处理日志文件丢失的情况,并提供具体的步骤和示例。 #### 一、切换当前日志到新的日志组 当发现某个日志组存在问题时,首先需要做的就是将当前的日志...

    oracle 备份

    Incarnation是指数据库的逻辑生存周期,即从创建或重置日志(Resetlogs)到下一次Resetlogs操作之间的时期。每次Resetlogs操作都会启动一个新的数据库Incarnation。这一概念对于理解RMAN备份集和恢复策略至关重要,...

    案例解决:一次oracle掉电的处理过程

    数据库在重启后尝试打开时,出现了ORA-01589错误,提示必须使用RESETLOGS或NORESETLOGS选项进行数据库打开。这通常意味着数据库在异常关闭后需要进行介质恢复(Media Recovery),并且日志文件的状态可能已经不一致...

    Oracle Recovery Tools-最新版(202407)

    主要功能: 1. Oracle 单个/批量坏块修复 2. Oracle 单个block标记为坏块 ...5. 修改文件头resetlogs scn 6. 修改文件头fuzzy标记 7. 不同文件之间数据块拷贝 8. 修改oracle进程内存中内容,常见使用于修改oracle scn等

    REDO文件block损坏的解决方法

    首先,需在Oracle参数文件中设置`_allow_resetlogs_corruption=true`,这一设置允许数据库在redo日志块损坏的情况下进行resetlogs操作。注意,此参数仅在特殊情况下使用,应谨慎操作。 #### 步骤2:数据库实例重启 ...

    oracle非归档模式丢失全部联机日志后的处理方法

    * 在使用隐含参数进行处理时,需要添加 _allow_resetlogs_corruption=TRUE 参数。 * 在打开数据库时,可能出现 ORA-00603 错误,可以通过多次重起数据库解决。 * 在处理过程中,需要多次重起数据库以解决错误。 ...

    Oracle Recovery Tools-202207版

    主要功能: 1. Oracle 单个/批量坏块修复 2. Oracle 单个block标记为坏块 ...5. 修改文件头resetlogs scn 6. 修改文件头fuzzy标记 7. 不同文件之间数据块拷贝 8. 修改oracle进程内存中内容,常见使用于修改oracle scn等

    rman备份与恢复实例

    - 当使用 resetlogs 选项进行操作时,会生成新的跟踪文件,这些文件记录了 resetlogs 操作的详细过程。 - **[3]** **不使用 resetlog trace 选项:** - 如果不希望在进行 resetlogs 操作时生成跟踪文件,则可以...

Global site tag (gtag.js) - Google Analytics