Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖
楼主: laoguo
查看: 25527| 回复: 118
20#
发表于 2016-7-21 10:25:35
30:
在RMAN 中使用list 命令,哪两个部分的信息可以被列出?
A.存储在恢复目录的脚本
B.可以从磁盘上删除的备份
C.过期的备份集合和镜像拷贝
D.在RMAN资料库中那些不属于AVAILABLE状态的备份。

答案:AD

这里主要是考察list和report命令的具体使用的区别。
LIST BACKUP;--列出数据库所有备份信息,其中status部分信息 可以看出是否是AVAILABLE状态,D对


查看指定的dbf数据文件备份:LIST BACKUP OF DATAFILE n(数据文件序列号);

LIST BACKUP OF DATABASE; 查看全库备份

LIST BACKUP OF TABLESPACE USERS;

LIST BACKUP OF CONTROLFILE;

LIST BACKUP OF ARCHIVELOG ALL;

LIST DEVICE TYOE DISK BACKUP;列出某个设备上的所有信息

LIST ARCHIVELOG ALL;列出当前数据库所有归档

list expired archivelog all; -列出无效归档

LIST EXPIRED BACKUP;列出无效备份;

list all script names; --查看catalog 中所有保存脚本的名字。然后再list scipt xxxx可查看具体脚本内容,A对



===
REOPRT 命令用于当前备份信息的分析:

REPORT SCHEMA AT TIME 'SYSDATE-7';--查看7天前的数据库模式

REPORT SCHEMA :报告模式命令不包含最后一次数据文件和临时文件备份的日期。此外,报告模式命令不会报告和每个RMAN备份相关的检查点的SCN

REPORT NEED BACKUP;--查看所有需要备份的文件

report unrecoverable database;--报告需要备份的文件由于不可恢复的操作(nologing,数据库结构的改变,哪些数据文件的备份已经失效)

REPORT NEED BACKUP TABLESPACE SYSTEM;--查看指定表空间是否需要备份

REPORT OBSOLETE;查看过期备份,过期备份用report命令查看,B,C错,此处B和C是一个意思
obsolete状态的备份在用来恢复时,可能成功,可能不成功




===
参考官方文档:http://docs.oracle.com/cd/E11882 ... nta027.htm#RCMRF132
http://docs.oracle.com/cd/E11882 ... ta2006.htm#RCMRF147

回复 只看该作者 道具 举报

19#
发表于 2016-7-21 10:25:02
27:
Examine the following scenario:
-Database is running in ARCHIVELOG mode.
-Complete consistent backup is taken every Sunday.
-On Tuesday the instance terminates abnormally because the disk on which control files are located gets corrupted
The disk having active online redo log files is also corrupted.
The hardware is repaired and the paths for online redo log files and control files are still valid. Which option would you use to perform the recovery of database till the point of failure?
A. Restore the latest whole backup, perform complete recovery, and open the database normally
B. Restore the latest whole backup, perform incomplete recovery, and open the database with the
RESETLOGS option.
C. Restore the latest backups control file, perform complete recovery, and open the database with the RESETLOGS option.
D. Restore the latest backup control file, perform incomplete recovery using backup control file, and open the database with the RESETLOG option.
Answer: D

27:
检查下列场景:
-数据运行在归档模式
-每周6完成一致性备份
-在周3,由于磁盘上的控制文件损坏导致实例异常中止。磁盘上的活动redo 日志文件也损坏了。磁盘已经被修复,但是在线redo日志和控制文件仍然无效。
哪个选项可以使用来执行数据库恢复到故障点?
A.重建最新的备份,执行完全回复, 然后正常打开数据库。
B .重建最新的备份,执行不完全回复, 然后以RESETLOGS打开数据库
C.重建最新的备份控制文件,执行完全回复,然后以RESETLOGS打开数据库
D. 重建最新的备份控制文件,执行不完全回复,然后以RESETLOGS打开数据库


答案D

由于丢失了在线redo,只能进行不完全恢复,并且打开的时候要以RESETLOGS方式打开。由于控制文件也损坏,在恢复之前要使用备份的控制文件重建,之后再进行不完全恢复。

恢复步骤:
STARTUP FORCE NOMOUNT;
RMAN> RUN
{
  RESTORE CONTROLFILE FROM AUTOBACKUP;
  ALTER DATABASE MOUNT;
  SET UNTIL SEQUENCE 1124 THREAD 1;
  RESTORE DATABASE;
  RECOVER DATABASE;
}
ALTER DATABASE OPEN RESETLOGS;


参考官方文档灾难恢复:
http://docs.oracle.com/cd/E25054 ... madvre.htm#i1006453

28:
You are managing a 24*7 database. The backup strategy for the database is to perform
user-managed backups. Identify two prerequisites to perform the backups. (Choose two.)
A. The database must be opened in restricted mode.
B. The database must be configured to run in ARCHIVELOG mode.
C. The tablespaces are required to be in backup mode before taking the backup.
D. The tablespaces are required to be in read-only mode before taking the backup
Answer: BC

28:
你管理一个24*7小时的数据库。备份策略是一个用户管理的备份。定义2个执行备份的先决条件(选择2个)
A.数据必须以restricted 模式打开
B.数据库必须运行在ARCHIVELOG 模式
C.在备份的之前,表空间必须置为备份模式
D.在备份之前,表空间必须置为只读模式

答案:BC

此题的考点是使用手动备份管理备份。

7*24小时的数据库,不能进行冷备份(关闭数据库),所以要开启归档,并且数据库要在打开状态。B对,A错

使用手动备份的时候,如果表空间是在线的,需要将表空间置为备份模式:
ALTER TABLESPACE ... BEGIN BACKUP
备份完成后,再取消备份模式:
ALTER TABLESPACE ... END BACKUP 或者ALTER DATABASE END BACKUP
C对

热备份对表空间无影响,在的表空间可以在只读或者读写下进行备份,不用改为只读模式,D错


备份只读表空间可以直接使用cp物理文件,exdp导出元数据的方式进行。如果在备份模式的时候,实例异常终止,需要将数据库启动到moun模式,运行ALTER DATABASE END BACKUP 之后再打开数据库。

--一般情况下是使用RMAN自动备份工具,很少使用手动管理的方式。

参考官方文档:
https://docs.oracle.com/cd/E1188 ... backup.htm#BRADV201

回复 只看该作者 道具 举报

18#
发表于 2016-7-21 10:24:44
23:
You realize that the control file is damaged in your production database. After restoring the control file from autobackup, what is the next step that you must do to proceed with the database recovery?
A. Mount the database
B. Open the database in NORMAL mode
C. Open the database in RESTRICTED mode
D. Open the database with the RESETLOGS option
Answer: A
答案解析:

23:你发现在生产数据库上的控制文件损坏了,再从备份中重建控制文件之后,下一步应该做什么来进行数据库的恢复?
A.挂载数据库
B.以NORMAL模式打开数据库
C.以RESTRICTED模式打开数据库
D.以RESETLOGS方式打开数据库

答案A
在使用备份重建控制文件之后,你需要使用这个重建的控制文件挂载数据库,然后执行recover,最后以RESETLOGS的方式打开数据库。所以重建之后,下一步是mount数据库。选A


--丢失数据文件,无法正常关闭,需要abort关闭数据库
恢复操作过程如下:
1. startup nomount;
2. restore controlfile from autobackup;
3. alter database mount;
4.recover database;
5. alter database open resetlogs;

参考官方文档:https://docs.oracle.com/cd/E1188 ... ta2008.htm#RCMRF149



24:
What two are the prerequisites for enabling Flashback Database? (Choose two)
A. The database must be in ARCHIVELOG mode
B. The database must be in MOUNT EXCLUSIVE mode
C. The database must be opened in RESTRICTED mode
D. The database instance must be started in the NOMOUNT state
E. The database instance must have the keep buffer pool defined
Answer: AB

24 : 下列哪2个是开启闪回数据库的先决条件?(选择2个选项)
A.数据库必须是归档模式
B.数据库必须以独占形式mount
C.数据库必须以RESTRICTED模式打开
D.数据库必须启动到NOMOUNT状态
E.数据库实例必须定义保留池

