您的位置:首页 > 数据库 > Oracle

oracle11g OCP 认证 1Z0-053考试笔记4

2016-11-24 16:13 573 查看
302.You issue the following command:

RMAN>CONFIGURE BACKUP OPTIMIZATION ON;

What is the result of this command on your backups?

B. Read-only datafiles will not be backed up as long as backups of those files already exist and those

backups meet established retention criteria.

只读文件只要存储在备份 就不在备份 这些备份集 符合建立的 保留标准

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

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.

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

Answer: BCE

A,不是必须,也可以使用控制文件来记录备份和恢复的信息。

B,它提供了一个方便,可选的备份和恢复相关的元数据存储库。正确

C,可以存储rman全局脚本,可以让任何注册的数据库访问。正确

D,..它提供了一种存储在Oracle数据库服务器所有RMAN物理备份集,错误,个人认为存在目录数据库,不是存在目标数据库服务器上。

E,可以提供长达一年多的备份记录,正确

RMAN Recovery Catalog,各种翻译的都有,有叫“恢复目录”,也有叫“知识库”等等。“恢复目录”叫的多一些,姑且先用这个翻译吧。

你可能从其他人或书上听过RMAN恢复目录,旁人的表达或书中模糊不清的描述,导致很多朋友一直对其实际意义和作用感到疑惑。你可以将其视作存储RMAN备份恢复相关信息的数据库(在物理形式上可以对应成Oracle中的一个SCHEMA)。 关于Oracle设置恢复目录目的,Oracle官方文档给出了说明:

当没有恢复目录时,RMAN相关的备份信息(比如归档文件路径、备份集路径等)均存储在目标数据库的控制文件中,不过考虑到控制文件并不能无限增长,而且控制文件也不仅仅是用来存储与备份相关的信息,因此RMAN也有一个专门的备份信息存储地,这就是恢复目录了。当待备份的数据库注册到恢复目录之后,RMAN相关的信息除了保存在控制文件中外(控制文件实际上只保存一部分),更加详细的信息就都被存储在恢复目录中

nocatalog

nocatalog方式就是用control file作为catalog,每一次备份都要往控制文件里面写好多备份信息,控制文件里面会有越来越多的备份信息,即RMAN的备份信息写在本地控制文件里面。因此,当使用Rman nocatalog方式备份数据库时,一定要记得备份controlfile。

当使用rman nocatalog恢复时,数据库必须是处于“mount”状态的。而Oracle startup mount的前提条件是control必须存在。因此,你必须在恢复datafile之前先恢复controlfile。使用rman catalog方式时,可以startup nomount然后restore controlfile;但使用rman nocatalog时,必须先用文件方式恢复controlfile。

nocatalog or catalog ?

如果DBA要管理的Oracle数据库较多,那么对于这些数据库的备份,建议使用恢复目录统一管理,这样既方便备份和恢复操作,而且安全性也相对比较高(执行完备份操作后,单独备份恢复目录数据库即可,无须担心被备份的数据库控制文件丢失可能造成的影响)。不过如果DBA仅管理一个或者数个Oracle数据库,那么我想NOCATALOG模式操作起来会更加方便。Oracle官方推荐是什么?- 使用恢复目录

Recovery Catalog都存储了什么信息

The catalog includes the following types of metadata:

Datafile and archived redo log backup sets and backup pieces

Datafile copies

Archived redo logs and their copies

Database structure (tablespaces and datafiles)

Stored scripts, which are named user-created sequences of RMAN commands

Persistent RMAN configuration settings

304.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

Answer: AC

305.Which command do you use to create a recovery-catalog schema?

B. create catalog

306.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

307.You have created a script in the recovery catalog called backup_database. Which of the following

commands would successfully execute that script?

D. Run { execute script backup_database; }

308.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.

F. a, b, c, d, e

G. b, a, d, c, e

H. b, c, d, a, e

I. b, c, d, e, a

J. b, d, c, a, e

Answer: C

309.How would you grant the RVPC user access to specific RMAN database records in the RMAN virtual

private catalog?

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

310.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

Answer: AC

311.Given the script

create script db_backup_datafile_script

{backup datafile and 1,

and2 plus archivelog delete input;}

What is the result of running this command?

Run {execute script db_backup_datafile_script using 2;}

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

312.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.)

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

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

连接目标库和恢复目录库

313.What command would you issue to enable automated backups of control files?

自动备份控制文件

C. configure controlfile autobackup on

314.Given the following RMAN commands, choose the option that reflects the order required to restore your currently operational ARCHIVELOG-mode database.

a. restore database;

b. recover database;

c. shutdown immediate

d. startup

e. restore archivelog all;

f. alter database open

A. a, b, c, d, e, f

B. c, b, a, d, e, f

C. c, b, a, d, f

D. c, a, b, d

E. c, a, e, b, d, f

答案:(E)

解析:

A(X),c一定是第一步

B(X),C(X),b不能是下一个步骤

都已经startup,为什么还要alter database open;

315.Which commands are used for RMAN database recovery? (Choose all that apply.)

A. restore

B. repair

C. copy

D. recover

E. replace

Answer: AD

316.Given a complete loss of your database, in what order would you need to perform the following

RMAN operations to restore it?

A. restore controlfile

B. restore database

C. restore spfile

D. recover database

E. alter database open

F. alter database open resetlogs

G. b, a, c, d, e

H. a, c, b, d, f

I. c, a, b, d, e

D. c, a, b, d, f

K. e, a, b, d, c

Answer: D

c a b d f

317.If you lost your entire database, including the database spfile, control files, online redo logs, and

database datafiles, what kind of recovery would be required with RMAN?

B. Incomplete database recovery.

318.Which command will restore all datafiles to the date 9/30/2008 at 18:00 hours?

C. restore database until time '09/28/2008:18:00:00';

319.What is the end result of these commands if they are successful?

RMAN> show retention policy;

RMAN configuration parameters for database with db_unique_name

ORCL are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1;

# default

Backup database tag=gold_copy plus archivelog tag=gold_copy delete input;

Backup database tag=silver_copy plus archivelog tag=silver_copy delete input;

D. Attempting to restore gold_copy may or may not succeed.

因为配置的保留策略为REDUNDANCY 1,故这里有两个备份,其中第一次备份的即gold_copy就会显示为obsolete。

obsolete状态的备份机在用来恢复时,可能成功,可能不成功。

320.You are using RMAN to backup your ARCHIVELOG mode database. You have enabled control-file

autobackups. Which files are not backed up during the RMAN backup?

C. Online redo logs

321.True or false: RMAN offers the equivalent of the SQL command alter database backup controlfile to

trace.

B. False

Answer: B

)You need to restore your database back to 9/30/2008 at 18:00.

In what order would you run the following commands to compete this task?

a. restore controlfile until time '09/30/2008:18:00:00';

b. restore database until time '09/30/2008:18:00:00';

c. restore spfile until time '09/30/2008:18:00:00';

d. recover database until time '09/30/2008:18:00:00';

e. alter database open resetlogs;

f. alter database open;

A. b, d, e

B. b, d, f

C. c, a, b, d, e

D. c, a, b, d, f

E. a, b, d, e

答案:(A)

