配置oracle闪回数据库


select log_mode from v$database;             1-  确定数据库开启归档



LOG_MODE
------------
ARCHIVELOG


SQL> alter system set db_recovery_file_dest='/home/oracle/flash_recovery_area';
alter system set db_recovery_file_dest='/home/oracle/flash_recovery_area'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-19802: cannot use DB_RECOVERY_FILE_DEST without DB_RECOVERY_FILE_DEST_SIZE   

 2-创建闪回恢复区(先配置大小在配置目录)


SQL> show parameter db_reco


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


SQL> alter system set db_recovery_file_dest_size=8g;                


System altered.


SQL> alter system set db_recovery_file_dest='/home/oracle/flash_recovery_area';


System altered.

3-设置闪回保留时间
SQL> alter system set db_flashback_retention_target=240;     保存时间以分钟为单位,默认是一天


System altered.

4-停库
SQL> shutdown immediate;
Database closed.
Database dismounted.

ORACLE instance shut down.


SQL> startup mount
ORACLE instance started.


Total System Global Area  167772160 bytes
Fixed Size                  2019320 bytes
Variable Size              96469000 bytes
Database Buffers           67108864 bytes
Redo Buffers                2174976 bytes

Database mounted.

5-启动闪回日志记录

SQL> alter database flashback on;                


Database altered.
6-打开数据库

SQL> alter database open;


Database altered.


SQL> select flashback_on from v$database;


FLASHBACK_ON
------------------
YES
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值