答案:AB

答案解析:
按以下步骤配置闪回数据库:
1.配置快速恢复区。(DBCA建库时会默认配置)

2.在启用闪回数据库之前,必须开启归档(A对)
因为闪回数据库类似于对数据库进行DBPITR时间点的恢复。RMAN使用闪回日志来回滚到一个目标点或SCN,其需要归档日志来恢复数据库的保证一致性。

3.使用DB_FLASHBACK_RETENTION_TARGET初始化参数设置保留目标。此参数只是一个目标,并不提供任何保证。闪回时间间隔取决于快速恢复区中保存的闪回数据量(查询V$FLASHBACK_DATABASE_LOG )。
4.必须在MOUNT状态下,使用以下列命令启用数据库:
ALTER DATABASE FLASHBACK ON;

5.在MOUNT和OPEN模式下使用下列命令来关闭闪回数据库
ALTER DATABASE FLASHBACK OFF;
--会自动删除所有现有的闪回数据库日志。

查询当前闪回数据库状态:
SELECT flashback_on FROM v$database;

只有在独占模式下装载数据库后才能启用闪回数据库,在打开状态下则不可以,B对CD错。
E和闪回数据库无关,错

参考:https://docs.oracle.com/cd/E1188 ... lashdb.htm#BRADV594
http://docs.oracle.com/cd/E11882 ... nta023.htm#RCMRF194

回复 只看该作者 道具 举报

17#
发表于 2016-7-21 10:24:03
23:
You realize that the control file is damaged in your production database. After restoring the control file from autobackup, what is the next step that you must do to proceed with the database recovery?
A. Mount the database
B. Open the database in NORMAL mode
C. Open the database in RESTRICTED mode
D. Open the database with the RESETLOGS option
Answer: A
答案解析:

23:你发现在生产数据库上的控制文件损坏了,再从备份中重建控制文件之后,下一步应该做什么来进行数据库的恢复?
A.挂载数据库
B.以NORMAL模式打开数据库
C.以RESTRICTED模式打开数据库
D.以RESETLOGS方式打开数据库

答案A
在使用备份重建控制文件之后,你需要使用这个重建的控制文件挂载数据库,然后执行recover,最后以RESETLOGS的方式打开数据库。所以重建之后,下一步是mount数据库。选A


--丢失数据文件,无法正常关闭,需要abort关闭数据库
恢复操作过程如下:
1. startup nomount;
2. restore controlfile from autobackup;
3. alter database mount;
4.recover database;
5. alter database open resetlogs;

参考官方文档:https://docs.oracle.com/cd/E1188 ... ta2008.htm#RCMRF149



24:
What two are the prerequisites for enabling Flashback Database? (Choose two)
A. The database must be in ARCHIVELOG mode
B. The database must be in MOUNT EXCLUSIVE mode
C. The database must be opened in RESTRICTED mode
D. The database instance must be started in the NOMOUNT state
E. The database instance must have the keep buffer pool defined
Answer: AB

24 : 下列哪2个是开启闪回数据库的先决条件?(选择2个选项)
A.数据库必须是归档模式
B.数据库必须以独占形式mount
C.数据库必须以RESTRICTED模式打开
D.数据库必须启动到NOMOUNT状态
E.数据库实例必须定义保留池

答案:AB

答案解析:
按以下步骤配置闪回数据库:
1.配置快速恢复区。(DBCA建库时会默认配置)

2.在启用闪回数据库之前,必须开启归档(A对)
因为闪回数据库类似于对数据库进行DBPITR时间点的恢复。RMAN使用闪回日志来回滚到一个目标点或SCN,其需要归档日志来恢复数据库的保证一致性。

3.使用DB_FLASHBACK_RETENTION_TARGET初始化参数设置保留目标。此参数只是一个目标,并不提供任何保证。闪回时间间隔取决于快速恢复区中保存的闪回数据量(查询V$FLASHBACK_DATABASE_LOG )。
4.必须在MOUNT状态下,使用以下列命令启用数据库:
ALTER DATABASE FLASHBACK ON;

5.在MOUNT和OPEN模式下使用下列命令来关闭闪回数据库
ALTER DATABASE FLASHBACK OFF;
--会自动删除所有现有的闪回数据库日志。

查询当前闪回数据库状态:
SELECT flashback_on FROM v$database;

只有在独占模式下装载数据库后才能启用闪回数据库,在打开状态下则不可以,B对CD错。
E和闪回数据库无关,错

参考:https://docs.oracle.com/cd/E1188 ... lashdb.htm#BRADV594
http://docs.oracle.com/cd/E11882 ... nta023.htm#RCMRF194

回复 只看该作者 道具 举报

16#
发表于 2016-7-21 10:23:43
21:
On Friday at 11:30 am you decided to flash back the database because of a user error that occurred at 8:30 am.
Which option must you use to check whether a flashback operation can recover the database to the specified time?
A. Check the alert log file
B. Query the V$FLASHBACK_DATABASE_LOG view
C. Query the V$RECOVERY_FILE_DEST_SIZE view
D. Query the V$FLASHBACK_DATABASE_STAT view
E. Check the value assigned for the UNDO_RETENTION parameter
Answer: B

在周五的上午11:30, 你决定执行一个闪回数据库,因为在8:30发生了一个用户错误。
哪一个选项来检查闪回操作可以将数据库恢复到的指定时间?
A.检查 alert log
B.检查V$FLASHBACK_DATABASE_LOG 视图
C.检查V$RECOVERY_FILE_DEST_SIZE 视图
D.检查V$FLASHBACK_DATABASE_STAT 视图
E.检查UNDO_RETENTION 分配的值

答案:B

首先可以排除A,E
A.是告警日志,和检查数据库时间无关,错
E.是undo保留时间的参数,和闪回数据库无关,错

然后再看几个视图的用途:
C. V$RECOVERY_FILE_DEST_SIZE没有这个视图,只有 V$RECOVERY_FILE_DEST是磁盘信息和当前快速恢复区使用情况。C错

D. V$FLASHBACK_DATABASE_STAT这个视图显示监控 闪回数据日志的I/O开销(数据量)。这个视图也根据以往的工作负载评估闪回空间的需求。和是否能闪回无关,错

B. V$FLASHBACK_DATABASE_LOG 视图显示了闪回数据的信息。使用此视图可以帮助估计当前工作负荷所需的闪回空间量。还可以查出能闪回的最下近似SCN(OLDEST_FLASHBACK_SCN字段)。
所以查看这个视图可以确定是否可以闪回到指定的时间点。B对

参考官方文档:
http://docs.oracle.com/cd/E11882 ... nta023.htm#RCMRF194


22:
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
Answer: B

22:当执行例行检查恢复目录的时候,你发现恢复目录数据库的空间不足了,没有其他的选择来增加空间。但是,你有一个其他的数据库由足够的空间,你想将现在的恢复目录移动到这个数据库。

在移动恢复目录的时候,需要考虑的选项如下:
1.使用oracle expdp工具导出恢复目录
2.在另外的数据库中创建一个恢复目录用户,并赋予必要的权限
3.使用create catalog 命令创建恢复目录
4.使用相应的impdp工具将恢复目录导入到另外的数据库。
5.使用REGISTER DATABASE命令在新的恢复目录数据库注册目标数据库。

确定移动恢复目录的正确顺序

答案:B

此处是使用expdp 工具完成逻辑备份,然后导入到新数据库完成移动的过程,此过程和使用RMAN命令IMPORT不同,不需要使用CREATE CATALOG命令创建目录,因为导出的备份中包含,导入的时候会重建恢复目录。

使用此方式移动恢复目录的步骤:
1.导出恢复目录数据。
2.在导入的数据库上建立恢复目录用户,授予必要的权限。
3.然后导入。

参考官方文档:
http://docs.oracle.com/cd/E25054 ... mcatdb.htm#CHDEBDJG

回复 只看该作者 道具 举报

