What Happens When A Tablespace/Database Is Kept In Begin Backup Mode (Doc ID 469950.1)

Goal

This document explains in detail about what happens when a tablespace/datafile is kept in hot backup/begin backup mode.

Solution

To perform online/hot backup we have to put the tablespace in begin backup mode followed by copying the datafiles and then putting the tablespace to end backup.

In 8i, 9i we have to put each tablespace individually in begin/end backup mode to perform the online backup. From 10g onwards the entire database can be put in begin/end backup mode.

Make sure that the database is in archivelog mode

Example :

Performing a single tablespace backup

+ sql>alter tablespace system begin backup;

+ Copy the corresponding datafiles using appropriate O/S commands.

+ sql>alter tablespace system end backup;

Performing a full database backup (starting from 10g)

+ sql> alter database begin backup;

+ Copy all the datafiles using appropriate O/S commands.

+ sql> alter database end backup;

One danger in making online backups is the possibility of inconsistent data within a block. For example, assume that you are backing up block 100 in datafile users.dbf. Also, assume that the copy utility reads the entire block while DBWR is in the middle of updating the block. In this case, the copy utility may read the old data in the top half of the block and the new data in the bottom top half of the block. The result is called a fractured block, meaning that the data contained in this block is not consistent. at a given SCN.

Therefore oracle internally manages the consistency as below :

1.  The first time a block is changed in a datafile that is in hot backup mode, the entire block is written to the redo log files, not just the changed bytes. Normally only the changed bytes (a redo vector) is written. In hot backup mode, the entire block is logged the first time. This is because you can get into a situation where the process copying the datafile and DBWR are working on the same block simultaneously.

Lets say they are and the OS blocking read factor is 512bytes (the OS reads 512 bytes from disk at a time). The backup program goes to read an 8k Oracle block. The OS gives it 4k. Meanwhile -- DBWR has asked to rewrite this block. the OS schedules the DBWR write to occur right now. The entire 8k block is rewritten. The backup program starts running again (multi-tasking OS here) and reads the last 4k of the block. The backup program has now gotten an fractured block -- the head and tail are from two points in time.

We cannot deal with that during recovery. Hence, we log the entire block image so that during recovery, this block is totally rewritten from redo and is consistent with itself atleast. We can recover it from there.

2.  The datafile headers which contain the SCN of the last completed checkpoint are not updated while a file is in hot backup mode. This lets the recovery process understand what archive redo log files might be needed to fully recover this file.

To limit the effect of this additional logging, you should ensure you only place one tablepspace at a time in backup mode and bring the tablespace out of backup mode as soon as you have backed it up. This will reduce the number of blocks that may have to be logged to the minimum possible.

Try to take the hot/online backups when there is less / no load on the database, so that less redo will be generated.

时间: 2024-10-29 06:20:56

What Happens When A Tablespace/Database Is Kept In Begin Backup Mode (Doc ID 469950.1)的相关文章

How to recover a skipped tablespace after an incomplete recovery? (Doc ID 1561645.1)

APPLIES TO: Oracle Database - Enterprise Edition - Version 11.2.0.1 and laterOracle Database Cloud Schema Service - Version N/A and laterOracle Database Exadata Express Cloud Service - Version N/A and laterOracle Database Exadata Cloud Machine - Vers

RMAN RECOVER TABLE 功能是 Oracle Database 12c 的新增功能 (Doc ID 1521524.1)

RMAN RECOVER TABLE Feature New to Oracle Database 12c (Doc ID 1521524.1) APPLIES TO: Oracle Database Cloud Schema Service - Version N/A and laterOracle Database Exadata Cloud Machine - Version N/A and laterOracle Database Exadata Express Cloud Servic

ALERT: Setting RemoveIPC=yes on Redhat 7.2 Crashes ASM and Database Instances as Well as Any Application That Uses a Shared Memory Segment (SHM) or Semaphores (SEM) (Doc ID 2081410.1)

数据库实例自动crash并报ORA-27157.ORA-27300等错误 一.文档: ALERT: Setting RemoveIPC=yes on Redhat 7.2 Crashes ASM and Database Instances as Well as Any Application That Uses a Shared Memory Segment (SHM) or Semaphores (SEM) (Doc ID 2081410.1) In this Document Descri

使用Active Database Duplication创建跨平台Data Guard设置 (Windows/Linux) (Doc ID 881421.1)

Using Active Database Duplication to Create Cross Platform Data Guard Setup (Windows/Linux) (Doc ID 881421.1) APPLIES TO: Oracle Database Cloud Exadata Service - Version N/A and laterOracle Database Cloud Service - Version N/A and laterOracle Databas

Transportable tablespace on standby (Doc ID 788176.1)

APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.1 to 10.2.0.4 [Release 10.2]Oracle Database - Enterprise Edition - Version 10.2.0.5 to 10.2.0.5 [Release 10.2]Oracle Database Cloud Schema Service - Version N/A and laterOracle Databas

Oracle Database Release Update Introduction and FAQ (文档 ID 2285040.1)

Overview Beginning in July 2017, Oracle has transitioned to a more flexible and responsive strategy for the database software release process.  These changes only affect Database and Grid Infrastructure release 12.2 or later.  The primary goals of th

How to restore and recover a database from an RMAN backup. (Doc ID 881395.1)

APPLIES TO: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.2 [Release 10.1 to 11.2]Oracle Database - Enterprise Edition - Version 11.2.0.4 to 11.2.0.4 [Release 11.2]Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.

SLES 12: Database Startup Error with ORA-27300 ORA-27301 ORA-27303 While Starting using Srvctl (Doc ID 2340986.1)

APPLIES TO: Oracle Database - Enterprise Edition - Version 12.1.0.2 and laterLinux x86-64 SYMPTOMS 12.1 RAC database error while starting via srvctl, alert log showing database startup and further goes down 通过 srvctl 启动12.1 RAC数据库时出现错误,alert log显示dat

oracle redo 重做日志文件

以下易容翻译自oracle dba官方文档,不足之处还望指出. 管理重做日志文件 学习目标:1.解释重做日志文件的目的2.描述重做日志文件的结构3.学会控制日志切换与检查点4.多元化管理重做日志文件5.使用OMF管理重做日志文件 1.概念介绍:重做日志文件通过记录数据的所有改变情况对系统或介质故障提供恢复机制.1)重做日志文件以组的形式存在2)一个oracle数据库至少需要两组,每组至少有一文件3)在一组里的每一重做日志文件叫做成员The redo log files are used only