解析:

没提到参数文件和控制文件损坏,所以不必还原参数文件和控制文件

Answer: A

答案解析:

题目要求数据返回到指定日期。

通过restore-recover-open resetlogs来执行

(323)What is the correct order of the following commands if you wanted to restore datafile 4, which was accidentally removed from the file system?

a. sql 'alter database datafile 4 online';

b. restore datafile 4;

c. recover datafile 4;

d. sql 'alter database datafile 4 offline';

e. startup

f. shutdown

A. a, c, b, d

B. d, b, c, a

C. f, d, b, c, a, e

D. c, a, b, d, f

E. a, b, d, e

答案:(B)

解析:

不需要关闭数据库实例

(324)Your database is up and running and one of your three control files is accidentally erased. You start RMAN and run the following command:

RESTORE CONTROLFILE FROM AUTOBACKUP;

Which of the following statements is true? (Choose all that apply.)

C. The command fails because the database is running.

E. This is not the correct way to address this problem.

Answer: CE

325.Which of the following are valid until command options when attempting point-in-time recovery in

RMAN? (Choose all that apply.)

A. until time

C. until sequence

D. until SCN

(326)Which of the following does the recover command not do?

A. Restore archived redo logs.

327.You have a database with the following tablespaces: SYSTEM, SYSAUX, UNDO, USERS, TEMP.

You want to"roll back" the data in the USERS tablespace to the way it looked yesterday. Which

tablespaces do you need to perform a point-in-time restore operation on in order to complete this task?

(Choose all that apply.)

A. SYSTEM

B. SYSAUX

C. UNDO

D. USERS

E. TEMP

答案:(A、B、C、D、E)

TSPITR(表空间时间点恢复)用于将一个或多个表空间恢复到过去某个时间点的状态,而其他表空间仍然保持现有状态。

TSPITR 相关的概念和术语:

(1) TSPITR (Tablespace Point-In-Time Recover)。TSPITR 是表空间时间点恢复的英文缩写格式,它表示将一个或多个表空间恢复到过去时间点的状态,而其他表空间仍然保持现有状态。

328.You have backed up your database using image copies. You have lost the SYSTEM tablespace and

need to restart your database as quickly as possible. What is the correct solution?

C. Use the switch datafile command to instantly立即 switch to the datafile copy, recover the tablespace, and

open the database.

329.If you find errors in the view V$DATABASE_BLOCK_CORRUPTION with a status of

MEDIA_CORRUPT, what RMAN command would you run to correct the problem?

E. recover corruption list;

Answer: E

还可以通过RMAN> blockrecover corruption list进行块的恢复,这是在大量块损坏时或全部块损坏时使用,

前提是先执行RMAN>backup validate database,在V$DATABASE_BLOCK_CORRUPTION里有对应的坏块的列表。

330.What will be the end result of this set of RMAN commands?

shutdown abort

startup mount

restore datafile 4 until time ,,09/30/2008:15:00:00;

recover datafile 4 until time ,,09/29/2008:15:00:00;

alter database open resetlogs;

A. Datafile 4 will be recovered until 9/30/2008 at 15:00 and the database will open.

B. The restore command will fail.

C. The recover command will fail.

D. The alter database open resetlogs command will fail.

E. All these commands will fail because they must be in the confines of a run block.

Answer: D

注意,restore和recover的时间不一致

331.Which of the following represents代表 the correct way to perform an online recovery of datafile 4, which is assigned to a tablespace called USERS?

在线恢复数据文件4的正确方式

E. Sql alter database datafile 4 offline; restore datafile 4; recover datafile 4; Sql alter database datafile 4

online;

Answer: E

332.David managed to accidentally delete the datafiles for database called DSL. He called Heber and

Heber tried to help but he managed to delete the control files of the database. Heber called Bill and Bill

saved the day. They are using a recovery catalog for this database. What steps did Bill perform to recover

the database and in what order?

A. Restored the control file with the RMAN restore controlfile command.

B. Mounted the DSL instance with the alter database mount command.

C. Restored the datafiles for the DSL database with the RMAN restore command.

D. Opened the DSL database with the alter database open resetlogs command.

E. Recovered the datafiles for the DSL database with the RMAN recover command.

F. Started the DSL instance.

G. Connected to the recovery catalog with RMAN.

H. a, b, c, d, e, f, g

I. b, c, d, g, f, e, a

J. g, f, a, b, c, e, d

K. c, a, d, b, f, e, g

L. g, f, a, b, e, c, d

Answer: C

答案解析:

题中说,在avid不小心删除的数据库和heber删除了控制文件后,怎么使用恢复目录来恢复数据库,数据库实例名:DSL

1,连接到目录数据库

2,启动DSL数据库实例

3,恢复控制文件

4,启动到mount状态

5,恢复数据文件

6,recover数据文件

7,因为是重新恢复的控制文件,所有用open resetlogs打开数据库

333.Which command would you use to determine what database backups are currently available for

restore?

C. list backup of database;

334.What command would you use to ensure that backup records in the control file are pointing to actual

physical files on the backup media?

A. crosscheck

在用DELETE OBSOLETE 命令删除废弃的备份文件,如果出现如下错误(RMAN-06207 & RMAN-06208),那么需要用CROSSCHECK命令来解决:

RMAN-06207: WARNING: 2 objects could not be deleted for DISK channel(s) due

RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status

CROSSCHECK命令用户核对备份文件,以确保RMAN资料库与备份文件保持同步。当执行该命令时,如果RMAN资料库记录的状态与实际备份文件不匹配,则会更新资料库里的状态使其与实际备份文件状态一致;若备份文件处于expired状态,那么说明该备份已失效,可以删除之;

常用命令介绍:

1.CROSSCHECK BACKUP

用于核对数据库、表空间、数据文件、控制文件、归档日志、SPFILE的备份集。

CROSSCHECK BACKUP ; --核对所有备份(包括有效和失效的备份)

CROSSCHECK BACKUP of database; --核对除控制文件、归档文件外的备份文件

CROSSCHECK BACKUP of tablespace system;

CROSSCHECK BACKUP of datafile 1;

CROSSCHECK BACKUP of controlfile;

CROSSCHECK BACKUP of archivelog all;

CROSSCHECK BACKUP of archivelog sequence 3;

CROSSCHECK BACKUP of spfile;

2.CROSSCHECK BACKUPPIECE

用于 核对特定备份片,该命令需要制定备份片的BP值或备份片名称;

CROSSCHECK BACKUPPIECE 24;

CROSSCHECK BACKUPPIECE '/u01/app/Oracle/rman_backup/OCPYJG_28';

3.CROSSCHECK BACKUPSET

用于核对特定的备份集,该命令需要制定备份集的BP值;

CROSSCHECK BACKUPSET 24;

4.CROSSCHECK COPY

用于核对数据库、表空间、数据文件、控制文件、归档文件的映像副本(即备份是用COPY DATAFILE ...... 或BACKUP AS COPY ......DATAFILE......命令备份数据文件的映像)

CROSSCHECK COPY;

CROSSCHECK COPY of database;

CROSSCHECK COPY of tablespace system;

CROSSCHECK COPY of datafile 1;

CROSSCHECK COPY of controlfile;