15#
发表于 2016-7-20 09:54:52
18:
Examine the following command that is used to duplicate a database on the same host:
RMAN> RUN
{ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO auxdb SKIP READONLY;}
Which two statements describe the effect after the database is duplicated successfully? (Choose two)
A. The data files of the read-only tablespaces in the target database are not duplicated
B. The read-only tablespaces in the target database are still defined in new the database
C. The read-only tablespaces in the target database are changed to online after duplication
D. The data files of the read-only tablespaces in the target database get duplicated
E. The read-only tablespaces in the target database are not defined in the new database
Answer: AB

18:
检查下列在同一主机上进行复制数据库的命令:
RMAN> RUN
{ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO auxdb SKIP READONLY;}
哪2个称述描述了数据库复制成功后的效果?(选择2项)
A.在目标端只读的表空间中的数据文件不会被复制
B.在目标端只读的表空间仍然被定义到新数据库
C.在目标端只读的表空间在复制之后变更为在线
D.在目标端只读的表空间中的数据文件被复制
E. 在目标端只读的表空间不会在新数据库中被定义

答案:AE
SKIP READONLY:用于排除只读表空间数据文件。

排除从目标端当前只读表空间的数据文件,如果不加这个参数,默认是复制当前只读表空间的数据文件。
如果之前是离线的只读表空间,不会包含在复制中(C错)。
注意:只读表空间必须是自闭的,这个参数选项才能正确执行



参考官方文档:http://docs.oracle.com/cd/E11882 ... a020.htm#RCMRF90163

经过实验发现,在复制的时候会跳过只读表空间,复制完成会回执行删除离线和skipped 表空间。只读的表空间在复制后不会存在 ,标准答案是AB,但是做完实验觉得是AE。

19:
You need to perform a block media recovery on the tools01.dbf data file in the SALES database by using Recovery Manager (RMAN).
Which two are the prerequisites to perform this operation? (Choose two)
A. You must configure block change tracking file
B. You must have first level 1 backups for RMAN to restore blocks
C. You must ensure that the SALES database is mounted or open
D. You must have full or level 0 backups for RMAN to restore blocks
E. You must take the tools01.dbf data file offline before you start a block media recovery
Answer: CD

19:你需要使用RMAN,对SALES数据库中的数据文件tools01.dbf执行一个块介质恢复。
其中2个是执行此操作的先决条件?(选择2项)
A.你必须配置块变化跟踪文件
B.你必须有第一个等级1的备份,为重建块使用
C.你必须确保SALES数据库是挂载和打开
D. 你必须有全备或者等级0的备份,为重建块使用
E.在你进行块介质恢复之前,你必须将数据文件tools01.dbf离线

答案CD:

此题考点是,当数据文件上有坏块时,要进行恢复操作
执行块恢复不需要离线数据文件,只对那些需恢复的块进行重建和恢复,在恢复过程中,实际上只有这些块不可用。
使用RMAN命令RECOVER ... BLOCK  进行恢复,默认的首先会从物理备库,然后闪回日志,最后是全备或者等级0的增量备份中寻找完好的块。
在丢失部分redo 的情况下,也可以进行 RMAN块介质恢复。先决条件如下:
1.目标数据库必须在archivelog模式下,必须使用当前控制文件启动在mout或者open模式
2.包含坏块的数据文件,必须有存在全部或者增量为0的备份,并且不是代理拷贝
3.RMAN可以在恢复中只使用归档日志,但是不能使用level1的增量备份。

A.块变化跟踪时为了加快增量备份速度,和块介质恢复无关,错。
B.块介质恢复不需要增量1的备份,需要全备或者增量为0的备份。B错D对。
C.对,必须用当前控制文件mount或打开数据库。
E.块介质恢复不需要离线数据库文件,整个数据文件级别的恢复才需要离线数据文件。
参考:http://docs.oracle.com/cd/E11882 ... lock.htm#BRADV89785




20.You performed the RMAN database backup with the KEEP option. Which two statements are true regarding this backup? (Choose two.)
A. The backup contains data files, the server parameter file, and the control file even if the control file autobackup is disabled.
B. The KEEP option overrides the configured retention policy.
C. The backup contains only data files and archived redo log files.
D. The KEEP option is an attribute of an individual backup piece.
Answer: AB

20.
你使用KEEP选项执行RMAN数据库备份。关于这个备份哪2个称述是正确的?(选择2个)
A.这个备份包含数据文件,参数文件和控制文件,即使自动备份控制文件是禁用的。
B.KEEP选项会覆盖配置的保留策略
C.这个备份仅包含数据文件和归档日志文件
D.KEEP选项是一个单独备份分片的一个属性。
答案:AB

在指定KEEP选项时,RMAN会创建多个备份集。备份数据库文件,归档日志文件,控制文件和参数文件。和自动备份控制文件配置无关(即使配置了,也不会再次自动备份控制文件),A对,C错。

keep选项不能覆盖在快速恢复区内的保留策略(在其他地方是覆盖保留策略的),必须指定备份到其他地方,如果在备份到恢复区时使用keep,会出现一个错误。keep forever 选项必须使用catalog。B对

D.RMAN在keep选项下不会考虑备份分片,在计算备份保留策略时。D错

参考官方文档:http://docs.oracle.com/cd/E18283 ... 643/rcmsubcl011.htm

回复 只看该作者 道具 举报

14#
发表于 2016-7-20 09:54:35
16:
You plan to execute the following command to perform a Flashback Database operation in your
database:
SQL> FLASHBACK DATABASE TO TIMESTAMP (SYSDATE -5/24);
Which two statements are true about this? (Choose two)
A. The database must have multiplexed redo log files
B. The database must be in the MOUNT state to execute the command
C. The database must be in the NOMOUNT state to execute the command
D. The database must be opened in RESTRICTED mode before this operation
E. The database must be opened with the RESETLOGS option after the flashback operation
Answer: BE

16:
你想在数据库中执行下列命令来进行一个闪回数据库的操作:
SQL> FLASHBACK DATABASE TO TIMESTAMP (SYSDATE -5/24);
哪2个陈述是正确的?(选择2个答案)
A.数据库必须有多路复用的 redo log files
B.在执行这个命令的时候,数据库必须是MOUNT状态
C. 在执行这个命令的时候,数据库必须是NOMOUNT状态
D. 在执行这个命令之前,数据库必须以RESTRICTED模式打开
E.在执行闪回操作后,数据库必须使用RESETLOGS选项打开

答案:B,E

闪回数据库:

使用ALTER DATABASE FLASHBACK ON  语句开启数据库闪回特性。开启后就可以使用 FLASHBACK DATABASE 语句将数据库闪回到过去的时间点(SCN) --(相当于完成了快速的不完全恢复)

先决条件:
1.数据库必须运行在归档模式下
2.数据库必须被置为mount状态,不能打开,并且是使用当前的控制文件。不能使用备份或者重建的控制
文件。控制文件被重建后,所有现存的闪回日志信息将丢失。
3.数据库中所有在线的表空间必须是启用闪回数据库的。即所有使用了ALTER TABLESPACE ... FLASHBACK OFF的表空间必须离线



A.多路复用redo file是为了保护redo,于闪回数据库无关,错
C.在执行的时候,必须是mount状态,不能open,所以B对,C,D错
E.由于要闪回到了5小时之前,相当于是进行不完全恢复,所以要使用resetlogs打开数据库

--可以指定TO BEFORE RESETLOGS 直接闪回到最近一次RESETLOGS打开的状态

参考官方文档:http://docs.oracle.com/cd/E11882 ... 9011.htm#SQLRF01801




17:
View the Exhibit and examine the steps that you executed to create a database resource
plan.
Subsequently, you execute the following procedure which results in an error:
SQL> EXECUTE dbms_resources_manager.validate_pending_area ( );
What could be the reason?
Exhibit:

A. The pending area is automatically submitted after the plan creation
B. The procedure must be executed before creating the resources plan directive
C. The SYS_GROUP resource consumer group is not included in the resource plan directive
D. The OTHER_GROUPS resources consumer group is not included in the resource plan directive
Answer: D





