(****使用闪回技术、首先要设置闪回恢复区)
设置快速恢复区的地址
SQL> alter system set db_recovery_file_dest='/u01/app/oracle/'scope=both;
System altered.
SQL>
设置快速恢复区的大小
SQL> alter system set db_recovery_file_dest_size=4G scope=both;
System altered
查看快速恢复区的状态
SQL> show parameter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/oracle/
db_recovery_file_dest_size big integer 4G
SQL>
{必须在归档模式下、而且关闭和开启数据库是在mount状态下}
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence 12
Next log sequence to archive 14
Current log sequence 14
查看数据库的闪回是否开启
SQL> select flashback_on from V$database;
FLASHBACK_ON
------------------
NO
SQL>
首先要开启数据库闪回
(1)要在mount状态下
SQL> alter database flashback on;
Database altered.
SQL>
启动到open下
SQL> alter database open;
Database altered.
查看闪回状态
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
SQL>
关闭闪回
(1)先关闭数据库 启动到mount状态
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 541068368 bytes
Database Buffers 289406976 bytes
Redo Buffers 2371584 bytes
Database mounted.
(2)关闭数据库闪回
SQL> alter database flashback off;
Database altered.
(3)数据库open
SQL> alter database open;
Database altered.
(4)查看数据库闪回状态
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
转载于:https://www.cnblogs.com/material/p/5998180.html