迅雷手机网游加速器:RMAN Catalog 和 Nocatalog 的区别 1

来源:百度文库 编辑:九乡新闻网 时间:2024/05/03 21:06:31
RMAN Catalog 和 Nocatalog 的区别 收藏
一.Nocatalog Nocatalog方式 就是用control file作为catalog,每一次备份都要往控制文件里面写好多备份信息,控制文件里面会有越来越多的备份信息。因此,当使用rman nocatalog方式备份时,备份controlfile是非常重要的。 由于nocatalog时利用controlfile存放备份信息,建议将Oracle参数文件中的CONTROL_FILE_RECORD_KEEP_TIME值加大(缺省为7天), 参数在$ORACLE_HOME/dbs/initSID.ora中,该参数control_file__record_keep_time设置备份信息保存时间,到规定时间就自动清除以前的备份信息。
SQL> show parameter controlNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time        integer     7control_files                        string      D:\APP\ADMINISTRATOR\ORADATA\Ocontrol_management_pack_access       string      DIAGNOSTIC+TUNINGSQL> alter system set control_file_record_keep_time=14 scope=both;系统已更改。SQL> select name,value,issys_modifiable from v$parameter where name='control_file_record_keep_time';NAME        VALUE      ISSYS_MOD--------------- ---------- ---------control_file_re   14         IMMEDIATE   二.Catalog Catalog 则必须要首先要创建目录备份数据库,建立恢复目录。示例如下: 1.创建Catalog所需要的表空间SQL>create tablespace rman_ts  datafile '/u01/oracle/oradata/ora10g/rmants.dbf'  size 20M; 2.创建RMAN用户并授权SQL>create user rman identified by rman default tablespace rman_ts quota unlimited on rman_ts;SQL>grant recovery_catalog_owner to rman;(grant connect to rman) 查看角色所拥有的权限: select * from dba_sys_privs where grantee='RECOVERY_CATALOG_OWNER';(RECOVER_CATALOG_OWNER,CONNECT,RESOURCE) 3.创建恢复目录oracle>rman catalog rman/rmanRMAN>create catalog tablespace rman_ts;RMAN>register database;(database是target database)database registered in recovery catalogstarting full resync of recovery catalogfull resync completeRMAN> connect target /; 以后要使用备份和恢复,需要连接到两个数据库中,命令:oracle>rman target / catalog rman/rman (第一斜杠表示target数据库,catalog表示catalog目录 rman/rman表示catalog用户名和密码)命令执行后显示:Recovery Manager: Release 10.2.0.1.0 - Production on Wed Dec 10 15:00:42 2008Copyright (c) 1982, 2005, Oracle.  All rights reserved.connected to target database: ORA10G (DBID=3988862108)connected to recovery catalog database 命令解释:Report schema              Report shema是指在数据库中需找schemaList backup                   从control读取信息Crosscheck backup       看一下backup的文件,检查controlfile中的目录或文件是否真正在磁盘上Delete backupset 24      24代表backupset 的编号, 既delete目录,也delete你的文件  RMAN 备份与恢复 实例http://blog.csdn.net/tianlesoftware/archive/2009/10/20/4699320.aspx Oracle Rman 命令详解(List report backup configure)http://blog.csdn.net/tianlesoftware/archive/2009/12/13/4976998.aspx 
注意,当使用rman nocatalog恢复时,数据库必须是处于“mount”状态的。而Oracle startup mount的前提条件是control必须存在。因此,你必须在恢复datafile之前先恢复controlfile。 使用rman catalog方式时,可以startup nomount然后restore controlfile;但使用rman nocatalog时,必须先用文件方式恢复controlfile。 下面对比一下rman nocatalog和rman catalog的恢复时的步骤,以便建立正确的备份策略(以下的恢复都是在online状态下的备份):rman nocatalog恢复:
1) 建立oracle运行环境(包括init或sp文件)
2) 文件方式恢复controlfile到init文件指定的位置
3) startup mount
4) rman,恢复datafile
5) alter database open resetlogsrman catalog恢复:
1) 建立oracle运行环境(包括init或sp文件)
2) rman ,restore controfile
3) alter database mount
4) rman, restore datafile
5) alter database open resetlogs可以看出,rman nocatalog备份时,必须用文件方式备份controlfile。 
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/tianlesoftware/archive/2010/06/02/5641763.aspx