17.
查看图例和下面你创建一个数据库资源计划的步骤。

随后,你执行下面存储过程得到了一个错误:
SQL> EXECUTE dbms_resources_manager.validate_pending_area ( );
原因是什么?

A.在计划创建之后,未决域自动的提交
B.这个存储过程必须在创建资源计划指令之前执行
C.SYS_GROUP资源用户组没有被包含到资源计划指令中
D.OTHER_GROUPS资源用户组没有被包含到资源计划指令中

答案:D

这题的考点是资源管理器,首先要知道DRM的三个要素都必须创建在未决域中,然后提交。
也就是说,创建新资源计划,更新现有的计划,或者删除一个资源计划(并未影响当前运行的应用程序)。都必须创建这个未决域,当创建时,会将现存的计划复制到其中,以便更新。一旦你创建了一个未决域。其他用户不能再创建,直到你提交或者清除了未决域.

dbms_resources_manager.validate_pending_area是用来验证未决域的内容,验证之后再使用dbms_resource_manager.submit_pending_area提交(在提交的时候会自动验证,但是分成2步有助于debug)。

一个创建资源计划的步骤:
1.创建未决域
2.创建,修改,或者删除用户组
3.创建资源计划
4.创建资源计划指令
5.验证未决域
6.提交未决域

A.未决域必须手动提交,不会自动提交。错
B.这个存储过程是验证未决域中的修改,所以要在创建资源计划指令后执行。B错

CD选项,这2个组都是不能删除的组,但是SYS_GROUP可以被session-to–consumer组映射规则覆盖(SYS,SYSTEM用户属于SYS_GROUP),所以可以不指定资源计划指令,但是OTHER_GROUPS 必须在每个计划中指定资源计划指令,其不能用过映射规则明确的被分配给会话。C错,D对


答案解析:
参考:http://docs.oracle.com/cd/E11882 ... dbrm.htm#ADMIN11870

回复 只看该作者 道具 举报

13#
发表于 2016-7-20 09:54:15
14:
Which two client requests are captured during database replay Capture? (Choose two)
A. Flashback queries
B. Shared server requests
C. Login and logoff activities of sessions
D. Direct path load of data from external files by using utilities such as SQL *loader
E. Data definition language (DDL) and data manipulation language (DML) operations
Answer: CE
14:在数据库重放捕获的时候,下列哪2个客户端请求被捕获?(选择2项)
A.闪回请求
B.共享服务链接的请求
C.活动会话的登录和登出
D. 直接路径加载外部文件数据,例如SQL*Loader
E.DDL和DML操作

答案 C.E

本地考点为捕获数据库负载

某些类型的用户会话和客户端请求有时可能被捕获为工作负载,但并不支持重放,捕捉这些会话和请求类型的工作量可能会导致在工作负载重放出现错误:

1.直接路径加载外部文件数据,例如SQL*Loader
2. non-sql的 高级排队(AQ)
3.闪回查询
4.基于对象导航的oracle OCI调用
5.不基于SQL的对象访问
6.分布式,JAVA,_XA,XA事务
7. 数据库驻留连接池(DRCP)
8.使用OUT绑定的工作负载
9.多线程服务(MTS)和同步模式设置为object_id的共享服务器的会话
10.被迁移的会话

在重放中出现上述情形的工作负载时,考虑使用过滤来排除这些工作负载。
排除法,选CE
A--3
B--9
D--1
参考官方文档:h ttps://docs.oracle.com/cd/E11882_01/server.112/e41481/dbr_capture.htm#RATUG115



15.
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.
Answer: A


15:你在oracle 数据库11g 创建一个虚拟私有恢复目录。PROD1,PROD2和PROD3 是oracle 10g数据库并注册到恢复目录。拥有恢复目录的用户时CATOWNER,CATOWNER用户,使用11gRMAN来执行下列命令来给新用户VPC1赋权:

RMAN> GRANT CATALOG FOR DATABASE prod1, prod2 TO vpc1;
然后你发布了下列命令:
RMAN> CONNECT CATALOG vpc1/oracle@catdb;
RMAN> SQL "EXEC catowner.dbms_rcvcat.create_virtual_catalog;"

上面命令的输出是什么?
A.它为每个oracle-11g客户端执行并创建一个虚拟目录。
B.这会产生一个错误,因为PROD1,PROD2是旧版本的。
C.这会产生一个错误,因为你需要使用CATOWNER用户连接来执行这个包
D.这会产生一个错误,因为你需要连接到目标库来执行这个包

答案:A

恢复目录的所有者,可以赋予或回收其他数据库用户访问恢复目录的权限(对每个虚拟目录用户访问进行控制)。每个被限制的用户有访问其元数据的权限,即虚拟私有目录。RMAN元数据存储在虚拟私有目录拥有者的方案中(其本身的安全由恢复目录提供,不是RMAN客户端提供)。

如果在10.2或更早的版本RMAN中使用虚拟目录。在使用这个虚拟私有目录之前,必须以虚拟目录所有者的身份连接到恢复目录数据库,执行下列存储过程:
base_catalog_owner.DBMS_RCVCAT.CREATE_VIRTUAL_CATALOG
base_catalog_owner 是基础恢复目录所有者。本题中为catowner

创建虚拟私有目录的步骤:
1.创建用户vcp1:
CREATE USER vpc1 IDENTIFIED BY password DEFAULT TABLESPACE vpcusers QUOTA UNLIMITED ON vpcusers;
GRANT recovery_catalog_owner TO vpc1;

2.使用RMAN连接到恢复目录数据库,给虚拟目录用户赋权:
CONNECT CATALOG catowner@catdb
GRANT CATALOG FOR DATABASE prod1 TO vpc1;

3.使用虚拟目录用户登录到恢复目录数据库,创建虚拟目录:
CONNECT CATALOG vpc1@catdb
CREATE VIRTUAL CATALOG;

4.如果目标库是10.2或者更早的库,需要使用虚拟目录用户登录到恢复目录数据库执行存储过程:
CONNECT vpc1@catdb
excute catowner.DBMS_RCVCAT.CREATE_VIRTUAL_CATALOG;




参考官方文档:http://docs.oracle.com/cd/E11882 ... nta013.htm#CHDDBEFJ

回复 只看该作者 道具 举报

12#
发表于 2016-7-20 09:53:56
13:
.The RECYCLEBIN parameter is set to ON for your database. You drop a table, PRODUCTS, from the SCOTT schema.
Which two statements are true regarding the outcome of this action? (Choose two)
A. All the related indexes and views are automatically dropped
B. The flashback drop feature can recover only the table structure
C. Only the related indexes are dropped whereas views are invalidated
D. The flashback drop feature can recover both the table structure and its data
Answer: CD

13:
在数据库中RECYCLEBIN 参数设置为ON。你从SCOTT方案中删除了一个表PRODUCTS。
关于这一操作的结果,哪一个陈述是正确的?
A.所有相关的索引和视图都自动被drop
B.闪回drop特性只能恢复表结构
C.只有相关的索引被drop,而视图会失效
D.闪回drop特性可以恢复表结构和其数据

答案:CD


drop table语句将表移动到回收场,此时表的空间并不能被表空间中的其他对象使用,除非使用了purge参数。

当表被drop时,所有的行,索引和表上定义的触发器均被drop(如果是分区表,所有的分区索引也将被drop)。所有存储嵌套表和LOB都被drop。
于表相关的视图,物化视图,存储过程,函数或表并不会被drop,只是失效。你将无法使用这些对象,除非重建表或者取消依赖关系。物化视图还是可以查询,但是不能被刷新(如果有物化视图日志,会删除物化视图日志和其他任何直接insert的刷新信息)。
当表被重建后,之前赋予此表的对象权限,不用重新赋予。

purge 等价于首先将表移动到回收站,然后再将其从回收站删除。当表从回收站purge后,将不能使用闪回特性恢复。

A.视图不会drop,只会失效,A错.C对
B.闪回drop特性可以恢复表和数据,B错D对


