重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3211|回复: 0
打印 上一主题 下一主题

[认证考试] OCP课程44:管理II之使用RMAN恢复目录

[复制链接]
跳转到指定楼层
楼主
发表于 2016-3-4 11:48:08 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

课程目标:

  • 对比使用恢复目录和控制文件管理rman备份记录
  • 创建和配置恢复目录
  • 注册数据库到恢复目录
  • 同步到恢复目录
  • 使用rman存储脚本
  • 备份恢复目录
  • 创建虚拟私有目录

1、对比使用恢复目录和控制文件管理rman备份记录


                               
登录/注册后可看大图

RMAN备份信息存储在数据库的控制文件中,也可以存储到一个称之为恢复目录的单独数据库中。

恢复目录在一个单独的数据库中保存备份信息,相比控制文件,可以保存更长的事件,可以存储多个数据库的备份信息,RMAN脚本等。

如果只是几个数据库简单的备份管理,Oracle建议使用控制文件进行管理,如果有很多数据库且需要保存备份较长时间,就可以使用恢复目录。


2、存储信息到恢复目录


                               
登录/注册后可看大图

在更新了rman备份记录之后或者某种操作之前,rman将数据库结构,归档日志,备份集和数据文件拷贝信息从目标数据库控制文件传送到恢复目录。


3、使用恢复目录的理由


                               
登录/注册后可看大图

如果使用控制文件作为唯一的rman备份信息仓库,受控制文件大小限制,存储的备份信息有限,则恢复的时间长度也就有限制,如果使用恢复目录,则可以存储更多的备份信息,恢复的时间长度也更长。

如果要使用rman存储的脚本,则必须使用恢复目录。

由于恢复目录集中管理了所有数据库的备份信息,则可以通过连接到恢复目录查询各种RC_视图创建定制化的备份报表信息。

在指定的保留策略外,可以使用BACKUP ... KEEP命令创建备份并指定备份保留多久。如果使用了恢复目录,还可以使用KEEP FOREVER语句指定备份或者拷贝永远不过期。

使用REPORT SCHEMA命令列出目标数据库的表空间和数据文件,如果使用了恢复目录,还可以加上AT [time/scn/logseq]选项查看过去某个时间的信息。


4、创建恢复目录:三步


                               
登录/注册后可看大图

创建恢复目录的三步:

(1)配置存储恢复目录的数据库

(2)创建恢复目录所有者

(3)创建恢复目录


5、配置恢复目录数据库


                               
登录/注册后可看大图

在安装恢复目录模式的数据库上为恢复目录模式分配空间,考虑如下需求:

  • 支持的数据库数量
  • 归档日志和备份的记录数量
  • 是否存储rman脚本

为恢复目录创建默认表空间:

SQL> create tablespace rcat_ts datafile size 15M;

Tablespace created.


6、创建恢复目录所有者


                               
登录/注册后可看大图

创建用户,指定默认表空间,不限制使用表空间,赋予RECOVERY_CATALOG_OWNER角色,包括如下系统权限:ALTERSESSION, CREATECLUSTER, CREATEDATABASELINK, CREATEPROCEDURE, CREATESEQUENCE, CREATESESSION, CREATESYNONYM, CREATETABLE, CREATETRIGGER, CREATETYPE, and CREATEVIEW.

SQL> create user rcowner identified by rcowner

  2  temporary tablespace temp

  3  default tablespace rcat_ts

  4  quota unlimited on rcat_ts;

User created.

SQL> grant recovery_catalog_owner to rcowner;

Grant succeeded.


7、创建恢复目录


                               
登录/注册后可看大图

使用rman的CREATE CATALOG命令创建恢复目录。

[oracle@oracletest ~]$ rman catalog rcowner/rcowner

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jan 7 08:37:08 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database

RMAN> create catalog;

recovery catalog created


8、在恢复目录中管理目标数据库记录


                               
登录/注册后可看大图

虽然大部分信息都是自动从控制文件传送到恢复目录,但还有一些操作需要手动执行,包括:

  • 在恢复目录中注册数据库
  • 注册额外的备份文件
  • 从恢复目录中取消注册数据库

9、在恢复目录中注册数据库


                               
登录/注册后可看大图

创建恢复目录后,需要在恢复目录中注册数据库,注册数据库rman执行如下操作:

  • 在恢复目录表中为目标数据库创建记录
  • 复制目标数据库控制文件数据到恢复目录表
  • 使用控制文件同步恢复目录

在恢复目录中注册数据库步骤如下:

(1)使用rman同时连接到目标数据库和恢复目录

% rman TARGET / CATALOG rman/rman@reccatdb

(2)确保目标数据库是mount或者open状态

