Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The concept of Rman incremental backup and the setting of Block tracking

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Incremental backup of rman

Difference increment (Differential)

Back up all data blocks that have changed since a low-level or the same level backup, as the name suggests, that is, to prepare the differential data blocks since the previous backup

Cumulative increment (Cumulative)

Is to back up all data blocks that have changed since the nmur1 level (parent) or lower

How to shorten RMAN backup time when using incremental backup

Block ChangeTracking

Block ChangeTracking is a feature introduced in Oracle 10g. Block change tracking records the update information of each block in the data file, and this tracking information is stored in the tracking file. When block change tracking is started, RMAN uses the information in trackingfile to read only the changed block information, instead of scanning the entire data file, thus improving the performance of RMAN backup.

Block change tracking file is bitmap file.

Block change tracking is disabled by default. If incremental backup is used, it is recommended to enable block change tracking. When BCT is enabled, no additional maintenance operations are required.

The first level 0 incremental backup scans the entire datafile. Subsequent incremental backups use block change tracking file information and scan only the block that has been marked as change since the last backup.

The block change tracking file is for the entire database, and by default, change tracking file is created as an Oracle managed file in the directory specified by DB_CREATE_FILE_DEST. You can put it in another directory. Oracle does not recommend using rawdevice to store change tracking file. In the case of a RAC environment, the change tracking file must be placed on a shared device.

RMAN does not support backup and recovery of change tracking file. When the data detects that the changetracking file is invalid, it will reset changetracking file. If we restore the database, the database will also reset block change tracking and re-tracking.

The size of block change tracking file is related to the size of the database and the number of enabled threads of redo, and the size of tracking file varies according to the size of the database. It has nothing to do with the frequency of updates. Typically, in a single instance, about 1 to 30000 block of DB will put track. In the case of a RAC environment, multiply by threads.

The following factors can cause file to exceed estimates:

(1) in order to prevent trackingfile from taking up too much space, the initial value is 10m, and then increase 10m each time. If the database is close to 300g, then the trackingfile cannot be less than 10m, and if it is close to 600G, it cannot be less than 20m.

(2) each datafile needs to allocate at least 320k of space in the tracking file, so if there are a large number of small datafile, the change tracking file will be relatively large.

Enable Block Change Tracking

The database can be enabled with block change tracking in either open or mounted state.

1. Check DB_CREATE_FILE_DEST parameter configuration

The DB_CREATE_FILE_DEST parameter specifies the location of the default Oracle Managed datafiles.

When no DB_CREATE_ONLINE_LOG_DEST_n parameter is specified, this parameter can also be used as a

The default location of Oracle-managed control files and online redo logs.

SYS@hyyk > show parameter db_create_file_dest

If you use the file system directory as the default location, the directory must already exist and Oracle will not create it. And Oracle has sufficient permissions to operate on this directory. When using OMF management, each name of the generated file in this directory is unique, and this file is also known as Oracle-Manager file.

two。 Set up DB_CREATE_FILE_DEST

SYS@hyyk > alter system set db_create_file_dest ='/ u01 *

3. Verify the parameter

SYS@hyyk > show parameter db_create_file_dest

4. Enable Block change tracking

SYS@hyyk > alter database enable block change tracking

5. You can use the v$block_change_tracking view to view tracking startup.

Col status format a8

Col filename format a60

SYS@hyyk > select status, filename from v$block_change_tracking

Disable Block Change Tracking

SQL > alter database disable block change tracking

Change change tracking

You can use the alter database rename statement to modify the location of the change tracking file file, this command will update the information in the control file, the command must be executed under mount, if DB can not shutdown, then you can first disable, and then specify a new location to start, but this will lose the previous data in tracking file.

1. View the location of the current file

SQL > select status, filename from v$block_change_tracking

two。 If possible, close the database

SQL > shutdown immediate

If you can shut down the database, skip the following sql to continue

If it cannot be closed, execute the following SQL and ignore the steps that follow step 3.

SQL > alter database disable block changetracking

SQL > alter database enable block change tracking using file 'new_location'

Note: here you disable bct and change the bct location at startup. In this case, you will lose the contents of all bct files. The entire data file is scanned the next time a level 0 incremental backup is performed.

3. Move the change tracking file file to a new location at the operating system level. This is done under the premise of shutting down the database.

Mv / u01/app/oracle/oradata/hyyk/block_change_tracking.f / u01/ block_change_tracking.f

4. Start the database to the mount state and move the change tracking file location.

SQL > startup mount

SQL > alter database rename file'/ u01 to to / U01 / block_change_tracking.f';.

5. Open the database and verify

SQL > alter database open

SQL > select status, filename from v$block_change_tracking

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report