注:只有表的创建者或具有DROP ANY TABLE权限的用户才能删除表。
关于回收站:
任何用户都可以有回收站,除了sysdba身份的用户以外
SELECT * FROM RECYCLEBIN;

开启或关闭回收站,是静态参数recyclebin控制:
ALTER SYSTEM SET recyclebin = ON SCOPE = SPFILE;

查看回收站的内容:
show recyclebin
或者查询[dba|user]_recyclebin,视图

清理回收站:
PURGE RECYCLEBIN;
或者指定对象:purge table xxx
指定清理特定表空间,用户的对象
PURGE TABLESPACE example USER oe;


如果是sysdba身份可以执行
PURGE dba_ recyclebin;


参考官方文档:https://docs.oracle.com/cd/B2835 ... statements_9003.htm

https://docs.oracle.com/cd/E1828 ... 17120/tables011.htm

回复 只看该作者 道具 举报

11#
发表于 2016-7-20 09:53:38

11:
.Examine the following scenario: The target database instance is running. The most recent backup
available for the target database was taken two days ago. Log files switches have occurred in last two days. The target database is duplicated on the same host, using the Recovery Manager (RMAN) duplicate command as follows:
RMAN> RUN { ALLOCATE AUXILIARY CHANNEL aux 1 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO auxdb; }
Which statement is true about the duplicate database in this scenario?
A. It contains data till the last backup
B. It contains all data from target database until the current time
C. It contains all data from only the committed transactions in the target database
D. It contains all data except that which is used by the transactions in the current online redo file of target database
Answer: D



11
检查下列场景:目标数据库实例正在运行。目标数据库最近可用的备份是2天之前的。日志切换发生在2天之内。使用RMAN将目标数据库复制到相同的主机,使用复制命令如下:
RMAN> RUN { ALLOCATE AUXILIARY CHANNEL aux 1 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO auxdb; }

在这个复制数据库场景中,哪个陈述是正确的?
A.它只包含到最近备份的数据
B.它包含目标数据库到目前为止的所有数据
C.它只包含目标数据库中所有提交事务的数据
D.它包含所有数据,除了目标数据库当前redo的事务


答案:D

从命令可看出,是使用AUXILIARY CHANNEL基于 backup-based的复制数据库(没有from active database 参数)。辅助实例通道完成复制的主要工作,关联在目标主机上服务会话和辅助实例。
RMAN在这个场景下是进行的基于时间点的恢复,因为在线日志不能应用到目标复制数据库上,不指定until time的话,是使用最近的一个时间点,即源数据库最近一次归档。



所以源数据库中正在记录事务的重做日志不能包含到duplicate database里去。
故选D
官方文档参考:http://docs.oracle.com/cd/E11882 ... mdupdb.htm#BRADV423


12:
.Examine the following command:
SQL> ALTER TABLE booking SHRINK SPACE COMPACT;
Which activity is performed when the preceding command is executed?
A. The shrink operation touches every block in the BOOKING table
B. The high-water mark (HWM) for the BOOKING table is shifted from its original position
C. The progress of the shrink operation is saved in the bitmap blocks of the BOOKING table
D. The data manipulation language (DML) triggers on the BOOKING table are executed because the shrink operation is internally handled by the INSERT/DELETE operation
Answer: C

12:
检查下列命令:
SQL> ALTER TABLE booking SHRINK SPACE COMPACT;
当前面的命令执行时,会执行哪些活动?
A.shrink 操作访问 BOOKING表中所有块
B.高水位标记从原来的位置移动
C.收缩操作过程保存到了BOOKING表的位图块中。
D.BOOKING表上的DML触发器被执行,因为shink操作内部是insert/delete操作

答案:C

A.shrink 操作只会操作未使用的块,A错
B.使用了compact 高水位并不会在此时发生改变,B错
D.shrink 操作不会对目标上的事务产生影响,并不会触发DML触发器,D错

SHRINK SPACE可以作用在表,组织索引表,索引,分区,子分区,物化视图或物化视图日志上。如果并不想释放这些未使用的空间,可以使用coalesce。还可以增加cascade来对所有相关的段对象进行操作。
--需要自动段管理和开启行迁移,并且关闭基于rowid的触发器。

如果有长时间运行的查询,而且这些查询可能跨越收缩操作,并尝试从已回收的块中读取数据,则COMPACT子句会很有用。指定SHRINK SPACE COMPACT子句时,碎片整理和压缩结果保存到了磁盘(表中的位图块中)。这样就将一个长的操作,分为2个短操作,首先使用compact,进行整理和压缩,然后再在业务低峰期运行shrink space,此时数据不必再重新移动,将进行空间的重新分配和重置高水位。

还可以使用DEALLOCATE UNUSED 来释放未使用的空间 (回收高水位之上的未使用块)
ALTER TABLE table DEALLOCATE UNUSED KEEP integer;
ALTER INDEX index DEALLOCATE UNUSED KEEP integer;
ALTER CLUSTER cluster DEALLOCATE UNUSED KEEP integer;

keep后面的数值是 检查DBA_FREE_SPACE视图中的数值


官方参考:https://docs.oracle.com/cd/E1828 ... 17120/schema003.htm
http://docs.oracle.com/cd/E11882 ... 3001.htm#SQLRF01001

回复 只看该作者 道具 举报

10#
发表于 2016-7-19 15:49:23
10:
Multiple RMAN sessions are connected to the database instance.
Examine the following output when backup commands are running in server sessions:
SQL> SELECT s.sid, p.spid, s.client _info FROM v$process p, v$session
s
WHERE p.addr = s.paddr
AND CLIENT _INFO LIKE 'rman%';
SID SPID
CLIENT_INFO
--- ----- ----------------------------
103 25280 rman channel 1=ORA_DISK_1
151 25292 rman channel 1=ORA_DISK_2
What could have helped you to correlate server sessions with channels?
A. Implement RMAN multiplexing
B. Set the DEBUG ON in the RMAN script
C. Specify the command ID in the RMAN script
D. Use a tag with the RMAN BACKUP command
Answer: C


多个RMAN会话连接在数据库实例,当备份命令在服务会话中运行时,检查下列输出:
SELECT s.sid, p.spid, s.client _info FROM v$process p, v$session
s
WHERE p.addr = s.paddr
AND CLIENT _INFO LIKE 'rman%';
SID SPID
CLIENT_INFO
--- ----- ----------------------------
103 25280 rman channel 1=ORA_DISK_1
151 25292 rman channel 1=ORA_DISK_2

什么帮助你关联服务会话和通道

A.实现RMAN多路复用
B.在RMAN脚本中设置DEBUG ON
C.在RMAN脚本中指定命令ID
D.在RMAN BACKUP命令使用tag
答案:C

B,D选项和本题明显无关,可以排除。debug用于跟踪错误或一些问题,tag是标记整个备份集。

A.实现多路复用,并不能帮助你关联会话和RMAN通道,是RMAN备份的一种方式。


在RUN块中使用set command id 可以使得该信息出现在v$session.client_info中,这样就能帮助关联会话和通道。
例如:
RUN
{
  ALLOCATE CHANNEL c1 TYPE disk;
  SET COMMAND ID TO 'sess1';
  BACKUP DATABASE;
}

在另一个会话
RUN
{
  ALLOCATE CHANNEL c1 TYPE disk;
  SET COMMAND ID TO 'sess2';
  BACKUP DATABASE;
}

同时运行后,查询:
COLUMN CLIENT_INFO FORMAT a30
COLUMN SID FORMAT 999
COLUMN SPID FORMAT 9999

SELECT SID, SPID, CLIENT_INFO
FROM   V$PROCESS p, V$SESSION s
WHERE  p.ADDR = s.PADDR
AND    CLIENT_INFO LIKE '%id=sess%';


包含rman channel的行是执行备份的通道会话,其他的行是连接目标数据库的会话

参考文档:http://docs.oracle.com/cd/E11882 ... roub.htm#sthref1769


