加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

开启闪回

发布时间:2020-12-15 17:32:43 所属栏目:百科 来源:网络整理
导读:检查是否开启归档 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 da
检查是否开启归档 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两个参数!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读