对数据库重做control file时,resetlog和noresetlog的描述

本文详细解析了SQL中NORESETLOGS和RESETLOGS两个选项的区别与使用场景。NORESETLOGS在数据库启动时不清理在线日志,用于手动恢复数据库;而RESETLOGS则会清除在线日志,导致已记录的事务数据丢失,使用前需备份数据库。在控制文件中,日志序列号的修改对于恢复过程至关重要,所有数据文件必须在线以避免数据丢失。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(1)    NORESETLOGS

The NORESETLOGSoption does not clear the redo log files during startup and the online redologs to be used for recovery. Only used in scenario where MANUAL RECOVERY isstarted, CANCEL is used, and then RECOVER DATABASE is started.

 

使用noresetlog,在线日志不会被清除,而是用来恢复数据库。

2RESETLOGS

CAUTION: Never use RESETLOGS unlessnecessary.

注意:不必要的时候不要使用resetlogs选项

 

Once RESETLOGS is used then the redo logfiles cannot be used and any completed transactions in those redo logs arelost!!

一但使用了resetlogs,在线日志将不能被使用,里面记录重做事务数据将会丢失。

Before using the RESETLOGS option take anoffline backup of the database.

使用resetlogs之前先备份数据库。

 

The RESETLOGSoption clears all the online redo logs and modifies all the online data filesto indicate no recovery is needed. After resetting the redo logs none of theexisting log files or data file backups can be used.

使用resetlogs,在线日志将会被清除,所有数据文件被置为不需要恢复,原有的备份将无效。

In the control file, the log sequence number is modified,which is very important for recovery purposes. Therecovery will be applied only to the log files whose sequence number is greaterthan log sequence number in the control file. One has to be very cautious whenusing RESETLOGS option. It is important to remember that all datafiles must beonline otherwise they will become useless once the database is up。

在控制文件里,日志的序列号会被修改,这对于恢复来说是很重要的,数据库会需要恢复比控制文件记录数大的在线日志里的重做信息。使用resetlog命令要谨慎,所有的数据文件必须都处于在线状态,否则一旦数据库处于open状态后,offline的数据文件将不会被需要,数据会丢失。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值