参考:监控和优化RMAN:http://blog.csdn.net/rlhua/article/details/12510975
当有多个RMAN 会话正在运行时,最好使用SET COMMAND ID命令在备份期间将某个进程与某个通道相关联,如下所示:
1.在每个会话中,将命令ID 设置为不同的值,然后备份所需的对象。例如,在会话1 中输入下列内容:
RUN
{
SET COMMAND ID TO 'sess1';
BACKUP DATABASE;
}
在会话2 中运行的作业中将命令ID 设置为一个字符串,如sess2:
RUN
{
SET COMMAND ID TO 'sess2';
BACKUP DATABASE;
}
2.启动SQL*Plus 会话,然后在执行RMAN 作业时查询联接的V$SESSION和
V$PROCESS视图。例如,输入:
SELECT SID, SPID, CLIENT_INFO
FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE '%id=sess%';

如果在RMAN 作业中运行SET COMMAND ID命令,则CLIENT_INFO列会以下列格式显示:
id=command_id,rman channel=channel_id
例如,下面显示了一个示例输出:
SID SPID CLIENT_INFO
---- ------------ ------------------------------
11 8358 id=sess1
15 8638 id=sess2
14 8374 id=sess1,rman channel=c1
9 8642 id=sess2,rman channel=c1

sys@TEST0924> SELECT s.sid, p.spid, s.client_info FROM v$process p, v$session s WHERE p.addr = s.paddr  AND CLIENT_INFO LIKE 'rman%';


SID SPID                     CLIENT_INFO
---- ------------------------ ------------------------------
  68 410                      rman channel=ORA_DISK_1
160 722                      rman channel=ORA_DISK_1

sys@TEST0924> SELECT s.sid, p.spid, s.client_info FROM v$process p, v$session s WHERE p.addr = s.paddr  AND CLIENT_INFO like '%id=sess%';

SID SPID                     CLIENT_INFO
---- ------------------------ ------------------------------
   7 653                      id=sess1

Matching Server Sessions with Channels in Multiple RMAN Sessions
If more than one RMAN session is active, then it is possible for theV$SESSION.CLIENT_INFO column to yield the same information for a channel in each session. For example:
SID SPID CLIENT_INFO
---- ------------ ------------------------------
14 8374 rman channel=ORA_SBT_TAPE_1
9 8642 rman channel=ORA_SBT_TAPE_1
In this case, you have the following methods for determining which channel corresponds to whichSID value.
Obtaining the Channel ID from the RMAN Output
In this method, you must first obtain the sid values from the RMAN output and then use these values in your SQL query.
To correlate a process with a channel during a backup:
In an active session, run the RMAN job as usual and examine the output to get thesid for the channel. For example, the output may show:
Starting backup at 21-AUG-01
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=14 devtype=SBT_TAPE
Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views while the RMAN job is executing. For example, enter:
COLUMN CLIENT_INFO FORMAT a30
COLUMN SID FORMAT 999
COLUMN SPID FORMAT 9999
SELECT s.SID, p.SPID, s.CLIENT_INFO
FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE 'rman%'
/
Use the sid value obtained from the first step to determine which channel corresponds to which server session:
SID SPID CLIENT_INFO
---------- ------------ ------------------------------
14 2036 rman channel=ORA_SBT_TAPE_1
12 2066 rman channel=ORA_SBT_TAPE_1
Correlating Server Sessions with Channels by Using SET COMMAND ID
In this method, you specify a command ID string in the RMAN backup script. You can then queryV$SESSION.CLIENT_INFO for this string.
To correlate a process with a channel during a backup:
In each session, set the COMMAND ID to a different value after allocating the channels and then back up the desired object. For example, enter the following in session 1:
RUN
{
ALLOCATE CHANNEL c1 TYPE disk;
SET COMMAND ID TO 'sess1';
BACKUP DATABASE;
}
Set the command ID to a string such as sess2 in the job running in session 2:
RUN
{
ALLOCATE CHANNEL c1 TYPE sbt;
SET COMMAND ID TO 'sess2';
BACKUP DATABASE;
}
Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views while the RMAN job is executing. For example, enter:
SELECT SID, SPID, CLIENT_INFO
FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE '%id=sess%';
If you run the SET COMMAND ID command in the RMAN job, then theCLIENT_INFO column displays in the following format:
id=command_id,rman channel=channel_id
For example, the following shows sample output:
SID SPID CLIENT_INFO
---- ------------ ------------------------------
11 8358 id=sess1
15 8638 id=sess2
14 8374 id=sess1,rman channel=c1
9 8642 id=sess2,rman channel=c1
The rows that contain the string rman channel show the channel performing the backup. The remaining rows are for the connections to the target database.
官方参考:http://docs.oracle.com/cd/E11882 ... roub.htm#sthref1769

回复 只看该作者 道具 举报

9#
发表于 2016-7-19 15:49:02
8:
You observed the following output for a user session:
What do you infer from the preceding output?

A. Resumable set for session with sid 18
B. The user session has entered into a deadlock
C. The database instance is enabled to use asynchronous commit
D. The threshold warning limit is exceeded for the tablespace that is used by the user session
Answer: A

你发现一个用户会话出现下列信息:

从前面的输出你推断出什么?
A.sid 为18的会话是设置为可恢复的
B.用户会话已进入了死锁
C.数据库实例启用了异步提交
D.用户使用的表空间超出了阀值告警限制

答案:A

图中出现的信息为:sid=18的会话被暂停,等待错误被清除

当RESUMABLE_TIMEOUT 设置为非0值(默认是0),或使用ALTER SESSION ENABLE RESUMABLE ,声明语句在可恢复模式下执行。

在可恢复模式下,当一个语句被暂停时,会话调用语句被放入一个等待状态,$vsession_wait会出现statement suspended的信息还可以可以查询DBA_RESUMABLE 和alert.log获得其他信息。

发生的条件:
超出空间限制,最大拓展条件,空间限额条件
所以出现这个事件,不一定是超出了表空间的告警阀值,D错。

BC 和图中event信息无关

参考官方文档:
https://docs.oracle.com/cd/E1828 ... 17120/schema002.htm



9:
The database is configured in ARCHIVELOG mode and regular complete database backups are
taken.
The loss of which two types of files may require a recovery with the RESETLOGS option? (Choose two)
A. Control files
B. Password files
C. Inactive online redo log file
D. Archived log files required to perform recovery
E. Newly created tablespace which is not backed up
Answer:A D

9:数据库被配置为归档模式并且定期的进行完全备份。丢失以下哪两种类型的文件需要进行不完全恢复--resetlogs(选则2个)
A.控制文件
B.密码文件
C.不活动的redo文件
D.执行恢复时需要的归档文件
E.没有被备份的新创建的表空间

答案A,D

A选项是迷惑选项,其实只丢失控制文件,可以使用resetlogs,也可以不使用。不使用的情况如下:


由于题目说的是may,那么A可选。

B.丢失密码文件可以直接使用orapwd 命令重建

C.不活动的redofile是归档完成的文件,可以使用alter database clear logfile 直接清理,如果未归档可能还需要unarchived参数。

D.由于丢失了归档,那么只能使用备份进行不完全恢复,则需要使用resetlogs打开数据库。

E.新创建的表空间数据文件丢失,但是有归档和创建之前的一次备份,是可以恢复的,并不需要resetlogs。

参考文档:http://docs.oracle.com/cd/E25054 ... advsce.htm#i1006226

回复 只看该作者 道具 举报

8#
发表于 2016-7-19 15:47:47
6:
View the exhibit and examine the output.
NOTE:
Exhibit Estimated, Not The Actual Exhibit
Which statement can be an inference from the output?
Exhibit:

A. The FRA disk group has an asynchronous I/O bottleneck
B. The least number of I/Os are performed on the last data file in the list
C. The number of times that the backup or restore process directed the OS to wait until an I/O was complete is the
D. The number of times that the backup or restore process made an OS call to poll for I/O completion in Nonblocking
Answer: A