(3)在rman中使用REGISTER DATABASE命令

[oracle@oracletest ~]$ rman target sys/123456@192.168.230.139:1521/stone catalog rcowner/rcowner

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jan 7 08:49:01 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete


10、使用EM注册数据库


                               
登录/注册后可看大图

如果只是在RMAN中使用REGISTER DATABASE注册了数据库,没有在EM中使用恢复目录注册数据库,则使用EM进行备份和恢复还是不会使用恢复目录。要在EM中使用恢复目录注册数据库,必须先将恢复目录增加到EM。具体步骤如下:


                               
登录/注册后可看大图


                               
登录/注册后可看大图


                               
登录/注册后可看大图


                               
登录/注册后可看大图


                               
登录/注册后可看大图


11、从恢复目录中取消注册数据库


                               
登录/注册后可看大图

从恢复目录中取消注册数据库,则该数据库的所有rman记录都会被删掉。一般情况下,只有在数据库不再使用了或者数据库不存在了再回去取消注册。如果使用了EM注册,则还需要在EM中取消注册。

[oracle@oracletest1 ~]$ rman target / catalog rcowner/rcowner@192.168.230.138:1521/stone

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jan 7 20:01:23 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

connected to recovery catalog database

RMAN> unregister database;

database name is "STONE" and DBID is 3003597140

Do you really want to unregister the database (enter YES or NO)? yes

database unregistered from the recovery catalog


12、增加备份文件到目录


                               
登录/注册后可看大图

不管有没有使用恢复目录,都可以使用CATALOG命令将控制文件、数据文件拷贝、备份集以及归档日志文件信息加入到恢复目录或者控制文件,即使这些备份已经过期,也可以加入进来用于还原操作。

增加备份文件、数据文件、归档文件级备份片的例子如下:

RMAN> CATALOG CONTROLFILECOPY '/disk1/controlfile_bkup/2009_01_01/control01.ctl';

RMAN> CATALOG DATAFILECOPY '/disk1/datafile_bkup/2009_01_01/users01.dbf';

RMAN> CATALOG ARCHIVELOG '/disk1/arch_logs/archive1_731.log',

'/disk1/arch_logs/archive1_732.log';

RMAN> CATALOG BACKUPPIECE '/disk1/backups/backup_820.bkp';

还可以catalog当前快速恢复区的所有文件:

RMAN> CATALOG RECOVERY AREA NOPROMPT;

可以使用start with选项指定搜索的目录或者目录前缀,但是不能使用通配符。

指定搜索目录的例子:

RMAN> CATALOG START WITH '/tmp/arch_logs/';

指定搜索目录前缀的例子:

RMAN> CATALOG START WITH '/tmp/bset';


13、恢复目录同步:概念


                               
登录/注册后可看大图

当rman执行重同步的时候,将目标数据库的控制文件与恢复目录进行比较,将控制文件中增加或者更新的信息同步到恢复目录。

重同步分2种:

  • 部分(Partial):将控制文件中的备份、归档日志及数据文件拷贝等数据与恢复目录进行比较并同步
  • 全部(Full):先创建一个控制文件快照,使用快照进行比较和同步,同时还包括数据库结构的改变,例如模式的改变或者新的表空间

如果由参数CONTROL_FILE_RECORD_KEEP_TIME管理控制文件改变的记录,则进行部分同步,否则进行全部同步,如果使用RESYNC CATALOG命令,也会执行全部同步。


14、手工同步恢复目录


                               
登录/注册后可看大图

在以下情况需要手工同步恢复目录:

  • 当使用rman命令引起自动重同步时恢复目录不可用的情况
  • 由于恢复目录不会在联机重做日志文件切换或者归档时自动更新,所以如果数据库备份不频繁的话,需要手工同步恢复目录
  • 在对目标数据库物理结构进行修改后

同步的记录包括:

  • 日志历史记录,联机重做日志切换产生的记录
  • 归档日志记录
  • 备份记录,包括备份集、备份片,镜像拷贝等
  • 模式记录,对应数据文件和表空间,如果目标数据库是open状态,还包括回滚段

[oracle@oracletest1 ~]$ rman target / catalog rcowner/rcowner@192.168.230.138:1521/stone

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jan 7 22:27:51 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

connected to recovery catalog database

RMAN> resync catalog;

starting full resync of recovery catalog

full resync complete


15、使用RMAN存储脚本


                               
登录/注册后可看大图

可以使用rman存储脚本,有2种类型:

Local:只能由创建该脚本的目标数据库执行

Global:任何注册到恢复目录的数据库都可以执行

[oracle@oracletest1 ~]$ rman target / catalog rcowner/rcowner@192.168.230.138:1521/stone

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jan 7 22:47:01 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