CROSSCHECK COPY of archivelog all;

CROSSCHECK COPY of archivelog from sequence 24 until sequence 32;

5.CROSSCHECK DTAFILECOPY

用于核对特定的数据文件映像副本,该命令需要指定映像副本的文件名或KEY值;

CROSSCHECK DATAFILECOPY 2;

CROSSCHECK DATAFILECOPY '/u01/app/oracle/rman_backup/tp9.dbf';

6.CROSSCHECK CONTROLFILECOPY

用于核对特定的控制文件映像副本,该命令需要指定控制文件映像副本的文件名或KEY值;

CROSSCHECK CONTROLFILECOPY 3;

CROSSCHECK CONTROLFILECOPY '/u01/app/oracle/rman_backup/controlfile01.ctl;

7.CROSSCHECK ARCHIVELOG

用于核对特定的归档日志,该命令需要指定归档日志的文件名或KEY值或SEQUENCE值;

CROSSCHECK ARCHIVELOG 36;

CROSSCHECK ARCHIVELOG 'crosscheck archivelog '/u01/app/oracle/product/11g/dbs/arch1_6_813161833.dbf';

CROSSCHECK ARCHIVELOG sequence 7;

335.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?

B. resync catalog

336.You want to make sure that your database backup does not exceed超过 10 hours in length. What

command would you issue that would meet this condition?

限制备份时间不超过10小时

D. backup database plus archivelog duration 10:00;

为了帮助减少RMAN备份对其他进程的整体I/0影响,RMAN提供了backup命令的duration 参数。 Duration 参数类似与闹钟,如果备份运行时间超过指定的持续时间,RMAN将取消备份。 如:

Backup duration 00:30 database;

337.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?

catalog start with 将RMAN备份集恢复到另一台机器

oracle10g 中rman的增强功能catalog start with

将备份集注册到控制文件

catalog start with 是一个很好的命令. 有了这个命令后, 基本上可以不再使用catalog数据库了 . 因为可以通过这个命令将以前的备份集信息重新导入到当前控制文件中, 一般应用于使用rman恢复, 控制文件又是旧的或者是手工创建的(这样的控制文件当然没有最新的备份集的信息), 通过catalog start with 可以将最新的备份集以及归档日志文件列表导入到控制文中, 然后就可以进行rman的恢复了.

338.You run the following commands:

RMAN> list expired backup;

RMAN> delete expired backup;

What will happen to the backup set pieces associated with the backups that appear in the list expired

backup command?

B. Nothing will happen to them. The backup set pieces do not exist.

339.Why would you run the delete obsolete废弃的老式的 command? (Choose all that apply.)

C. To mark as deleted records in the control file and the recovery catalog associated with obsolete backup sets

D. To delete backup set pieces associated with backups that are no longer needed due to retention

criteria

delete expired删除的是那些本来RMAN以为存在但是实际上在磁盘或者磁带上已经被删除了的信息,删除的只是RMAN资料库中的记录;delete obsolete则删除旧于备份保留策略定义的备份数据同时也更新RMAN资料库以及控制文件。

delete expired

If you run CROSSCHECK, and if RMAN cannot locate the files, then it updates their records in the RMAN repository to EXPIRED status. You can then use the DELETE EXPIRED command to remove records of expired backups and copies from the RMAN repository.

delete obsolete

The RMAN DELETE command supports an OBSOLETE option, which deletes backups that are no longer needed to satisfy specified recoverability requirements. You can delete files obsolete according to the configured default retention policy, or another retention policy
that you specify as an option to the DELETE OBSOLETE command. As with other forms of the DELETE command, the files deleted are removed from backup media, deleted from the recovery catalog, and marked as DELETED in the control file.

340.What does it mean if a backup is expired失效的?

D. The backup set contains one or more missing backup set pieces.

341.If a backup set is expired, what can you do to correct the problem?

B. Make the lost backup set pieces available to RMAN again.

342.How long will this backup be allowed to run?

Backup as compressed backupset duration 2:00 minimize load database ;

B. 2 hours

343.What is the impact of the following backup if it exceeds超出 the duration allowance允许 ? (Choose all that

apply.)Backup as compressed backupset duration 2:00 partial minimize load database ;

B. The entire backup will fail, but any datafile successfully backed up will be usable for recovery.

344.In what view are you likely to see the following output?

SID SERIAL# EVENT SECONDS_IN_WAIT

121 269 RMAN backup & recovery I/O 2

129 415 SQL*Net message from client 63 130 270 SQL*Net message from client

B. V$SESSION

select SID,SERIAL#,EVENT,SECONDS_IN_WAIT from V$SESSION;rom V$SESSION;

SID SERIAL# EVENT SECONDS_IN_WAIT

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

1 1 DIAG idle wait 0

2 1 rdbms ipc message 0

3 85 rdbms ipc message 59

7 2723 wait for unread message on broadcast channel 1

9 205 SQL*Net message to client 0

345.What view might you use to try to determine how long a particular backup will take?

E. V$SESSION_LONGOPS

Answer: E

V$SESSION_LONGOPS视图记录了执行时间长于6秒的某个操作(这些操作可能是备份,恢复,Hash Join,Sort ,Nested loop,Table Scan, Index Scan 等等)。

要想V$SESSION_LONGOPS视图中有记录

1.必须将初始化参数 timed_statistics设置为true或者开启sql_trace

2.必须用ANALYZE或者DBMS_STATS对对象收集过统计信息

要理解的就是:比如某个SQL语句执行时间比较长,但是每个操作都没有超过6秒钟,那么你在V$SESSION_LONGOPS这个视图中就无法查询到该信息。还有一点就是,即使某个操作完成了,你在该视图中也可能查询到该操作依然记录在视图中。

这个视图通常用来分析SQL运行缓慢的原因,配合V$SESSION视图。

(346)What is the impact of the results of the output of the following command?

RMAN> report unrecoverable database;

Report of files that need backup due to unrecoverable operations

File Type of Backup Required Name

4 full or incremental C:\ORACLE\ORADATA\ORCL\USERS01.DBF

A. There are no backup sets with any backups of the users01.dbf datafile.

B. The users01.dbf datafile has had unrecoverable operations occur in it. It will need to be backed up or some data loss is possible during a recovery.

C. The users01.dbf datafile is corrupted.

D. The users01.dbf datafile backup exceeds the retention criteria.

E. The last backup of the users01.dbf datafile failed and must be rerun.

答案:(B)

解析:

列出所有unrecoverable的数据文件.

一个数据文件被认为是unrecoverable的, 从这个数据文件的上次备份后,对数据文件中存储的对象执行了unrecoverable操作.

在unrecoverable操作中, 不会产生redo数据. 例如表数据的直接加载; 使用NOLOGGING选项更新数据

注意:数据文件不存在任何备份不是认为该数据文件是unrecoverable的充分条件.例如数据文件可以使用CREATE DATAFILE

命令创建, 如果从数据文件创建后,所有的redo log都存在.

(347)What does the output on this report indicate?

RMAN> report need backup;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Report of files with less than 1 redundant backups

File #bkps Name

5 0 C:\ORACLE\ORADATA\ORCL\MY_DATA_01.DBF