7:
Your database interface is running. A user SCOTT starts a SQL *Plus session, and issues the
following query:
SQL> SELECT * FROM sales;
Which process would retrieve the result from the database and return it to the client program?
A. User process
B. Server process
C. System Monitor (SMON)
D. Process Monitor (PMON)
E. Checkpoint process (CKPT)
Answer: B 考点是  Server process

你的数据库接口正在运行。SCOTT用户开启了一个SQL*Plus会话,并且执行了下列查询:
SQL>SELECT * FROM SALES;
哪个进程将得到从数据库返回给客户端程序的结果?
A.用户进程
B.服务进程
C.系统监控进程(SMON)
D.进程监控进程(PMON)
E.检查点进程(CKPT)

答案:B
本题考点是Server process
通常一个连接(connect)在客户端进程和服务进程或调度进程(dispatcher)之间产生,也有可能在客户端进程和CMAN(oracle 进程管理器)之间产生。

一个连接可能会有0,1,或者多个会话,本题是SCOTT用户使用SQLPLUS连接数据库后,发起了一个会话。属于客户端和服务端进程连接。故选B


A错:没有用户进程这个说法
C:SMON -负责各种系统级的清理工作:必要情况下的实例恢复(启动时),恢复由于表空间脱机(跳过了实例恢复)造成的失败的事务。清理临时表空间不使用的段,合并字典管理下的表空间中相邻空闲拓展。

D:PMON-监控其他后台进程,当一个服务进程或者调度进程异常终止时,执行进程恢复。对客户端进程使用的数据库buffer cache和资源进行清理(即释放资源)。还注册实例和监听器调度程序的信息,如果监听运行,将传递相关参数,如果没运行,将定期地尝试连接。

E:CKPT 更新控制文件和数据文件头部的检查点信息,并且发送信号通知DBWn进程将脏块写入磁盘。

参考官方文档:
http://docs.oracle.com/cd/E25178 ... rocess.htm#BABJAIBD

回复 只看该作者 道具 举报

7#
发表于 2016-7-19 15:47:26
5:
You are using recovery Manager (RMAN) with a recovery catalog to backup up your production
database. The backups and the archived redo log files are copied to a tape drive on a daily basis. The
database was open and transactions were recorded in the redo logs. Because of fire in the building you
lost your servers having the production database and the recovery catalog database. The archive log files
generated after the last backup are intact on one of the remote locations. While performing a disaster
recovery of the production database what is the next step that you must perform after restoring the data
files and applying archived redo logs?
A. Open the database in NORMAL mode
B. Open the database in read-only mode
C. Open the database in RESTRICTED mode
D. Open the database with the RESETLOGS option
Answer: D

5:
你使用RMAN恢复目录来对生产库进行备份。每天将备份和归档日志文件拷贝到磁带设备。数据库是打开的,并且事务都记录在redo 日志中。由于建筑失火,你丢失了你的生产数据库服务器和恢复目录数据库。最后一次备份和产生的归档日志都完好无损的在远程的位置。当进行一个灾难恢复生产数据库时,在执行重建数据文件和应用归档日志后,下一步你需要做什么?

A.以普通模式打开数据库
B.以只读模式打开数据库
C.以受限模式打开数据库
D.以RESETLOGS打开数据库

答案:D
执行灾难恢复需要满足下列条件:
1.所有数据文件的备份
2.备份中产生的归档日志
3.至少一个备份的控制文件
4.数据库的DBID(标识符)

在重建数据库并加载剩余归档日志后,也就是在新主机上进行重建后,由于是不完全恢复,此时必须以resetlogs的方式打开数据库。

基本过程:
• 还原服务器参数文件的自动备份。
• 启动目标数据库实例。
• 从自动备份还原控制文件。
• 装载数据库。
• 还原数据文件。
• 恢复数据文件。
• 使用RESETLOGS选项打开数据库


参考官方文档 :
http://docs.oracle.com/cd/E25054 ... madvre.htm#i1006453

回复 只看该作者 道具 举报

6#
发表于 2016-7-19 15:47:10
4:
In your database, the flash recovery area (FRA) is configured as the default for RMAN
backups. You executed the following commands to configure the settings in RMAN:
RMAN> CONFIGURE DEVICE TYPE disk PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
RMAN>CONFIGURE CHANNEL 1 DEVICE TYPE disk FORMAT
'/home/oracle/disk1/%U';
RMAN>CONFIGURE CHANNEL 2 DEVICE TYPE disk
FORMAT '/home/oracle/disk2/%U';
You issue the following RMAN command to backup the database:
RMAN> RUN
2> {
3> ALLOCATE CHANNEL ch1 DEVICE TYPE disk;
4> BACKUP DATABASE;
5> }
Which statement is true about the outcome?
A. Only one channel is allocated and the backup is created in the flash recovery area
B. Only one channel is allocated and the backup is created in the destination specified for channel
C. Two channels are allocated and backup sets are created in the destinations specified for channels 1
and 2
D. Three channels are allocated and backup sets are created in the destinations specified for channels 1,
2, and FRA
Answer: A
答案解析:

官方参考:http://docs.oracle.com/cd/E11882 ... nta004.htm#RCMRF102
手动分配通道会覆盖CONFIGURE配置的自动分配通道,并且rman的备份信息会默认放在fra中。故选A.
ALLOCATE CHANNEL
Purpose
ALLOCATE CHANNEL manually allocates a channel (which is a connection between RMAN and a database instance). The ALLOCATE CHANNEL command must be issued within a RUN block. It allocates a channel only in the block where the command is issued.
Prerequisites
The target instance must be started.
Usage Notes
Manually allocated channels are distinct from automatically allocated channels specified with CONFIGURE. Automatic channels apply to any RMAN job in which you do not manually allocate channels. You can override automatic channel configurations by manually allocating channels within a RUN command, but you cannot use BACKUP DEVICE TYPE or RESTORE DEVICE TYPE to use automatic channels after specifying manual channels with ALLOCATE CHANNEL.

ALLOCATE CHANNEL 手动分配通道,必须在run块中使用。在使用手动分配通道后,你不能再使用BACKUP DEVICE TYPE 或 RESTORE DEVICE TYPE来使用自动通道,会覆盖自动通道的配置。
此处指定了通道ch1,就不会使用自动分配的通道配置了,C,D错



由于使用allocate channel 并未指定路径(FORMAT),所以会使用默认的FRA来存放备份。B错

参考官方文档:
http://docs.oracle.com/cd/E11882 ... nta004.htm#RCMRF102

回复 只看该作者 道具 举报

5#
发表于 2016-7-19 15:46:47
QUESTION 2
Your production database is running in archivelog mode and you are using recovery manager (RMAN) with recovery catalog to perform the database backup at regular intervals. When you attempt to restart the database instance after a regular maintenance task on Sunday, the database fails to open displaying the message that the data file belonging to the users tablespace are corrupted.
The steps to recover the damaged data files are follows:
1. Mount the database
2. Open the database
3. Recover the data file
4. Restore the data file
5. Make the data file offline
6. Make the data file online
Which option identifies the correct sequence that you must use to recover the data files?
A. 2, 4, 3
B. 1, 4, 3, 2
C. 2, 5, 4, 3, 6
D. 5, 2, 4, 3, 6
E. 1, 5, 4, 3, 6, 2
Answer: E


2:
你的生产库运行在归档模式,并且你使用RAMN恢复目录来定期执行备份。当周六一个例行任务之后,你试图重启数据库,发现在数据库打开的时候收到一个消息,属于users的表空间的数据库文件损坏。
下面是恢复损坏文件的步骤:
1: 挂载数据库
2:打开数据库
3:修复数据库
4:重建数据文件
5:使数据文件离线
6:使数据文件在线
A. 2, 4, 3
B. 1, 4, 3, 2
C. 2, 5, 4, 3, 6
D. 5, 2, 4, 3, 6
E. 1, 5, 4, 3, 6, 2

那些步骤是你用来恢复数据文件的必须选项?

答案:D
可参考的官方文档信息:
http://docs.oracle.com/cd/E28271 ... mcomre.htm#CHDDAGHH