connected to recovery catalog database

RMAN> create script backuptbs_03

2> {backup datafile 15;}

created script backuptbs_03


16、执行RMAN存储的脚本


                               
登录/注册后可看大图

连接到目标数据库和恢复目录,在run块内使用EXECUTE SCRIPT命令执行脚本。

[oracle@oracletest1 ~]$ rman target / catalog rcowner/rcowner@192.168.230.138:1521/stone

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jan 7 22:57:09 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

connected to recovery catalog database

RMAN> run{execute script backuptbs_03;}

executing script: backuptbs_03

Starting backup at 07-JAN-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=60 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00015 name=+DATA/stone/datafile/tbs_03.277.900065973

channel ORA_DISK_1: starting piece 1 at 07-JAN-16

channel ORA_DISK_1: finished piece 1 at 07-JAN-16

piece handle=+FRA/stone/backupset/2016_01_07/nnndf0_tag20160107t225746_0.347.900543467 tag=TAG20160107T225746 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 07-JAN-16

Starting Control File and SPFILE Autobackup at 07-JAN-16

piece handle=+FRA/stone/autobackup/2016_01_07/s_900543469.334.900543471 comment=NONE

Finished Control File and SPFILE Autobackup at 07-JAN-16


17、维护RMAN存储的脚本


                               
登录/注册后可看大图

打印脚本内容:

RMAN> print script backuptbs_03;

printing stored script: backuptbs_03

{backup datafile 15;}

将脚本内容保存到文件

RMAN> print script backuptbs_03 to file 'backuptbs_03';

script backuptbs_03 written to file backuptbs_03

查看当前目标数据库可以执行的脚本

RMAN> list script names;

List of Stored Scripts in Recovery Catalog

    Scripts of Target Database STONE

       Script Name

       Description

       -----------------------------------------------------------------------

       backuptbs_03

修改脚本

RMAN> replace script backuptbs_03

2> {backup datafile 14;}

replaced script backuptbs_03

RMAN> print script backuptbs_03;

printing stored script: backuptbs_03

{backup datafile 14;}

删除脚本

RMAN> delete script backuptbs_03;

deleted script: backuptbs_03

RMAN> list script names;

List of Stored Scripts in Recovery Catalog

        No scripts in recovery catalog


18、备份恢复目录


                               
登录/注册后可看大图

Oracle建议使用rman对恢复目录进行备份,备份信息存放在恢复目录所在数据库的控制文件中。不要在目标数据库上面创建恢复目录。

建议配置恢复目录所在数据库的控制文件自动备份,在对目标数据库进行备份之后,立即对恢复命令进行备份。

为恢复目录配置备份和恢复环境包括如下:

  • 使恢复目录所在数据库运行在归档模式
  • 设置redundancy保留策略大于1
  • 备份恢复命令到磁盘或者磁带
  • 使用BACKUP DATABASE PLUS ARCHIVELOG进行备份
  • 使用控制文件而不是其他恢复目录作为备份信息存储库
  • 打开控制文件自动备份

19、重建不可恢复的恢复目录


                               
登录/注册后可看大图

如果恢复目录数据库丢失或者损坏,无法进行恢复,则需要重建目录。

使用以下命令部分重建恢复目录:

  • RESYNC CATALOG:使用目标数据库控制文件的rman信息更新恢复目录
  • CATALOG START WITH ...重新注册可用的备份

20、导出和导入恢复目录


                               
登录/注册后可看大图

可以使用导出导入工具移动恢复目录到其他数据库,也可以创建一个逻辑备份。

导出导入步骤如下:

  • 使用导出工具导出恢复目录
  • 在要导入的数据库创建恢复目录用户并赋予权限
  • 使用对应的导入工具导入恢复目录到刚刚创建的模式中

在导入之前或者之后都不需要执行CREATE CATALOG命令,由导入操作创建目录。


21、升级和删除恢复目录


                               
登录/注册后可看大图

如果使用的恢复目录版本小于rman需要的版本,则必须通过执行UPGRADE CATALOG命令进行升级。包括:

  • 安装新的恢复目录模式,恢复目录用户需要有CREATE TYPE权限
  • 需要连接到恢复目录且恢复目录数据库必须open,不需要连接到目标数据库
  • 需要输入2次UPGRADE CATALOG命令进行确认
  • 会显示所有错误消息

[oracle@oracletest ~]$ rman catalog rcowner/rcowner

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jan 8 08:37:50 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database

RMAN> upgrade catalog;

recovery catalog owner is RCOWNER

enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;

recovery catalog upgraded to version 11.02.00.04

DBMS_RCVMAN package upgraded to version 11.02.00.04

DBMS_RCVCAT package upgraded to version 11.02.00.04