A. The my_data_01.dbf datafile is corrupted and needs to be restored.

B. The my_data_01.dbf datafile has not yet been backed up. This report does not imply that the data in the datafile can not be recovered.

C. The my_data_01.dbf datafile has not yet been backed up. This report implies that the data in the datafile can not be recovered.

D. The my_data_01.dbf datafile no longer meets the retention criteria for backups.

E. Datafile 5 is missing.

答案:(B)

解析:

C(X),从结果来看,这个文件目前没有备份,但没用备份的文件,也可以使用redo日志来恢复

348.What does the minimize load database parameter mean when backing up a database?

C. RMAN will spread the backup IO over the total duration stated in the backup command

控制RMAN操作的整体影响

有些时候,我们需要减低RMAN 读写数据的速度。 在10g之前,我们可以使用RMAN 的rate 和 readrate 来抑制RMAN读写数据的速度,释放系统资源以用于其他操作。

在10g之后,可以在backup命令中使用duration参数来控制备份的持续时间。 Duration 参数有一个额外的关键字 minimize load,该关键字用于指示RMAN 最小化在给定持续时间内备份数据库所需的I/O负载。

如,如果一个备份需要花费5个小时,占用90%的I/O,则可以指示RMAN,使用10个小时持续时间。 当minimize load 参数指示这一点时,就可以使用45%到50%的可用I/O。

Backup as copy database duration 10:00 minimize load database;

该命令让备份运行10个小时。 当然使用duration 参数的实际备份时间可能超过10个小时。 任何完整的备份集都可以用于恢复,即使备份进程由于持续时间导致的问题而失败。 在超出持续时间并且备份失败时,我们可以使用partial 关键字取消RMAN 错误。

使用duration 参数时,包含最老备份的数据文件比包含日期最新RMAN备份的数据文件具有更高的优先级。 比如,备份20个数据文件,若在备份完10个后失败,那么下次备份从没有备份的那10个数据文件开始备份。

349.What is the result of this command? RMAN> Report need backup days 3;

E. Lists all datafiles not backed up in the last three days. It does not imply暗示,意指 that the datafile is not recoverable可恢复的.

Answer: E

350.Why would you execute the report obsolete过时的 command?

B. To list all backups that had aged beyond the RMAN retention criteria

超出有效期

351.What information does the report schema command not provide? (Choose all that apply.)

A. Size of the datafiles

B. Size of the tempfiles

C. Date of last backup for datafiles and tempfiles

D. Filenames for each datafile

E. Checkpoint SCN associated with the last RMAN backup

Answer: CE

352.If a backup is expired, which of the following is true?

E. The physical backup set pieces are missing from the media.

Answer: E

353.True or false: tablespace point-in-time recovery is possible only with RMAN.

A. True

B. False

Answer: B

354.Which command is used to begin a tablespace point-in-time recovery?

B. Recover tablespace

TSPITR(表空间时间点恢复)用于将一个或多个表空间恢复到过去某个时间点的状态,而其他表空间仍然保持现有状态。

TSPITR 相关的概念和术语:

(1) TSPITR (Tablespace Point-In-Time Recover)。TSPITR 是表空间时间点恢复的英文缩写格式,它表示将一个或多个表空间恢复到过去时间点的状态,而其他表空间仍然保持现有状态。

(2) TSPITR 实现方法。当实现表空间时间点恢复时,既可以使用用户管理的表空间时间点恢复方法,也可以使用RMAN 管理的表空间时间点恢复。

(3) DBPITR (Database Point-In-Time Recovery)。DBPITR 是数据库时间点恢复的英文缩写格式,它表示将数据库的所有表空间恢复到过去时间点的状态。注意,DBPITR 只适用于ARCHIVELOG 模式。

(4) 主数据库(Primary Database)。主数据库是指用于存放应用系统数据的Oracle 数据库,也被称为产品数据库或目标数据库。当执行TSPITR 时,主数据库是指包含被恢复表空间的数据库。

(5) 恢复集(Recovery Set)。恢复集是指在主数据库上需要执行 TSPITR 的表空间集合。注意,当在恢复集的表空间上执行TSPITR 时,要求这些表空间必须是自包含的。

(6) 辅助数据库(Auxiliary Database)。辅助数据库是主数据库的一个副本数据库。当执行TSPITR 时,辅助数据库用于将恢复集表空间恢复到过去时间点。注意,辅助数据库的所有物理文件都是从主数据库备份中取得,并且辅助数据库必须包含SYSTEM 表空间、UNDO 表空间以及恢复集表空间的备份文件。

(7) 辅助集(Auxiliary Set)。辅助集是指辅助数据库所需要的、除了恢复集表空间文件之外的其他文件集合。当执行 TSPITR 时,辅助数据库除了需要恢复集表空间的备份文件之外,还需要备份控制文件、SYSTEM 表空间的备份文件、UNDO 表空间的备分文件

RECOVER TABLESPACE AA UNTIL time "to_date('2015-05-24 19:41:00','YYYY-MM-DD HH24:mi:ss')" auxiliary destination '/u01/auxdest';

355.When youre performing active database duplication, a backup of what kind is required?

B. No backup is required.

356.Which of the following commands will perform an active database duplication of the ORCL database

to the ORCL2 database?

E.

Set oracle_sid=orcl

rman target=sys/robert auxname=sys/Robert@orcl2 duplicate target database to

neworcl from active database nofilenamecheck spfile

set control_files

'c:\oracle\oradata\neworcl\control01.ctl',

'c:\oracle\oradata\neworcl\control02.ctl'

set db_file_name_convert 'c:\oracle\oradata\orcl','c:\oracle\oradata\neworcl'

set log_file_name_convert 'c:\oracle\oradata\orcl','c:\oracle\oradata\neworcl';

Answer: E

For active database duplication, you must connect to the source database as TARGET and to the auxiliary instance as AUXILIARY. You must use the same SYSDBA password for both instances and must supply the net service name to connect to the AUXILIARY instance.
A recovery catalog connection is optional.

Example 24-1 Duplicating to a Host with the Same Directory Structure (Active)

DUPLICATE TARGET DATABASE TO dupdb

FROM ACTIVE DATABASE

PASSWORD FILE

SPFILE

NOFILENAMECHECK;

指定下列参数来显式控制辅助数据库的文件命名:

• CONTROL_FILES

• DB_FILE_NAME_CONVERT

• LOG_FILE_NAME_CONVERT

CONTROL_FILES='/u01/app/oracle/oradata/aux/control01.ctl',

'/u01/app/oracle/oradata/aux/control02.ctl',

'/u01/app/oracle/oradata/aux/control03.ctl'

DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl',

'/u01/app/oracle/oradata/aux'

LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl',

'/u01/app/oracle/oradata/aux

357.How many database instances are used during a database-duplication process?

B. Two

358.What command is used to reset a database to a previous incarnation前身?

C. reset database to incarnation

reset incarnation的分析之一

--实体5中有备份,现在需要将数据库恢复到实体5的数据中,首先重置实体

RMAN> reset database to incarnation 5;

将数据库重置为原型 5

--在重置实体后,restore和recover都会针对重置设置的实体进行,rman自动选择重置到的实体5所对应的备份进行恢复

