• 【Oracle】设置快速恢复区及reset快速恢复区


    快速恢复区
    概念
    是一个默认放置所有备份恢复操作有关文件的地方,包括:控制文件在线镜像、在线重做日志、归档日志、外来归档日志、控制文件镜像复制、数据文件镜像复制、RMAN备份片和闪回日志。
    如果启用的快速恢复区,它就成了RMAN备份默认的去处,无论是RMAN备份片、镜像复制、还是控制文件自动备份,只要没有在RMAN配置或则backup命令中指明路径就全部进入快速恢复区。

    快速恢复区由两个参数确定:

    SQL> show parameter db_recovery            

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

    db_recovery_file_dest:用于设置快速恢复区的路径。

    db_recovery_file_dest_size:用于设置快速恢复区的大小。

    注:设置快速恢复区要先设置大小,后设置路径。

    1、 设置快速恢复区路径大小4G,存储路径为/u01/app/oracle/fast_recovery_area

    SQL> alter system set db_recovery_file_dest_size=4G scope=spfile;
    
    System altered.
    
    
    SQL> alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' scope=spfile;
    
    System altered.
    
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area  830930944 bytes
    Fixed Size            2257800 bytes
    Variable Size          536874104 bytes
    Database Buffers      285212672 bytes
    Redo Buffers            6586368 bytes
    Database mounted.
    Database opened.
    SQL> 
    SQL> show parameter db_recovery;
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    db_recovery_file_dest                string     /u01/app/oracle/fast_recovery_area
    db_recovery_file_dest_size           big integer 4G

    2、 reset快速恢复区

    1)方法一:修改pfile参数文件

    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> create pfile from spfile;
    
    File created.
    
    
    SQL> !vi $ORACLE_HOME/dbs/initdrz.ora
    
    删除如下内容
    
    *.db_recovery_file_dest_size=4294967296
    *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
    
    SQL> create spfile from pfile;
    
    File created.
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area  830930944 bytes
    Fixed Size            2257800 bytes
    Variable Size          536874104 bytes
    Database Buffers      285212672 bytes
    Redo Buffers            6586368 bytes
    Database mounted.
    Database opened.
    SQL>    
    SQL> show parameter db_recovery
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    db_recovery_file_dest                string
    db_recovery_file_dest_size           big integer 0

    2)方法二:reset命令

    SQL> alter system reset db_recovery_file_dest_size scope=spfile sid='*';
    
    System altered.
    
    
    SQL> alter system reset db_recovery_file_dest scope=spfile sid='*';
    
    System altered.
    
    SQL> 
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area  830930944 bytes
    Fixed Size            2257800 bytes
    Variable Size          536874104 bytes
    Database Buffers      285212672 bytes
    Redo Buffers            6586368 bytes
    Database mounted.
    Database opened.
    SQL> 
    SQL> show parameter db_recovery
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    db_recovery_file_dest                string
    db_recovery_file_dest_size           big integer 0

    总结:从Oracle原理上来分析,直接修改参数文件不失为一种很好理解的方式,但reset语句修改,更方便。


  • 相关阅读:
    SEO网站优化10大要点
    三维翻动效果的jquery特效代码
    多款国外虚拟主机简单比较
    jquery同步调用ajax
    3D虚拟技术
    最简单jquery.ajax+php例子(对话框显示文本框输入内容),以小见大(初学手记)
    正则表达式学习博客
    关于XHTML头部声明,什么是DOCTYPE?
    Iframe高度自适应(兼容IE/Firefox、同域/跨域)
    3D立体产业链的发展现状和趋势
  • 原文地址:https://www.cnblogs.com/NextAction/p/7366643.html
Copyright © 2020-2023  润新知