使用DROP CATALOG命令删除恢复目录模式,会删除注册到恢复目录的部门数据库的备份记录。

  • 只能在rman执行
  • 需要连接到恢复目录且恢复目录数据库必须open,不需要连接到目标数据库
  • 需要输入2次DROP CATALOG命令进行确认

22、IMPORT CATALOG命令


                               
登录/注册后可看大图

使用IMPORT CATALOG命令从一个恢复目录模式导入元数据到另一个恢复目录模式,用于使用单个恢复目录模式统一管理多个目标数据库不同版本的恢复目录模式。语法如下:

IMPORT CATALOG

[DBID = [, ,…]]

[DB_NAME=[,<dbname,…]]</dbname,…]]

[ NO UNREGISTER ];

其中:

:源恢复目录连接字符串,源恢复目录模式版本必须等于rman的版本,如果不满足则需要进行upgrade。

DBID:指定需要从源目录模式导入的数据库ID,如果不指定,则导入所有数据库ID,如果已经存在则报错。

DB_NAME:指定需要从源目录模式导入的数据库名字。

NO UNREGISTER:默认情况下,成功导入到目的目录模式后,被导入的数据库ID从源恢复目录模式中取消注册,可以使用NO UNREGISTER选项使源目录模式保留这些数据库ID。

注意事项:

  • 确保目标数据库不会同时注册到源目录模式和目的目录模式,如果在源目录模式和目的目录模式都注册了目标数据库,则需要从源目录模式取消注册并重新import。
  • improt操作要么都导入,要么失败回滚,不存在部分导入。
  • 当源目录模式和目的目录模式有系统名字的脚本,rman会对源目录模式的脚本进行重命名。

23、创建和使用虚拟私有目录


                               
登录/注册后可看大图

虚拟私有目录用于访问人员的职责分离,可以限制人员只能看到某些目标数据库的备份记录以及进行指定的操作,提高安全性。

可以访问所有注册数据库信息的目录所有者,在SQL*Plus使用如下语句列出注册的数据库:

SQL> select distinct db_name from dbinc;

DB_NAME

--------

STONE

如果是虚拟私有目录的所有者,使用上面的语句只能看到被授权的数据库信息。


24、使用RMAN虚拟私有目录


                               
登录/注册后可看大图

创建虚拟私有目录步骤:

(1)使用SQL*Plus和rman创建基本恢复目录

SQL> create user rcowner1 identified by rcowner1 default tablespace rcat_ts quota unlimited on rcat_ts;

User created.

SQL> grant recovery_catalog_owner to rcowner1;

Grant succeeded.

RMAN> connect catalog rcowner1/rcowner1;

connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

(2)在SQL*Plus中,基本恢复目录数据库DBA创建虚拟私有目录用户并授权

SQL> conn / as sysdba

Connected.

SQL> create user vpcowner identified by vpcowner;

User created.

SQL> grant recovery_catalog_owner to vpcowner;

Grant succeeded.

(3)在rman中,基本恢复目录所有者给虚拟私有目录用户授予注册数据库的访问权限或者REGISTER权限

RMAN> connect catalog rcowner1/rcowner1;

connected to recovery catalog database

RMAN> grant register database to vpcowner;

Grant succeeded.

注意:在创建与使用虚拟私有恢复目录时,基本恢复目录中不能注册目标数据库,否则会出现RMAN-06004, ORA-00942错误信息。


25、使用RMAN虚拟私有目录


                               
登录/注册后可看大图

(4a)连接到虚拟私有目录用户,为11g创建虚拟目录

RMAN> connect catalog vpcowner/vpcowner

connected to recovery catalog database

RMAN> create virtual catalog;

found ineligible base catalog owned by RCOWNER

found eligible base catalog owned by RCOWNER1

created virtual catalog against base catalog owned by RCOWNER1

(4b)如果是11g之前的数据库,则需要在SQL*Plus执行以下命令创建虚拟目录

SQL> CONNECT vpcowner/oracle@catdb

SQL> exec catowner.dbms_rcvcat.create_virtual_catalog;

(5)在rman中使用虚拟私有目录用户注册数据库

[oracle@oracletest1 ~]$ rman target / catalog vpcowner/vpcowner@192.168.230.138:1521/stone

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jan 8 12:02:32 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

(6)使用虚拟私有目录

