Home Database Mysql Tutorial RMAN 配置保留策略

RMAN 配置保留策略

Jun 07, 2016 pm 05:33 PM
or oracle database

RMAN保留策略关乎数据的完整性,因此事关重大,由用户定义的、基于用户数据恢复所能承受的容忍度来设置。也就是说根据恢复的需要

RMAN保留策略关乎数据的完整性,因此事关重大,由用户定义的、基于用户数据恢复所能承受的容忍度来设置。也就是说根据恢复的需要,用户需要保留几天的数据,或者说用户需要备份的保留几个副本,或者不需要设定保留策略。在生产环境中多数使用的是基于恢复窗口的保留策略,因此需要重点关注与理解其用法。最本文主要描述了RMAN下的三种保留策略方式。

1、什么是备份保留策略
    也就是说备份可以保留多久,需要保留多久的问题,,我们可以通过configure retention policy 来进行配置
    注意,保留策略是相对于恢复而言,也就是说根据恢复的需要来制定保留策略,比如需要恢复到3天以前,或是保留2个不同的副本
    Oracle支持三种保留策略,一个是基于恢复窗口的保留策略,一个是基于冗余的保留策略。一个是无保留策略,三种保留策略互斥,不可同时使用
    当备份保留策略启用后,已生成的备份满足保留策略之后,会被标记为过时,也就是说RMAN认为恢复已经不再需要用到这些备份
    可以通过report obsolete来查看当前数据库的过时的备份。以及使用delete obsolete来删除过时的备份
    对于过时的备份(备份集,镜像副本等),在未使用FRA的情形下,RMAN仅仅是对其加以标注,而不会真正删除这些过时的备份
    对于使用了FRA(闪回区)的情形,RMAN会自动地删除这些过时的备份以循环利用FRA空间。
    注意理解无效的备份或过时的备份,前者执行crosscheck之后,文件没有找到(被删除),后者指文件存在,但是根据保留策略恢复已不再需要用到
    保留策略的使用范围
        完全备份、level 0、控制文件备份
        对于数据文件镜像副本(copy方式),如果RMAN认为该副本不再需要,则可以被删除
        对于数据文件备份集,当在备份集内所有的数据文件为过时时,可以被删除
 

2、基于恢复窗口的保留策略
    该方式用于确保将数据库恢复到特定的时间点。比如需要恢复一周以内的数据,使用恢复窗口RECOVERY WINDOW OF 7 DAYS
    那么所有与恢复到最近7天的完全备份、增量备份、归档日志,都应当被保留,而且有可能7天以前的备份也需要保留
    比如系统中完整地备份是8天以前的,即便当前产生了新的完整备份,上次的完整备份也应当被保留,而不是说只要过了7天这些备份就不再需要
    配置恢复窗口保留策略:
        CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    对于上述配置,每一个数据文件、备份应当满足这个条件:SYSDATE - BACKUP CHECKPOINT TIME >= 7,在这之前的备份则是无效的。
    下面的恢复窗口分析示例图来自Backup and Recovery User's Guide
    恢复窗口分析示例1:

RMAN 配置保留策略

        恢复窗口为7天,数据库处于归档模式
        备份计划是每两周一次全备,分别是: January 1,January 15,January 29,February 12
        对于图中的情形,当前的时间点Jan 23,那么7天的恢复窗口则是Jan 16,要能够确保数据可以恢复到Jan 16,
        那么Jan 14的备份及archive log 500到log 850都应当被保留,Jan 1的备份是过时的

    恢复窗口分析示例2:   

RMAN 配置保留策略

        当前的时间位Jan 30,那么7天的恢复窗口是Jan 23,确保Jan 23可恢复则应当自上一次完整备份到Jan 23的archive log可用。
        即Jan 14的完整备份必须被保留,log 500到log 1150都必须全部被保留

更多详情见请继续阅读下一页的精彩内容:  

推荐阅读:

RMAN 配置归档日志删除策略

Oracle基础教程之通过RMAN复制数据库

RMAN备份策略制定参考内容

RMAN备份学习笔记

Oracle数据库备份加密 RMAN加密

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

What to do if the oracle can't be opened What to do if the oracle can't be opened Apr 11, 2025 pm 10:06 PM

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

How to read the oracle awr report How to read the oracle awr report Apr 11, 2025 pm 09:45 PM

An AWR report is a report that displays database performance and activity snapshots. The interpretation steps include: identifying the date and time of the activity snapshot. View an overview of activities and resource consumption. Analyze session activities to find session types, resource consumption, and waiting events. Find potential performance bottlenecks such as slow SQL statements, resource contention, and I/O issues. View waiting events, identify and resolve them for performance. Analyze latch and memory usage patterns to identify memory issues that are causing performance issues.

How to use triggers for oracle How to use triggers for oracle Apr 11, 2025 pm 11:57 PM

Triggers in Oracle are stored procedures used to automatically perform operations after a specific event (insert, update, or delete). They are used in a variety of scenarios, including data verification, auditing, and data maintenance. When creating a trigger, you need to specify the trigger name, association table, trigger event, and trigger time. There are two types of triggers: the BEFORE trigger is fired before the operation, and the AFTER trigger is fired after the operation. For example, the BEFORE INSERT trigger ensures that the age column of the inserted row is not negative.

See all articles