RMAN> restore database;

启动 restore 于 26-3月 -08

359.What view would you use to determine if a given tablespace is fully self-contained独立自包含的 for the execution of a tablespace point-in-time recovery?

C. TS_PITR_CHECK

使用TS_PITR_CHECK 视图来确保恢复集是完整的,并且标识所有可能要用到的其他表空间。 首先需要检查TS_PITR_CHECK 视图来确保没有其他相关的表空间。 比如我们检查DAVE 表空间,示例代码如下:

TS_PITR_CHECK

This view, created by catpitr.sql, provides information on any dependencies依赖性 or restrictions限制 that might prevent tablespace point-in-time recovery from proceeding. This view applies only to the tablespace point-in-time recovery feature.

360.When performing a full database disaster recovery with RMAN, in what order would you execute

these steps?

360.When performing a full database disaster recovery with RMAN, in what order would you execute

these steps?

A. Restore the control file from autobackups.

B. Run the RMAN restore and recover command.

C. Restore the database spfile from autobackups.

D. Make the RMAN backup set pieces available.

E. Open the database with the alter database open resetlogs command.

F. Open the database with the alter database open command.

G. a, b, c, d, e, f

H. c, d, a, b, f

I. d, c, a, b, f

J. d, b, d, c, e

K. d, c, a, b, e

Answer: E

是备份集可用--》还原spfile --> 还原控制文件--》》使用rman 还原和恢复---》》 restlog日志打开数据库

361.When performing a database duplication, which duplicate database parameter would you set to

ensure that the online redo logs are created in the correct location?

A. log_file_name_convert

362.Which command would correctly start a TSPITR of the USERS tablespace?

E. recover tablespace users until time ,,10/06/2008:22:42:00 auxiliary destination ,,c:\oracle\auxiliary;

Answer: E

363.True or false: you can perform an active database duplication when the database is in

NOARCHIVELOG mode.

A. True

B. False

Answer: B

364.When running the tablespace point-in-time command

recover tablespace users

until time ,,10/06/2008:22:42:00

auxiliary destination ,,c:\oracle\auxiliary;

you receive the following error:

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571:

===========================================================

RMAN-03002: failure of recover command at 10/08/2008 16:00:30

RMAN-20202: Tablespace not found in the recovery catalog

RMAN-06019: could not translate tablespace name "USERS"

What is the likely cause of the error?

B. There is not a current backup of the database available

365.Which of the following restrictions限制条件 are not true with respect to关于 tablespace point-in-time recovery?

(Choose all that apply.)

那些不是真的 ,那些事错误的

A. The target database must be in NOARCHIVELOG mode.

B. No backup is required of the database before you perform a TSPITR.

C. You must have all archived redo logs generated since the last backup up to the point to which you want

to restore the transport set.

D. If you rename a tablespace, you can not perform a TSPITR to any point in time before that rename

operation occurred.

E. If you have tables in tablespace_1 that have associated constraints in tablespace_2, then you must

transport both tablespaces.

Answer: AB

366.If you are going to run a TSPITR recovery, which view will help you to determine which objects will be lost during the TSPITR?

C. TS_PITR_OBJECTS_TO_BE_DROPPED

在执行TSPITR后 确定丢失的对象

367.Youre performing tablespace point-in-time recovery on a tablespace called USERS. If an object in

that tablespace has a foreign key constraint owned by another object in the INDEX_TBS, which statement

is true?

包含外键

B. You must perform the TSPITR recovery of both tablespaces for it to be successful.

必须两个表空间都恢复

368.When issuing the duplicate database command, you use the parameter

DB_FILE_NAME_CONVERT. For what purpose do you use this parameter?

D. To indicate指示指出 the location of the auxiliary-instance database datafiles.

db_file_name_convert和log_file_name_convert

从库通过主库的备份恢复控制文件--->恢复控制文件时,oracle查看从库参数文件中的db_file_name_convert和log_file_name_convert参数---->将主库保存数据文件、联机日志的路径转换成从库保存数据文件、联机日志的路径---->生成从库的控制文件

369.Which of the following identifies识别 and creates an index to minimize最小化时间 the DB time for a particular特定的 SQL statement?

C. The SQL Tuning Advisor

下列哪项识别和创建索引,以尽量减少DB时间为特定的SQL语句?

SQL优化指导:分析各个 SQL 语句, 并建议 SQL 概要文件, 统计信息, 索引和重构的 SQL 以改善 SQL 性能。

SQL访问指导:评估 SQL 的全部工作量, 并建议索引, 分区和实体化视图, 它们将改善 SQL 工作量的总体性能。

370.Why should you back up a duplicated 复制的 tablespace after a TSPITR is complete?

在TSPITR完成后 备份一个复制的表空间

B. The tablespace cannot be duplicated复制 or restored to the point in time before the duplication.在副本之前

执行TSPITR后,这个表空间之前的备份就不可以使用的

371.In what state are the datafiles of a tablespace after a TSPITR has been successfully completed?

A. The datafiles have an ONLINE status.

基于时间点的表空间恢复成功完成后,数据文件都时在线状态

执行完全自动执行的TSPITR

1. 配置在目标实例上执行TSPITR 所需的通道。

2. 使用AUXILIARY DESTINATION选项指定辅助目标。

RMAN> CONNECT TARGET

RMAN> RECOVER TABLESPACE users, example

> UNTIL TIME '2007-06-29:08:00:00'

> AUXILIARY DESTINATION

> '/u01/app/oracle/oradata/aux';

3. 备份恢复的表空间并使它们联机。

RMAN>BACKUP TABLESPACE users, example;

RMAN> SQL "ALTER TABLESPACE users, example ONLINE";

执行完全自动执行的TSPITR 时,还必须:

• 配置在目标实例上执行TSPITR 所需的任何通道

• 指定RMAN 用于数据文件辅助集和其它辅助实例文件的目标

在TSPITR 完成之后,备份恢复的表空间并使它们联机。执行TSPITR 之后,不能使用TSPITR 之前创建的参与执行TSPITR 的表空间的备份

372.Which command do you use to generate a report of database incarnations?

A. list incarnation of database

373.Which of the following Oracle features utilize利用 the undo tablespace? (Choose all that apply)

A. Flashback Query 闪回查询

B. Flashback Drop

C. Flashback Table 闪回表

D. Flashback Database

E. Transaction Processing 事务处理

F. Recycle Bin

Answer: ACE

Transaction Processing事务处理会在undo和redo产生数据。

flashback drop:利用recyelebin 回收站原理

flashback table TEST10 to before drop [rename to test11];可以重命名

flashback query ,依赖undo数据,先查询,在做insert

insert into test10 select * from test10 as of timestamp to_timestamp('2013-09-23 11:52:06','yyyy-mm-dd hh24:mi:ss');

flashback table 依赖undo块

flashback table scott.test10 to scn 1952615

insert into test10 select * from scott.test10 as of scn 1952615;

flashback database DDL语句,依赖闪回区的闪回日志

flashback database to timestamp to_timestamp('2013-09-23 15:09:52','yyyy-mm-dd hh24:mi:ss');时间减一秒。