[oracle@oracletest1 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jan 8 12:05:02 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STONE (DBID=3003597140)

RMAN> connect catalog vpcowner/vpcowner@192.168.230.138:1521/stone

connected to recovery catalog database

RMAN> backup datafile 15;

Starting backup at 08-JAN-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=53 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00015 name=+DATA/stone/datafile/tbs_03.277.900065973

channel ORA_DISK_1: starting piece 1 at 08-JAN-16

channel ORA_DISK_1: finished piece 1 at 08-JAN-16

piece handle=+FRA/stone/backupset/2016_01_08/nnndf0_tag20160108t120542_0.335.900590743 tag=TAG20160108T120542 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 08-JAN-16

Starting Control File and SPFILE Autobackup at 08-JAN-16

piece handle=+FRA/stone/autobackup/2016_01_08/s_900590744.348.900590745 comment=NONE

Finished Control File and SPFILE Autobackup at 08-JAN-16


26、恢复目录总结


                               
登录/注册后可看大图

管理恢复目录包括:

  • 创建恢复目录
  • 注册数据库到恢复目录,将部门数据库的信息存储到恢复目录
  • 使用IMPORT CATALOG导入其他恢复目录的数据
  • 导入不在目标数据库控制文件中的备份信息
  • 创建虚拟私有目录限制用户访问
  • 为恢复目录制定备份和恢复策略

恢复目录包括以下类型元数据:

  • 数据文件和归档重做日志备份集和备份片
  • 数据文件拷贝
  • 归档的重做日志及其拷贝
  • 目标数据库的表空间和数据文件
  • 存储的rman脚本
  • 永久的rman配置

基本恢复目录的所有者可以授予及回收其他数据库用户访问目录的权限,虚拟私有目录的所有者有其自己元数据的读写访问权限。

可以使用rman存储脚本,本地脚本只有创建该脚本时连接的目标数据库才可以执行,注册到恢复目录的所有数据库都可以执行全局脚本。

如果有不同版本的数据库,建议使用一个恢复目录进行统一管理。


27、相关习题

(1)You are working on a CATDB database that contains an Oracle Database version 11.1 catalog schema owned by the user RCO11. The INST1 database contains an Oracle Database version 10.1 catalog schema owned by the user RCAT10.

You want the RMAN to import metadata for database IDs 1423241 and 1423242, registered in RCAT10, into the recovery catalog owned by RCO11. You also want to deregister them from the catalog after import. You executed the following commands to achieve this:

RMAN> CONNECT CATALOG rco11/password@catdb

RMAN> IMPORT CATALOG rcat10/oracle@inst1 DBID=1423241,1423242;

What happens if the RCO11 catalog has scripts with the same name as that of the scripts in RCAT10 catalog?

A.The scripts in the RCO11 catalog are overwritten.

B.RMAN renames the local stored scripts in the RCO11 catalog.

C.The RMAN session in which the command is executed aborts.

D.RMAN renames the global scripts that are imported from the RCAT10 catalog.

答案:D

(2)You are in the process of creating a virtual private catalog in your Oracle Database 11g database. The PROD1, PROD2, and PROD3 Oracle Database 10g databases are registered in the base recovery catalog. The database user who owns the base recovery catalog is CATOWNER. CATOWNER executes the following command to grant privileges to a new user VPC1 using Oracle Database 11g RMAN executables:

RMAN> GRANT CATALOG FOR DATABASE prod1, prod2 TO vpc1;

Then you issue the following commands:

RMAN> CONNECT CATALOG vpc1/oracle@catdb;

RMAN> SQL "EXEC catowner.dbms_rcvcat.create_virtual_catalog;"

What is the outcome of the above commands?

A.They execute and create a virtual catalog for pre-Oracle 11g clients.

B.They produce an error because PROD1 and PROD2 databases belong to the older version.

C.They produce an error because you need to connect as CATOWNER to execute this packaged procedure.

D.They produce an error because you need to connect to the target database to execute this packaged procedure.

答案:A

(3)You are working on a CATDB database that contains an Oracle Database version 11.1 catalog schema owned by the user RCO11. The INST1 database contains an Oracle Database version 10.1 catalog schema owned by the user RCAT10.

You want the RMAN to import metadata for database IDs 1423241 and 1423242, registered in RCAT10, into the recovery catalog owned by RCO11. You executed the following commands:

RMAN> CONNECT CATALOG rco11/password@catdb

RMAN> IMPORT CATALOG rcat10/oracle@inst1 NO UNREGISTER;

Which two statements are true regarding the tasks accomplished with these commands? (Choose two.)

A.

They import all metadata from the RCAT10 catalog.

B.

They unregister the database from the RCAT10 catalog.

C.

They do not register the databases registered in the RCAT10 catalog.

D.

They register all databases registered in the RCAT10 catalog.

答案:AD

(4)Which statement is true regarding virtual private catalogs?

A.

A virtual private catalog owner can create a local stored script, and have read/write access to a global stored script.

B.

The virtual private catalog owner cannot create and modify the stored scripts.

C.

The set of views and synonyms that make up the virtual private catalog is stored in the schema of the RMAN recovery catalog owner.

D.

To perform most of the RMAN operations, the virtual catalog owner must have the SYSDBA or SYSOPER privilege on the target database.

答案:D

(5)You are using a recovery catalog to maintain Recovery Manager (RMAN) backup information for your production database. You have registered your production database and are performing regular backups. Because of a new requirement you have added a few new tablespaces to your production database and you want them to be included in backups. Identify two options for completing this task. (Choose two.)

A.  Reregistering the target database in recovery catalog

B.  Transporting the new tablespaces to the recovery catalog database

C.  Syncronizing the recovery catalog with the target database control file

D.  Performing a fresh backup of the target database to include the new data files in the catalog database

答案:CD

(6)What is the purpose of the RMAN recovery catalog? (Choose all that apply.)

A.  Make backups faster

B.  Store RMAN metadata

C.  Store RMAN scripts

D.  Provide the ability to do centralized backup reporting.

E.  Make recovery faster

答案:BCD

(7)

RMAN provides more granular catalog security through which feature?

A.  Virtual private database

B.  Virtual private catalog

C.  RMAN virtual database

D.  RMAN secure catalog

E.  Oracle Database Vault

答案:B

(8)You can back up the RMAN recovery catalog with RMAN.

A.  True

B.  False

答案:A

(9)What RMAN command must you use before you can back up a database using the recovery catalog?

A.  create catalog

B.  install database

C.  catalog database

D.  merge Catalog with database

E.  register database

答案:E

(10)What is the purpose of the catalog command?

A.  To review RMAN control file and recovery catalog metadata and ensure that its correct

B.  To delete RMAN backup-related metadata from the recovery catalog

C.  To create metadata in the control file and the recovery catalog related to backup set pieces

D.  To create a report that lists database backups

E.  To rebuild the recovery catalog

答案:C

(11)You want to create the Recovery Manager (RMAN) Virtual Private Catalog (VPC) to maintain a separation of responsibilities along with a consolidation of RMAN repository. Which condition must be met before you create the VPC?

A.  A base catalog exists

B.  The recovery catalog is empty

C.  The base recovery catalog must be dropped

D.  A target database is registered in the recovery catalog

答案:A

(12)You are working on a CATDB database that contains an Oracle Database version 11.1 catalog schema owned by the user RCO11. The INST1 database contains an Oracle Database version 10.1 catalog schema owned by the user RCAT10.
You want the RMAN to import metadata for database IDs 1423241 and 1423242, registered in RCAT10, into the recovery catalog owned by RCO11.
You executed the following RMAN commands:
RMAN> CONNECT CATALOG rco11/password@catdb
RMAN> IMPORT CATALOG rcat10/oracle@inst1;
W hat happens when you execute the above commands? (Choose all that apply.)

A. They deregister all databases registered in the RCAT10 catalog.
B. They import metadata for all registered databases in the RCAT10 database.
C. They register all the RCAT10-catalog registered databases in the RCO11 catalog.
D. They overwrite all stored scripts in the RCO11 catalog with the same name as that in the RCAT10 catalog.

答案:ABC

(13)Which statement about using RMAN stored scripts is true?

A.  To create and execute an RMAN stored script, you must use a recovery catalog.

B.  When executing a stored script and a command fails, the remainder of the script is executed, and a message is written to the alert log file.

C.  RMAN stored scripts can always be executed against any target database that is registered in the recovery catalog.

D.  When you execute a stored script, it always executes using the persistent channel settings previously set with the CONFIGURE command.

答案:A

(14)The following databases are registered in the base recovery catalog: PROD1, PROD2, and PROD3. The database user CATOWNER owns the base recovery catalog. You want a new user VPC1 to have access to only the PROD1 database and create a virtual private catalog.

Given below are some of the commands required to achieve this:

1.SQL> GRANT recovery_catalog_owner TO vpc1;

2.RMAN> CONNECT CATALOG vpc1/password@catdb;

3.RMAN> GRANT CATALOG FOR DATABASE prod1 TO vpc1;

4.RMAN> CONNECT CATALOG catowner/password@catdb;

5.RMAN> CREATE VIRTUAL CATALOG;

What is the correct sequence in which the commands have to be executed?

A.  1, 4, 5, 2, 3

B.  1, 4, 3, 2, 5

C.  4, 5, 2, 3, 1

D.  2, 3, 4, 5, 1

E.  1, 4, 2, 3, 5

答案:B

(15)What is the purpose of the RMAN recovery catalog? (Choose all that apply.)

A.  It must be used because all RMAN-related backup and recovery metadata information is contained in it.

B.  It provides a convenient, optional, repository of backup- and recovery-related metadata.

C.  It provides the ability to store RMAN scripts for global use by any database that has access to the repository.

D.  It provides a means of storing all RMAN backup sets physically in an Oracle database server.

E.  It provides the ability to store backup records for more than a year.

答案:BCE

(16)What privileges must be granted to allow an account to create the recovery catalog? (Choose all that apply.)

A.  RECOVERY_CATALOG_OWNER

B.  DBA

C.  RESOURCE

D.  SELECT ANY DICTIONARY

E.  CONNECT

答案:AC

(17)Which command do you use to create a recovery-catalog schema?

A.  create recovery catalog

B.  create catalog

C.  build catalog

D.  catalog create

E.  mount catalog

答案:B

(18)If you back up a database without connecting to the recovery catalog, which operations will cause the recovery catalog to be updated? (Choose all that apply.)

A.  The next time you back up the database when you are also connected to the recovery catalog and the target database

B.  The next time you are connected to the target database and the recovery catalog database and issue the resync command

C.  The next time you connect RMAN to just the recovery catalog

D.  The next time you connect to the recovery catalog and the target database with RMAN

E.  Connecting to the recovery catalog and issuing the resync all databases command

答案:AB

(19)You have created a script in the recovery catalog called backup_database. Which of the following commands would successfully execute that script?

A.  run { open script backup_database; run script backup_database }

B.  run { engage script backup_database; }

C.  run { run script backup_database; }

D.  Run { execute script backup_database; }

E.  The name backup_database is an invalid name for an RMAN script. Trying to run it from RMAN would result in an error.

答案:D

(20)In what order would you execute the following steps to create a recovery catalog?

a.  Issue the create catalog command.

b.  Create the recovery-catalog database.

c.  Create the recovery-catalog user.

d.  Grant the recovery_catalog_owner privilege to the recovery-catalog user.

e.  Issue the register database command from the target database.

A.  a, b, c, d, e

B.  b, a, d, c, e

C.  b, c, d, a, e

D  b, c, d, e, a

E.  b, d, c, a, e

答案:C

(21)How would you grant the RVPC user access to specific RMAN database records in the RMAN virtual private catalog?

A.  Issue the grant command from the SYS user (or equivalent) of the target database.

B.  Issue the grant command from the SYS user (or equivalent) of the recovery-catalog database.

C.  Issue the grant command from the recovery catalog-owning schema user account in the recovery catalog.

D.  Issue the grant command from RMAN when connected to the recovery catalog-owning schema.

E.  Issue the grant command from RMAN when connected to the target database.

答案:D

(22)The RVPC user can do which of the following? (Choose all that apply.)

A.  Register databases if granted the register database privilege

B.  See all databases in the recovery-catalog schema

C.  See all database-related metadata in the recovery catalog if they are granted access to that database

D.  Unregister databases from the RVPC catalog that were not granted to the RVPC catalog owner with the grant command

E.  Not be connected to with the RMAN command-line catalog parameter for backup or recovery purposes

答案:AC

(23)Given the script

create script db_backup_datafile_script

{backup datafile &1, &2 plus archivelog delete input;}

What is the result of running this command?

Run {execute script db_backup_datafile_script using 2;}

A.  The script will fail since you instructed RMAN to back up only one datafile rather than two.

B.  The script will successfully back up datafile 3 without error.

C.  The script will fail since it uses a substitution variable which is not supported.

D.  The execute script command will prompt for the value of &2 since it's not included in the command.

E.  The script will fail because you cannot use the plus archivelog command when backing up database datafiles.

答案:D

(24)Which is the correct way to connect to both the target database and the recovery catalog from the RMAN command line? Assume that the target database is called ORCL and that the recovery catalog database is called RCAT. Also assume that the recovery-catalog owner is called RCAT_OWN. Assume the environment is configured for the ORCL database. (Choose all that apply.)

A.  rman target=/ catalog=/@rcat

B.  rman target=/ catalog=rcat_own/rcat_own

C.  rman target=/ catalog=rcat_own/rcat_own@RCAT

D.  rman target=sys/robert@orcl catalog=rcat_own/rcat_own@RCAT

E.  You cannot connect to the target database and the recovery catalog at the same time.

答案:CD

(25)You have backed up your database twice without connecting to the recovery catalog. What command do you issue to transfer the control-file metadata to the recovery catalog?

A.  synch catalog

B.  resync catalog

C.  replicate catalog

D.  update catalog

E.  restore catalog

答案:B

(26)You have lost all your RMAN backup set pieces due to a disk failure. Unfortunately, you have an automated cross-check script that also does a delete expired backupset command. You have restored all the backup set pieces from tape. What command would you use to get those backup set pieces registered in the recovery catalog and the control file of the database again?

A.  register database

B.  recover catalog

C.  load backupset

D.  synch metadata

E.  catalog start with

答案:E

(27)Identity two advantages of using a recovery catalog in-load of the control File of the target database Recovery Manager (RMAN). (Choose two.)

A.  You can use RMAN stored scripts.

B.  Recovery is faster if data is stored in catalog in addition to the control file.

C.  You can store backup Information of all registered databases in one place.

D.  Database backups are automatically deleted when they are older than the specified time period.

答案:AC

(28)The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter should be set to what value? (Choose all that apply.)

A.  The initialization parameter should be set to 0 when the RMAN repository is being used.

B.  The initialization parameter should be set to greater than 0 with the RMAN repository utilizing the recovery catalog only.

C.  The initialization parameter should be set to greater than 0 with the RMAN repository utilizing the control file or the recovery catalog.

D.  The initialization parameter should be set to 0 with the RMAN repository utilizing the control file or the recovery catalog.

E.  The initialization parameter should never be set to 0 if you are using RMAN.

答案:CE

(29)While performing a regular check on your recovery catalog you realized that the catalog database is running out of space and you do not have options to increase the space. However, you have another database where more space is available and you want to move your existing recovery catalog to this database.

The options that can be considered while moving the recovery catalog are as follows:

1. Using one of the Oracle expdp utilities to export the catalog data

2. Creating a recovery catalog user and granting the necessary privileges in the other database

3. Creating the recovery catalog using the CREATE CATALOG command

4. Using the corresponding impdp utility to import the catalog data into the other database

5. Registering the target database in the new catalog database using the REGISTER DATABASE command Identify the option with the correct sequence for moving the recovery catalog.

A.  2, 3, 5

B.  1, 2, 4

C.  1, 2, 4, 5

D.  1, 2, 3, 4, 5

答案:B

(30)You are using the control file to maintain information about the database backups that are being performed by Recovery Manager (RMAN). Identify two scenarios is which you must have a recovery catalog. (Choose two.)

A.  To store the backup information of multiple database

B.  To restrict the amount of space that is used by the backups

C.  To maintain a backup for a certain time is set by the CONTROL_FILE_RECORD_KEEP_TIME parameter.

D.  To list the data files that were in a target database at a given time by using the AT option of REPORT SCHEMA command.

答案:AD

(31)Which option is best practice for creating a recovery catalog owner in the catalog database?

A.  Granting UNLIMITED QUOTA on the SYSTEM tablespace to the owner

B.  Allocating the SYSTEM tablespace as the default tablespace and granting the SYSDBA privilege to the user

C.  Creating a new tablespace, allocating this as the default, and granting UNLIMITED QUOTA on this tablespace to the user

D.  Allocating the SYSAUX tablespace as the default tablespace and granting UNLIMITED QUOTA on this tablespace to the user

答案:C

(32)Indentify two advantages of using recovery catalog instead of the control file of the database in Recovery Manager (RMAN). (Choose two.)

A.  You can use RMAN stored scripts

B.  Recovery is faster if data is stored in catalog in addition to the control file

C.  You can store backup information of all registered databases in one place

D.  Database backups are automatically deleted when they are older than the specified time period

答案:AC

(33)You are in the process of creating a Virtual Private Catalog (VPC) in your Oracle Database 11g database. The Prod1, Prod2 and Prod3 Oracle Database 10g databases are registered in the recovery catalog. The database user who owns the base recovery catalog is CATOWNER. CATOWNER executes the following command to grant privileges to a new user VPC1 using Oracle Database 11g RMAN executables:

RMAN> GRANT CATALOG FOR DATABASE prod 1 prod 2 TO vpc1;

Then you issue the following commands;

RMAN > CONNECT CATALOG vpc1/oracle@catdb;

RMAN> SQL ‘execute catowner.dbms_rcvcat.create virtual_catalog’;

What is the outcome of the above commands?

A.  They execute and a create a virtual private catalog for pre-Oracle 11g clients

B.  They produce an error because PROD1 and PROD 2 databases belong to the older version

C.  They produce an error because you must connect as CATOWNER to execute this packaged procedure

D.  They produce an error because you must connect to the target database to execute this packaged procedure

答案:A

(34)Identify two options that Oracle recommends while configuring the backup and recovery environment for your recovery catalog. (Choose two.)

A. configuring control file autobackup to be ON

B. backing up data filed only and not the archived redo log files

C. running the recovery catalog database in NOARCHIVELOG mode.

D. setting the retention policy to a REDUNDANCY value greater than 1

E. backing up the recovery catalog to the same disk as that of the target database

答案:AD


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-25 04:20 , Processed in 0.108198 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表