发布网友 发布时间:2022-04-08 02:06
共2个回答
懂视网 时间:2022-04-08 06:27
*db_recovery_file_dest参数为0时,不能设定flash_recovery_area参数* SQL> alter system set db_recovery_file_dest_size=2147483648 scope=spfile;
SQL> alter system set db_recovery_file_dest=‘/u01/app/oracle/flash_recovery_area‘ scope=spfile;
SQL> alter system set DB_FLASHBACK_RETENTION_TARGET=2880; (2 days) |
SQL> Startup mount exclusive;
SQL> alter database archivelog;
SQL> Alter database flashback on;
SQL> Alter database open; |
SQL> SELECT flashback_on, log_mode FROM gv$database;
SQL> SELECT estimated_flashback_size FROM gv$flashback_database_log;
$ ps -eaf | grep rvwr |
Alter database flashback on;
1.使用SQLPLUS
SQL> shutdown immediate;
SQL> startup mount exclusive;
SQL> flashback database to timestamp(sysdate-1);
SQL> alter database open resetlogs;
2.使用 RMAN
RMAN> FLASHBACK DATABASE TO TIME = TO_DATE(‘2002-12-10 16:00:00‘,‘YYYY-MM-DD HH24:MI:SS‘);
RMAN> FLASHBACK DATABASE TO SCN=23565;
RMAN> FLASHBACK DATABASE TO SEQUENCE=223 THREAD=1;
SQL> SELECT oldest_flashback_scn,oldest_flashback_time FROM V
- Determine the current flashback window:
SQL> select to_char(end_time,‘yyyy-mm-dd hh:miAM‘) end_timestamp, flashback_data, db_data, redo_data from v$flashback_database_stat where rownum=1;
SQL> ALTER TABLESPACE <ts_name> FLASHBACK {ON|OFF}
SQL> SELECT name, flashback_on 2 FROM v$tablespace;
Note
可以闪回到resetlogs之前的一个时间点
SQL> FLASHBACK DATABASE TO BEFORE RESETLOGS;
You cannot use Flashback Database in the following situations:
The control file has been restored or re-created.
闪回数据库的一些命令:
**闪回到指定的日期**
FLASHBACK DATABASE TO TIMESTAMP(to_data(‘2015.07.11 20:03:00‘,‘YYYY.MM.DD HH24:MI:SS‘));
**闪回到5分钟之前**
FLASHBACK DATABASE TO TIMESTAMP SYSDATE-(1/24/12);
FLASHBACK DATABASE TO BEFORE TIMESTAMP my_date;
**回退到过去的某个SCN点**
FLASHBACK DATABASE TO SCN my_scn;
FLASHBACK DATABASE TO BEFORE SCN my_scn;
**回退到某个Log Sequence号*
flashback database to sequence=223 thread=1;
**回退完成之后以resetlogs的方式打开数据库*
alter database open resetlogs;
**也可以创建一个恢复点*
CREATE RESTORE POINT before_changes;
FLASHBACK DATABASE TO RESTORE POINT before_changes;
闪回数据库
标签:
热心网友 时间:2022-04-08 03:35
闪回技术是为了使Oracle数据库从任何逻辑误操作中迅速地恢复。该技术首先以闪回查询 (Flashback Query)出现在Oracle 9i版本中,后来Oracle在10g中对该技术进行了全面扩展,提供了闪回数据库、闪回删除、闪回表、闪回事物及闪回版本查询等功能