374.Which of the following statements are true regarding the Recycle Bin? (Choose all that apply.)

A. The Recycle Bin is a physical storage area for dropped objects.

B. The Recycle Bin is a logical container for dropped objects.

C. The Recycle Bin stores the results of a Flashback Drop operation.

D. The objects in the Recycle Bin are stored in the tablespace in which they were created.

Answer: BD

如果不启用回收站,则删除表时,与该表及其从属对象关联的空间会立即变为可回收(也就是说,该空间可用于其它对象)。

如果启用了回收站,则删除表时,与该表及其从属对象关联的空间不会立即变为可回收,即使该空间确实显示在DBA_FREE_SPACE中。

相反,会在回收站中引用删除的对象,这些对象仍属于其各自的所有者。在空间不紧张时,绝不会把回收站对象使用的空间自动回收。

这样,你就能在尽可能长的期限内恢复回收站对象。

将删除的表“移动”到回收站时,将使用系统生成的名称对该表及其关联对象和约束条件进行重命名。重命名惯例如下:BIN$unique_id$version。

其中,unique_id是该对象的全局唯一标识符,包含26 个字符,用于在所有数据库之间唯一地标识回收站名称,而version是数据库分配的版本号。

回收站本身是一个数据字典表,用于维护已删除对象的原始名称与各自系统生成名称之间的关系。可使用DBA_RECYCLEBIN视图查询回收站。

3 Flashback Drop

Flashback Drop 是从Oracle 10g 开始出现的,用于恢复用户误删除的对象(包括表,索引等),

这个技术依赖于Tablespace Recycle Bin(表空间回收站),这个功能和windows的回收站非常类似。

Flashback 不支持sys用户. system表空间下的对象,也不能从回收站里拿到。

故使用SYS 或者SYSTEM用户登陆时, show recyclebin 为空。

Flashback Drop 是基于Tablespace RecycleBin 来实现恢复的。

它只支持闪回与table 相关连的对象,比如表,索引,约束,触发器等。

如果是函数或者存储过程等,就需要使用Flashback Query来实现。

3.1 Tablespace Recycle Bin

从Oracle 10g 开始, 每个表空间都会有一个叫作回收站的逻辑区域,当用户执行drop命令时,

被删除的表和表的关联对象( 包括索引, 约束,触发器,LOB段,LOB index 段) 不会被物理删除,

这些对象先转移到回收站中,这就给用户提供了一个恢复的可能。

初始化参数recyclebin 用于控制是否启用recyclebin功能,缺省是ON, 可以使用OFF关闭。

TEST@orcl2> show parameter recycle;

NAME TYPE VALUE

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

buffer_pool_recycle string

db_recycle_cache_size big integer 0

recyclebin string on

禁用该功能:

SQL> alter system set recyclebin=off;

SQL> alter system set recyclebin=on;

SQL> alter session set recyclebin=off;

SQL> alter session set recyclebin=on;

表空间的Recycle Bin 区域只是一个逻辑区域,而不是从表空间上物理的划出一块区域固定用于回收站,

因此Recycle Bin是和普通对象共用表空间的存储区域,

或者说是Recycle Bin的对象要和普通对象抢夺存储空间。

当发生空间不够时,Oracle会按照先入先出的顺序覆盖Recycle Bin中的对象。

如果表空间的数据文件打开了自动扩展,则在数据文件扩展之前,不会清除recyclebin中的内容。

每次扩展的时候,Oracle实际上是执行了alter database datafile resize命令。

也可以手动的删除Recycle Bin占用的空间:

1). Purge tablespace tablespace_name:

用于清空表空间的Recycle Bin

2). Purge tablespace tablespace_name user user_name:

清空指定表空间的Recycle Bin中指定用户的对象

3). Purge recyclebin:

删除当前用户的Recycle Bin中的对象

4). Purge dba_recyclebin:

删除所有用户的Recycle Bin中的对象,该命令要sysdba权限

5). Drop table table_name purge:

删除对象并且不放在Recycle Bin中,

即永久的删除,不能用Flashback恢复。

6). Purge index recycle_bin_object_name:

当想释放Recycle bin的空间,

又想能恢复表时,可以通过释放该对象的index所占用的空间来缓解空间压力。

因为索引是可以重建的。

375.Over the course of a day, a department performed multiple DML statements (inserts, updates, deletes)

on multiple rows of data in multiple tables. The manager would like a report showing the time, table name, and DML type for all changes that were made. Which Flashback technology would be the best choice to produce the list?

C. Flashback Transaction Query

Flashback Transaction Query也是使用UNDO信息来实现。利用这个功能可以查看某个事务执行的所有变化,它需要访问flashback_transaction_query 视图,这个视图的XID列代表事务ID,利用这个ID可以区分特定事务发生的所有数据变化。

376.A user named Arren is executing this query:

select table_name, operation, undo_sql

from

flashback_transaction_query t,

(select versions_xid as xid

from employees versions between scn minvalue

and maxvalue

where employee_id = 123) e

where t.xid = e.xid;

When the query runs, he receives an ORA-01031: insufficient privileges error. Since the user owns the

employees table, you know that it is not the problem. Which of the following SQL statements will correct

this problem?

A. GRANT SELECT ANY TRANSACTION TO ARREN;

Answer: A

此题为用户没有足够的权限来查询flashback_transaction_query这张表。

实验验证:

sys@TEST1107> conn scott/tiger

Connected.

scott@TEST1107> select xid from flashback_transaction_query where rownum<5;

select xid from flashback_transaction_query where rownum<5

*

ERROR at line 1:

ORA-01031: insufficient privileges

scott@TEST1107> conn /as sysdba

Connected.

sys@TEST1107> grant select any transaction to scott;

Grant succeeded.

sys@TEST1107> conn scott/tiger

Connected.

scott@TEST1107> select xid from flashback_transaction_query where rownum<5;

XID

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

01000900DA0A0000

01000900DA0A0000

01000900DA0A0000

01000900DA0A0000

[oracle@rtest ~]$ oerr ora 01031

01031, 00000, "insufficient privileges"

// *Cause: An attempt was made to change the current username or password

// without the appropriate privilege. This error also occurs if

// attempting to install a database without the necessary operating

// system privileges.

// When Trusted Oracle is configure in DBMS MAC, this error may occur

// if the user was granted the necessary privilege at a higher label

// than the current login.

// *Action: Ask the database administrator to perform the operation or grant

// the required privileges.

// For Trusted Oracle users getting this error although granted the

// the appropriate privilege at a higher label, ask the database

// administrator to regrant the privilege at the appropriate label.

[oracle@rtest ~]$

377.AUM has been retaining about 15 minutes worth of undo. You want to double the retention period, but

not at the expense of new transactions failing. 但是不能以新事物失败为代价 You decide to alter the system to set the parameter

UNDO_RETENTION=18000. However, AUM still retains only about 15 minutes worth of undo. What is the

problem? (Choose the best answer.)

保留时间延长到18000

C. The undo tablespace is not set to auto-extend.

题中说希望把保留时间变为30分钟,但是不能让新的事务失败为代价。

如果想把时间变为30分钟,有两个方法,一个是设置RETENTION GUARANTEE,确保保留时间为30分钟。