3:
.You want to perform an RMAN backup of database as a copy. Which two factors will you consider
while performing the backup operation? (Choose two).
A. The backup as copy can only be taken to disk
B. The backup as copy can only be taken to tape
C. Backup can be performed only when the instance is shutdown
D. Backup will constitute all used and unused blocks in the database
Answer: AD
Syntax Element        Description
COPY OF DATABASE        Makes a backup of previous image copies of all data files and control files in the database. All data files that would normally be included by BACKUP DATABASE are expected to have copies: if not, RMAN signals an error. It is not necessary for all copies to have been produced by a single BACKUP command. If multiple copies exist of a data file, then RMAN backs up the latest. Optionally, specify the copies by tag name (for example,FULL_COLD_COPY).
Note: The output of this command can be image copies or backup sets.

题意说,使用rman进行数据库的copy,哪两种因素在你进行backup时所考虑的?
A。只能备份到disk
D。数据库里所有使用和未使用的块都会被备份。

镜像拷贝:

backup as copy不是以RMAN指定的格式存储,其和系统级别拷贝命令相同,RMAN也支持使用这些操作系统进行的拷贝。
于备份集不同(会使用unused块压缩),镜像拷贝是bit-to-bit的方式,所以会备份所有的块。由于镜像拷贝只能写到磁盘上,所以磁带设备只能使用备份集。
镜像拷贝可以在mount下进行,所以C错。

参考官方文档:
https://docs.oracle.com/cd/E1188 ... mcncpt.htm#BRADV107

回复 只看该作者 道具 举报

4#
发表于 2016-7-19 15:46:30

1:
What are the prerequisites for performing flashback transactions? (Choose all that apply)
A. Supplemental log must be enabled
B. Supplemental log must be enabled for the primary key
C. Undo retention guarantee for the database must be configured
D. ”EXECUTE “ permission on the DBMS_FLASHBACK package must be granted to the user
Answer: ABD

1:什么是执行闪回事务的先决条件?(选择所有合适的选项)
A:附加日志必须启用
B:附加日志必须在主键级别启用
C:undo 保留担保必须设置
D:DBMS_FLASHBACK包的执行权限必须被赋予给用户

闪回事务- Backout Transaction:
在数据库运行期间,一个逻辑恢复选项,回滚一个目标事务及其相关的事务。

执行闪回事务先决条件:
1、数据库必须位于归档模式。
2、附加日志必须开启,在数据库级别和在要进行闪回事务表上主键级别(最少)开启。
3、SYS之外的用户需要有执行DBMS_FLASHBACK和SELECT ANY TRANSACTION的权限。

可参考的官方文档信息:https://docs.oracle.com/cd/E1188 ... hback.htm#ADFNS1008

回复 只看该作者 道具 举报

3#
发表于 2016-7-19 10:45:02
131:
You are performing incomplete recovery using RMAN. You execute the following RUN block:
RUN
{
SET UNTIL SCN 1107600;
RESTORE DATABASE;
RECOVER DATABASE;
}
Which statement is true about the result?
A.RMAN restores all datafiles from the most recent backup available since the failure and applies the redo logs necessary to recover the database to SCN 1107600
B.RMAN restores all datafiles needed to restore the database through SCN 1107599 and applies the redo logs necessary to recover the database through SCN 1107599.
C.RMAN restores all datafiles and control files from the most recent backup
D.The RUN block fails because you did not specify an UNTIL clause in your RECOVER DATABASE command
Answer: B
131: 你使用RMAN执行不完全恢复。你执行下列RUN块
RUN
{
SET UNTIL SCN 1107600;
RESTORE DATABASE;
RECOVER DATABASE;
}
关于结果哪个语句是正确的?
A.RMAN从最近可用的备份中重建所有的数据文件直到故障点,并应用所有必要的日志恢复数据库到SCN 1107600
B.RMAN 重建数据库到SCN1107599所需的所有数据文件,并应用所需的日志恢复到数据库到SCN 1107599
C.RMAN从最近的备份中创建所有的控制文件和数据文件
D.RUN 块命令失败,因为你没在RECOVER DATABASE 命令中指定UNTIL子句。

答案:B
此题的考点是数据库的不完全恢复:
这个过程假设当前恢复的目标库是当前的incamation。控制文件是当前的,也就是不需要从备份控制文件中重建控制文件。数据库使用的是当前的参数文件。

在执行DBPITR时,可以通过在run块开始的时候指定SET UNTIL命令,而不是分别给RESTORE和RECOVER命令指定,可以避免错误。这个确保来重建的控制文件比在recover的时间戳要更早。


确定还原目标。可以查询alert 日志来确定还原的时间点。以下的查询列除了当前数据库化身的日志:
SELECT RECID, STAMP, THREAD#, SEQUENCE#, FIRST_CHANGE#
       FIRST_TIME, NEXT_CHANGE#
FROM   V$ARCHIVED_LOG
WHERE  RESETLOGS_CHANGE# =
       ( SELECT RESETLOGS_CHANGE#
         FROM   V$DATABASE_INCARNATION
         WHERE  STATUS = 'CURRENT');

可以需要在运行的时候设置好环境变量:
NLS_LANG = american_america.us7ascii
NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
然后连接到目标库,将数据库启动到mount状态:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
执行下列run块:
RUN
{
  SET UNTIL SCN 1000;   
  RESTORE DATABASE;
  RECOVER DATABASE;
}
--如果指定的是时间,必须满足之前设置的NLS_DATA_FORMAT的日期格式。例如:
SET UNTIL TIME 'Nov 15 2004 09:00:00';
SET UNTIL SEQUENCE 9923;  
SET UNTIL RESTORE POINT before_update;

最后是用resetlogs的方式打开数据库:ALTER DATABASE OPEN RESETLOGS;

参考官方文档:
https://docs.oracle.com/cd/E1188 ... lash.htm#BRADV89754

回复 只看该作者 道具 举报

2#
发表于 2016-7-18 10:34:44
130:
You are maintaining the SALES database. You have added a new disk to a disk group. Automatic
Storage Management performs the rebalancing activity. You want to speed up the rebalancing activity.Which parameter should you specify to control the speed of the rebalancing activity?
A. ASM_POWER_LIMIT
B. ASM_DISKSTRING
C. ASM_DISKGROUPS
D. INSTANCE_TYPE
Answer: A

130:
你维护SALES数据库:你要增加一个新磁盘到一个磁盘组。ASM活动执行平衡。你想加快平衡活动。哪个参数可以控制平衡活动的速度?
A. ASM_POWER_LIMIT
B. ASM_DISKSTRING
C. ASM_DISKGROUPS
D. INSTANCE_TYPE
答案A


• ASM_POWER_LIMIT控制重新平衡操作的速度。值的范围从0 到1024(11.2.0.2以后是1024,之前是11),该值默认为1。
值为0表示关闭再平衡。更高的值让玩平衡的操作更快,但是会导致更高的I.O带宽和更多的平衡进程。
• ASM_DISKSTRING是一个与操作系统相关的值,ASM 使用它来限制搜索时发现的磁盘集。默认值为空字符串,更强的值可以减少ASM 执行发现磁盘所需的时间,从而提高磁盘组装载效率。不能动态修改ASM_DISKSTRING的值,并且如果新值不能用来发现已经mount的磁盘的话,会保留旧值。
• ASM_DISKGROUPS是ASM 实例启动时,ASM 实例要装载的磁盘组的名称列表。当在启动的时候使用NOMOUNT或当使用ALTER DISKGROUP ALL MOUNT语句时会忽略此参数值。
当磁盘组成功被创建或挂载,ASM会自动的将磁盘组加入到此参数中,并且在磁盘组删除或卸载的时候自动的从参数中移除。该参数没有默认值。
• INSTANCE_TYPE 用来指定实例是数据库实例还是ASM实例。对于数据库实例,该参数值为RDBMS,对于ASM实例,改参数值为ASM。默认值为RDBMS。

回复 只看该作者 道具 举报

123
返回列表
您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-5-19 07:18 , Processed in 0.055367 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569