【Oracle】Oracle开启和关闭闪回

2022/6/8 2:21:29

本文主要是介绍【Oracle】Oracle开启和关闭闪回,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

确保oracle处于归档状态:

SQL> select log_mode,flashback_on from v$database;

配置参数db_recovery_file_dest、db_recovery_file_size:

SQL> alter system set db_recovery_file_dest='/home/oracle/app/oracle';
​
System altered.
​
SQL> alter system set db_recovery_file_dest_size=16g;
​
System altered.
​
SQL> show parameter db_recovery_file
​
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /home/oracle/app/oracle
db_recovery_file_dest_size big integer 16G

开启闪回:

SQL> select flashback_on from v$database;
​
FLASHBACK_ON
------------------
NO
​
SQL> alter database flashback on;
​
Database altered.
​
SQL> select flashback_on from v$database;
​
FLASHBACK_ON
------------------
YES

关闭闪回:

SQL> select flashback_on from v$database;
​
FLASHBACK_ON
------------------
YES
​
SQL> alter database flashback off;
​
Database altered.
​
​
SQL> select flashback_on from v$database;
​
FLASHBACK_ON
------------------
NO

 

如果是oracle 10g,开启和关闭闪回,需要将数据库至于mount状态:

shutdown immediate
startup mount
alter database flashback off;
alter database open;


这篇关于【Oracle】Oracle开启和关闭闪回的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程