一个是让undo表空间自动增长。

而设置RETENTION GUARANTEE,但undo表空间是固定尺寸的情况下,会让新的事务失败。

故最好的办法就是让undo表空间自动增长。

378.In order to perform Flashback Transaction Query operations, which of these steps are required?

(Choose all that apply.)

A. Ensure that database is running with version 10.1 compatibility.

B. Enable Flashback Logging.

C. Enable Supplemental Logging.

D. Ensure that the database is running with version 10.0 compatibility.

E. Ensure that the database is in ARCHIVELOG mode

Answer: CD

supplemental logging作用

全库级别的supplemental logging和表级别的supplemental logging 各种组合的效果总结如下:

(1)、当全库supplemental logging以minimal模式开启时(此时IMU会被禁掉):

(a) 如果不对目标表单独开启supplemental logging,则Oracle在redo中并不会额外的记录主键列和其他列的值;

(b) 如果对目标表单独开启主键模式的supplemental logging,则又细分为如下两种情况:

(b1)如果目标表有主键,则Oracle会在redo中额外的记录主键列的值;

(b2)如果目标表没有主键,则Oracle会在redo中额外的记录所有列的值;

(2)、当全库supplemental logging以主键模式开启(此时IMU会被禁掉)且目标表并没有单独开启任何模式的supplemental logging时:

(a) 如果目标表有主键,则Oracle会在redo中额外的记录主键列的值;

(b) 如果目标表没有主键,则Oracle会在redo中额外的记录所有列的值;

(3)、当把全库supplemental log禁掉后(此时IMU会被开启),不管目标表是否单独开启主键模式的supplemental logging,Oracle在redo中都并不会额外的记录主键列和其他列的值。

Configuring Your Database for Oracle Flashback Transaction Query

To configure your database for the Oracle Flashback Transaction Query feature, you or your database administrator must:

Ensure that Oracle Database is running with version 10.0 compatibility.

Enable supplemental logging:

ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

379.Users notify you that their application is failing every time they try to add new records. Because of

poor application design, the actual ORA error message is unavailable. What might be the problem?

(Choose the best answers.)

A. The application user has exceeded their undo quota. 超出undo配额

E. The RETENTION GUARANTEE option is set on the undo tablespace. undo表空间上设置了 保留参数

Answer: AE

380.Which of the following statements best describes Flashback Versions Query?

D. Flashback Versions Query is used to view all version changes on rows that existed between two points

in time.

Answer: D

闪回版本查询,允许查看一个行所有提交的版本,包括创建和结束每个版本的时间戳

select versions_xid,versions_starttime,versions_endtime.. from emp versions between timestamp (systimestamp- 1/24) and systimestamp where empno=8000

在最近一个小时内存在的员工编号为8000 的所有版本

381.Which pseudocolumn伪列 could you use to identify a unique row in a Flashback Versions Query?

C. VERSIONS_XID 创建此版本的行的事务的唯一标识符

382.Which of the following can be used in conjunction with a Flashback Versions Query to filter the results?

(Choose all that apply.)

过滤条件

A. A range of SCN values SCN范围

C. A starting and ending timestamp 时间戳范围

383.At the request of a user, you issue the following command to restore a dropped table: flashback table

"BIN$F2JFfMq8Q5unbC0ceE9eJg==$0" to before drop; Later, the user notifies you that the data in the

table seems to be very old and out of date.

What might be the problem?

C. A previous Flashback Drop operation had been performed, resulting in multiple versions of the table

being stored in the Recycle Bin.

先前执行了闪回删除操作,在回收站中有多个表版本

select object_name,original_name,type from user_recyclebin

(384)Which of the following statements is true regarding the VERSIONS BETWEEN clause?

A. The VERSIONS BETWEEN clause may be used in DML statements.

B. The VERSIONS BETWEEN clause may be used in DDL statements.

C. The VERSIONS BETWEEN clause may not be used to query past DDL changes to tables.

D. The VERSIONS BETWEEN clause may not be used to query past DML statements to tables.

答案:(C)

解析:

A(X),B(X),VERSIONS BETWEEN子句只能用于SELECT语句,查询过去对表的DML操作

385.Which of the following statements is true regarding implementing a Flashback Table recovery?

D. Flashback Table recovery is completely dependent on the availability of undo data in the undo

tablespace.

Answer: D

A(X),SCN肯定会用到,即使没显式使用,Oracle自己也会使用

B(X),任何情况下都需要开启行移动

386.You have just performed a FLASHBACK TABLE operation using the following command:

flashback table employees to scn 123456;

The employees table has triggers associated with it. Which of the following statements is true regarding

the state of the triggers during the Flashback Table operation?

A. All the triggers are disabled.

FLASHBACK TABLE语句

(387)Which method could be utilized to identify both DML operations and the SQL statements needed to undo those operations for a specific schema owner?(Choose all that apply.)

B. Query FLASHBACK_TRANSACTION_QUERY for TABLE_NAME,OPERATION,and UNDO_SQL.Limit rows by START_SCN and TABLE_OWNER.

C. Query FLASHBACK_TRANSACTION_QUERY for TABLE_NAME,OPERATION,and UNDO_SQL.Limit rows by START_TIMESTAMP and TABLE_OWNER.

答案:(B、C)

解析:

根本没有DBA_TRANSACTION_QUERY这个视图, A, D答案完全一样

START_SCN和START_TIMESTAMP都是指一个时间点。

FLASHBACK_TRANSACTION_QUERY

388.Flashback Database relies on which technologies to recover to a point in time?

闪回数据库依赖于哪一项技术恢复到固定时间点

B. Flashback logs in the flash recovery area

闪回区的闪回日志

389.The _______ writes the Flashback Database logs in the flash recovery area.

D. RVRW

配置闪回数据库步骤如下:

(1)配置快速恢复区。

(2)使用初始化参数DB_FLASHBACK_RETENTION_TARGET设置保留时间目标,指定可以闪回数据库的时间上限,单位为分钟。上图例子中指定2880分钟,2天。这个参数仅仅是一个目标值,而不保证一定可以达到,闪回时间间隔取决于快速恢复区保留了多少闪回数据。

(3)使用以下命令启用闪回数据库:

ALTER DATABASE FLASHBACK ON;

在启用闪回数据库之前,数据库必须配置为归档模式。

使用下面语句查询是否启用了闪回数据库:

SELECT flashback_on FROM v$database;

使用ALTER DATABASE FLASHBACK OFF命令禁用闪回数据库,同时自动删除闪回日志。

注意:数据库只能在mount in exclusive模式下启用闪回数据库。

例子:配置闪回数据库

SQL> select flashback_on from v$database;

当启用闪回数据库,RVWR(Flashback Write)后台进程启动。这个后台程序从闪回缓冲区按顺序将闪回数据库数据写到闪回日志,闪回日志循环使用。当发出FLASHBACK DATABASE命令,使用闪回日志将数据块还原到之前的映像,使用重做数据前滚到指定的时间点。

启用闪回数据库的开销取决于读/写的混合数据库负载。由于查询不需要记录任何闪回数据,写密集型的负载越大,打开闪回数据库的开销越高。

390.Which of these are valid Flashback Database recovery point parameters? (Choose all that apply.)

