快速恢复区
概念
是一个默认放置所有备份恢复操作有关文件的地方,包括:控制文件在线镜像、在线重做日志、归档日志、外来归档日志、控制文件镜像复制、数据文件镜像复制、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语句修改,更方便。