码迷,mamicode.com
首页 > 数据库 > 详细

开启 oracle 的闪回功能

时间:2019-08-21 11:41:07      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:ota   star   log   over   string   关闭   pre   buffers   lte   

查看是否开启闪回

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO

查看是否配置了db_recover_file_dest

SQL> show parameter db_recovery

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest            string
db_recovery_file_dest_size       big integer 0

没有配置的话,先创建对应的目录,注意目录的权限和oracle数据库的一致

mkdir /u01/flashback
chown oracle:oinstall /u01/flashback
SQL> alter system set db_recovery_file_dest_size=30G scope=both;
SQL> alter system set db_recovery_file_dest='/u01/flashback'  scope=both;

System altered.

关闭 oracle

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

启动到 mount 状态

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size          2253664 bytes
Variable Size         905972896 bytes
Database Buffers      687865856 bytes
Redo Buffers            7319552 bytes
Database mounted.

开启 archeve log

SQL> alter database archivelog;

Database altered.

开启闪回功能

SQL> alter database flashback on;

Database altered.

启动数据库到 open 状态

SQL> alter database open;

Database altered.
SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES

开启 oracle 的闪回功能

标签:ota   star   log   over   string   关闭   pre   buffers   lte   

原文地址:https://www.cnblogs.com/xingyys/p/11387335.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!