区别:
(1) NOCATALOG方式就是用CONTROL FILE作为CATALOG,每一次备份都要往控制文件里面写好多备份信息,控制文件里面会有越来越多的备份信息,即RMAN的备份信息写在本地控制文件里面。
(2)若为CATALOG则必须要首先要创建目录备份数据库,建立恢复目录,即数据库的备份信息写到恢复目录里面。
当通过RMAN NOCATALOG方式备份ORACLE数据库,ORACLE使用CONTROLFILE存放RMAN的备份信息。因此,当使用RMAN NOCATALOG方式备份数据库时,一定要记得备份CONTROLFILE。
初始化参数CONTROL_FILE__RECORD_KEEP_TIME设置备份信息保存时间,到规定时间就自动清除以前的备份信息:
SQL> ALTER SYSEM SET CONTROL_FILE_RECORD_KEEP_TIME=7 SCOPE=SPFILE;
注意:
(1)当使用RMAN NOCATALOG恢复时,数据库必须是处于“MOUNT”状态的,即一定要先加载控制文件,不然RMAN找不到记录的备份信息。而ORACLE STARTUP MOUNT的前提条件是CONTROL必须存在。因此,你必须在恢复DATAFILE之前先恢复CONTROLFILE。
(2)使用RMAN CATALOG方式时,可以STARTUP NOMOUNT然后RESTORE CONTROLFILE;但使用RMAN NOCATALOG时,必须先用文件方式恢复CONTROLFILE。
SQL> show parameter control
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_file_record_keep_time integer
7
control_files string
/u01/app/oracle/oradata/ORCL/c
ontrol01.ctl, /u01/app/oracle/
oradata/ORCL/control02.ctl
control_management_pack_access string
DIAGNOSTIC+TUNING
SQL> alter system set control_file_record_keep_time=14 scope=both;
System altered.
SQL> select name,value,issys_modifiable from v$parameter where name='control_file_record_keep_time';
NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
ISSYS_MODIFIABLE
---------------------------
control_file_record_keep_time
14
IMMEDIATE
二.Catalog
Catalog 则必须要首先要创建目录备份数据库,建立恢复目录。示例如下:
1.创建Catalog所需要的表空间
SQL> alter session set container = hbhe;
Session altered.
SQL> create tablespace rman_ts datafile '/oradata/rmants.dbf' size 100M;
Tablespace created.
SQL> create user rman identified by rman default tablespace rman_ts quota unlimited on rman_ts;
User created.
SQL> grant recovery_catalog_owner,connect to rman;
Grant succeeded.
[oracle@db02 oradata]$ rman catalog rman/rman@FAS_DLS
Recovery Manager: Release 19.0.0.0.0 - Production on Fri Mar 18 17:45:53 2022
Version 19.14.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> connect target /;
connected to target database: ORCL (DBID=1610869203)
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
rman nocatalog恢复:
1) 建立oracle运行环境(包括init或sp文件)
2) 文件方式恢复controlfile到init文件指定的位置
3) startup mount
4) rman,恢复datafile
5) alter database open resetlogs
rman catalog恢复:
1) 建立oracle运行环境(包括init或sp文件)
2) rman ,restore controfile
3) alter database mount
4) rman, restore datafile
5) alter database open resetlogs
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle