Flashback 技术是以Undo segment中的内容为基础的, 因此受限于UNDO_RETENTON参数。要使用flashback 的特性,必须启用自动撤销管
Flashback 技术是以Undo segment中的内容为基础的, 因此受限于UNDO_RETENTON参数。
要使用flashback 的特性,必须启用自动撤销管理表空间。
在Oracle 11g里又出了一个新特性:Oracle Flashback Data Archive.
FDA通过将变化数据另外存储到创建的闪回归档区(Flashback Archive)中,以和undo区别开来,
这样就可以为闪回归档区单独设置存储策略,使之可以闪回到指定时间之前的旧数据而不影响undo策略。
在Oracle 10g中, Flash back家族分为以下成员:
Flashback Database,
Flashback Drop,
Flashback Query(分Flashback Query,Flashback Version Query,
Flashback Transaction Query 三种)
和Flashback Table。
Oracle 11g中闪回新特性 :闪回归档
Oracle 11g Flashback Data Archive(闪回数据归档)
Oracle Flashback闪回机制
Oracle Flashback database
Flashback table快速恢复误删除的数据
Oracle 备份恢复:Flashback闪回
1 闪回恢复区(Flashback Recovery Area)
在oracle 9i中引入flashback查询,以便能在需要的时候查到过去某个时刻的一致性数据,
依赖于undo表空间存储的信息来闪回查询以前的版本,当然这个受限于undo表空间的大小,
以及保留策略。如果undo 被覆盖了就不能进行查询。
oracle10g中增强了闪回查询的功能,并且提供了将整个数据库回退到过去某个时刻的能力,
这是通过引入一种新的flashback log实现的。flashback log有点类似redo log,
只不过redo log将数据库往前滚,flashback log则将数据库往后滚。
为了保存管理和备份恢复相关的文件,oracle10g提供了一个叫做闪回恢复区(Flashback recovery area),
这个区域默认创建在oracle_base目录下。 可以将所有恢复相关的文件,
比如flashback log,archive log,backup set等,,放到这个区域集中管理。
1.1 设置闪回恢复区
闪回恢复区主要通过3个初始化参数来设置和管理:
db_recovery_file_dest:指定闪回恢复区的位置
db_recovery_file_dest_size:指定闪回恢复区的可用空间大小
db_flashback_retention_target:指定数据库可以回退的时间,单位为分钟,
默认1440分钟,也就是一天。当然,实际上可回退的时间还决定于闪回恢复区的大小,
因为里面保存了回退所需要的flash log。
所以这个参数要和db_recovery_file_dest_size配合修改。
SQL> ALTER SYSTEM SET db_recovery_file_dest_size=3g SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET db_recovery_file_dest=' D:/app/Administrator/flash_recovery_area ' SCOPE=BOTH;
System altered.
SQL> show parameter db_recovery_file_dest
NAME TYPE VALUE
--------------------------- ----------- ------------------------------
db_recovery_file_dest string D:/app/Administrator/flash_recovery_area
db_recovery_file_dest_size big integer 3852M
SQL> show parameter db_flashback
NAME TYPE VALUE
---------------------------- -------- ------------------------------
db_flashback_retention_target integer 1440
我们看到db_flashback_retention_target 默认是1440分钟,即24 小时,
需要注意的是该参数虽然未直接指定flash recovery area大小,但却受其制约,
举个例子假如数据库每天有10%左右的数据变动的话,如果该初始化参数值设置为1440,
则flash recovery area 的大小至少要是当前数据库实际容量的10%,
如果该初始化参数设置为2880,则flash recovery area 的大小就至少是数据库所占容量的20%。
修改该参数:
SQL>alter system set db_flashback_retention_target=2880 scope=both;
1.2 取消闪回恢复区
将db_recovery_file_dest参数设置为空,可以停用闪回恢复区。
如果已经启用flashback database,则不能取消闪回恢复区。
SQL> alter system set db_recovery_file_dest='';
alter system set db_recovery_file_dest=''
*
第 1 行出现错误:
ORA-02097: 无法修改参数, 因为指定的值无效
ORA-38775: 无法禁用恢复区 - 闪回数据库已启用
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount;
ORACLE 例程已经启动。
Total System Global Area 849530880 bytes
Fixed Size 1377896 bytes
Variable Size 637536664 bytes
Database Buffers 205520896 bytes
Redo Buffers 5095424 bytes
数据库装载完毕。
SQL> alter database flashback off;
数据库已更改。
SQL> alter database open;
数据库已更改。
SQL> alter system set db_recovery_file_dest='';
系统已更改。
SQL> show parameter db_recovery_file_dest

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
