开启闪回

检查是否开启归档
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
检查flashback日志中最旧的SCN
SQL> select oldest_flashback_scn from v$flashback_database_log;
no rows selected
之前没有开过,则没有返回
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38759: Database must be mounted by only one instance and not open.


SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.


Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38709: Recovery Area is not enabled.
可以归档已经开了啊
但是报错说闪回区不可达,
SQL> show parameter recover_file_dest
没有内容,设置参数
SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.


Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
SQL> create pfile='/tmp/a.txt' from spfile;
File created.
SQL> exit
创建目录;
mkdir -p /u01/app/oracle/db_recover_flashback_file
在参数文件中增加参数
*.db_recovery_file_dest='/u01/app/oracle/db_recover_flashback_file';
再次启动
SQL> startup mount pfile='/tmp/a.txt'
ORA-19802: cannot use DB_RECOVERY_FILE_DEST without DB_RECOVERY_FILE_DEST_SIZE
增加参数
*.db_recovery_file_size=200M
SQL> startup pfile='/tmp/a.txt';
ORACLE instance started.


Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile='/tmp/a.txt';
File created.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
SQL> alter database flashback on;
Database altered.
SQL> alter database open;
Database altered.
设置成功;
总结:
在开启归档的时候,必须在mount状态下,不仅需要开启归档日志,还需要设置DB_RECOVERY_FILE_DEST和DB_RECOVERY_FILE_DEST_SIZE两个参数!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值