A. SCN

B. Timestamp

C. Named recovery point

391.When setting up the Flashback Data Archive, which of these key parameters are required? (Choose

all that apply.)

A. Tablespace name 表空间名字

C. Retention 保留期限

392.To clean up old records that are in a Flashback Data Archive and are past the retention period, what must the DBA do?

C. Nothing; expired rows are automatically removed.

393.Which of the following initialization parameters have been deprecated in Oracle 11g because of the

introduction of the Automatic Workload Repository? (Choose all that apply.)

A. BACKGROUND_DUMP_DEST

B. FOREGROUND_DUMP_DEST

C. CORE_DUMP_DEST

D. USER_DUMP_DEST

E. DIAGNOSTIC_DEST

F. All of the above

Answer: ACD

394.Which of the following statements is true regarding the initialization parameter DIAGNOSTIC_DEST?

The default value is the value of the environment variable $ORACLE_HOME; if $ORACLE_HOME isn't

set,z

B. then it is set to $ORACLE_HOME

Oracle Database 11g的FDI(Fault Diagnosability Infrastructure)是自动化诊断方面的又一增强。

FDI的一个关键组件是自动诊断库(Automatic Diagnostic Repository-ADR)。

在Oracle Database 11g之前,Oracle的各类跟踪文件、日志文件等诊断文件的存储位置并不统一,现在在FDI的基础架构之上,Oracle开始统一规划这些文件的存储,ADR之于诊断文件,就类似于OFA(Optimal Flexible Architecture )之于数据库文件,FRA(Flash Recovery Area)之于备份文件。

ADR的路径被称为ADR BASE,这个位置由一个新的初始化参数DIAGNOSTIC_DEST决定。

SQL> show parameter diagnostic_dest

NAME TYPE VALUE

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

diagnostic_dest string /opt/oracle

这个参数的缺省值和环境变量ORACLE_BASE有关:

■ 如果设置了 ORACLE_BASE 则 DIAGNOSTIC_DEST = ORACLE_BASE

■ 如果未设置 ORACLE_BASE ,则 DIAGNOSTIC_DEST = ORACLE_HOME/log

我们可以简单看一下ADR BASE的目录结构

395.Which of these formats represents the correct hierarchy for the ADR?

C. <diagnostic_dest>/diag/rdbms/<dbname>/<instname>

现在一目了然,包括ASM、CRS等组件日志都被ADR囊括其中。

对于FRA,通过V$FLASH_RECOVERY_AREA_USAGE视图,Oracle可以知道闪回区的使用情况.

现在对于ADR,Oracle可以通过一个新的视图v$diag_info来查询自动诊断库的信息:

SQL> select * from v$diag_info;

INST_ID NAME VALUE

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

1 Diag Enabled TRUE

1 ADR Base /opt/oracle

1 ADR Home /opt/oracle/diag/rdbms/eygle/eygle

396.Which of the following are not fundamental tasks of the Support Workbench? (Choose all that apply.)

A. View long-running SQL workloads

B. View problem details

C. Gather additional diagnostic information

D. Create a Service Request

E. Clean up incident data after upload to Oracle Support

Answer: AE

397.Which of the following tasks does the tool Incident Packaging Service (IPS) perform?

B. Identifies all files associated with a critical error and adds them to a zip file to be sent to Oracle

Support.

事件打包服务( IPS) 工具执行以下哪一个任务?

B.标识与严重错误相关的所有文件,并将它们添加到一个zip文件后发送到Oracle支持网站

398.Choose the correct order to package and upload data for an incident to Oracle Support.

D. Create new package, view contents, view manifest清单, schedule计划表

399.Which of the following is not an advantage of block media recovery (BMR)?

不正确的是

B. Datafiles remain offline while corrupt blocks are repaired.

400.Which of the following methods can be used to detect block corruption?

A. ANALYZE operations

B. dbv

C. SQL queries that access the potentially corrupt block

D. RMAN

E. All of the above

Answer: E

DBV工具的使用

DBV是一个外部命令,能够执行物理数据结构的完整性检查。DBV只能检查可缓存管理的块(数据块),所以只能用于数据文件,不支持控制文件和重做日志文件的块检查。DBV使用于offline或者online的数据文件,也可也验证备份文件,但是备份文件只能是rman的copy命令或者操作系统的cp(win下是copy)命令备份的数据文件。控制文件和重做日志文件的检查可以用DBMS_HM包完成。 DBV有两种命令行接口,一是验证数据文件的数据块,二是验证段。下面分别做测试:

DBV除了能检查有内容的数据块,可以检查空数据块,这充分证明了dbv是从物理层面上验证数据块的完整性。

401.Which of the following are correct about block media recovery? (Choose all that apply.)

A. Physical and logical block corruption is recorded automatically in V$DATABASE_BLOCK_

CORRUPTION.

C. Physical corruptions are repairable by BMR.

关于RMAN的块恢复。Block是oracle数据库最小恢复单位。鉴于此,BMR可以大大缩短恢复的时间,另外,在进行BMR时不需要停掉数据库,可以直接在数据库open状态对数据文件进行恢复,只是需要恢复的块被锁定无法访问,可以说对应用的影响非常小。

何时需要进行BMR?

Block media recovery 不适合用在丢失数据的起点的情况,比如数据文件丢失了,这种情况下做数据文件的介质恢复会是最好的选择。BMR并不是用来取代传统方法的,而是有益的补充。

大多数情况下,数据库将一个block打上坏块的标记,那么对整个数据库来说这个块都是不可以用的,数据库会offline该坏块,阻止用户对该块进行访问。而在随后对该块的读取都会出现错误,大部分会报I/O错误,直到该坏块被修复。这个时候你只能使用BMR对坏块进行修复(之所以说你只能是因为你的数据库不能因为这个而停止服务)。一般我们会在以下文件中发现坏块报告:

1.Error messages in standard output;

2.Alert.log文件中

3.用户的trace文件

4.在使用 analyze table 和 analyze index时可能会出现

5.在使用 dbverify工具对数据文件进行检查时

6.第三方的介质管理软件中

以下是user trace文件中出现的坏块错误:

ORA-01578: ORACLE data block corrupted (file # 7, block # 3)

ORA-01110: data file 7: '/oracle/oradata/trgt/tools01.dbf'

ORA-01578: ORACLE data block corrupted (file # 2, block # 235)

ORA-01110: data file 2: '/oracle/oradata/trgt/undotbs01.dbf'

一旦发现有坏块的存在,就可以使用blockrecover对坏块进行恢复

Blockrecover

datafile 7 block 3

datafile 2 block 235;

Blockrecover是基于redo的,如果在恢复时,发现找不到redo,则恢复不一定会成功。这里说不一定是因为在blockrecover过程中,所有的block在blockrecover过程中都是独立的,不会去与其他文件的文件进行比较的,所以blockrecover都是成功的。但在blockrecover之后,RMAN会将进行后续的检查工作,这个时候,如果RMAN发现该块的ckp与其他不一致,则rman会自动查找相关的redo,如果该block有被format过,那么则会主动忽略丢失的redo,则恢复成功,如果不是这样则会恢复失败。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle ocp