ITPub博客

首页 > 数据库 > Oracle > OCP 052 1-20

OCP 052 1-20

原创 Oracle 作者:halmot 时间:2015-11-17 15:53:15 0 删除 编辑
1: You perform differential incremental level 1 backups of your database on each working day and
level 0 backup on Sundays, to tape. Which two statements are true about differential incremental
backups? (Choose two.)
选项
A.The backup performed on Sundays contains all the blocks that have ever been used in the
database.
B.The backup performed on Sundays contains all the blocks that have changed since the last level
1 backup.
C.The backup performed on each working day contains all the blocks that have changed since the
last level 0 backup.
D.The backup performed on Monday contains all the blocks that have changed since the level 0
backup, and every other working day contains all the blocks that have changed since the level 1
backup.
Correct Answers: A D


增量备份分为差异备份和累积备份,这道题问的是差异备份。需要较少的备份时间,但是需要较多的恢复时间。是增量备份的默认选项
差异备份是备份上级及同级备份以来所有变化的数据块,累积备份是备份上级备份以来所有变化的块。需要较多的备份时间,较少的恢复时间
增量备份需要一个0级备份做基础。0级备份与全备份的区别在于0级备份 可以用来增量恢复,而全备份则不可以。
1级备份会计算与0级备份和上次1级备份时更改过的块。所以选AD


2: View the Exhibit to examine the output produced by the following query at three different times
since the database instance started and has experienced workloads of different capacities:
SQL> SELECT substr(component, 0, 10) COMP, current_size CS,
user_specified_size US
FROM v$memory_dynamic_components
WHERE current_size!=0;
What do you infer from this?
A.The database instance is running with manual PGA management.
B.The database instance is running with manual shared memory management.
C.The database instance has the MEMORY_TARGET value set to a nonzero value.
D.All sessions are connected to the database instance in dedicated mode, and no RMAN or
parallel query operations have been performed.
Correct Answers: C

动态性能视图V$MEMORY_DYNAMIC_COMPONENTS显示所有动态优化的内存组件的当前大小,其中包括SGA 和实例PGA 的总大小。

三次启动的SGA的各个组件大小都一样,是动态变化的,PGA也是动态变化的,所以此数据库是处于自动内存管理即AMM,也即是说MEMORY_TARGET设定为非零值。
相关知识



3: Identify two situations in which you can use Data Recovery Advisor for recovery. (Choose
two.)
选项
A.The database files are corrupted when the database is open.
B.The user has dropped an important table that needs to be recovered.
C.The archived redo log files are missing for which the backup is not available.
D.The database is not opening because the required database files are missing.
Correct Answers: A D

Data Recovery Advisor 是11g新特性,是Oracle顾问程序架构的一部分,它会在遇到错误时自动收集有关故障信息.如果主动运行Data Recovery Advisor,通常可以在用户查询或备份操作检查到故障前检测和修复故障.

Data Recovery Advisor可以主动检测到诸如块受损的相对较小的错误,也可以检测到导致数据库无法成功启动的错误,如缺少联机重做日志文件,数据文件等.


数据恢复指导可处理以下两种情况:

一种是因必需的数据库文件缺失,不一致或损坏而无法启动数据库;

一种是在运行时发现文件损坏.

A: 正确,数据库启动时发现数据文件介质损坏时适合使用.

B: 错误,用户删除表时不适合使用.

C: 错误,归档日志丢失不适合使用.

D: 正确,数据库启动时发现数据文件丢失时适合使用.

4: You have two tables with referential integrity enforced between them. You need to insert data to
the child table first because it is going to be a long transaction and data for the parent table will be
available in a later stage, which can be inserted as part of the same transaction.
View the Exhibit to examine the commands used to create tables.
Which action would you take to delay the referential integrity checking until the end of the
transaction?
A.Set the constraint to deferred before starting the transaction.
B.Alter the constraint to NOVALIDATE state before starting the transaction.
C.Enable the resumable mode for the session before starting the transaction.
D.Set the COMMIT_WAIT parameter to FORCE_WAIT for the session before starting the
transaction.
Correct Answers: A
延迟约束

A: 正确,在事务开始使用set constraint语句设置约束延迟

B: 错误, NOVALIDATE指对新插入的数据强制执行约束,而不管表中的现有数据,与题意不符

C: 错误,会话resumable可以在空间不足时让语句挂起,与题意不符

D: 错误, COMMIT_WAIT= FORCE_WAIT(默认值),控制事务提交实时写redo日志,与题意不符

5: Your database is open and the LISTENER listener is running. The new DBA of the system stops
the listener by using the command:
LSNRCTL> STOP
What happens to the sessions that are presently connected to the database instance?
A.The sessions are able to perform only queries.
B.The sessions are not affected and continue to function normally.
C.The sessions are terminated and the active transactions are rolled back.
D.The sessions are not allowed to perform any operations till the listener is started.
Correct Answers: B
已连接的会话,当停止监听时不会中断


6: You executed this command to create a temporary table:
SQL> CREATE GLOBAL TEMPORARY TABLE report_work_area (startdate DATE, enddate
DATE, class CHAR(20)) ON COMMIT PRESERVE ROWS;
Which statement is true about the rows inserted into the REPORT_WORK_AREA table during a
transaction?
A.The rows stay in the table only until session termination.
B.The rows stay in the table only until the next transaction starts on the table.
C.The rows are visible to all current sessions after the transaction is committed.
D.The rows stay available for subsequent sessions after the transaction is committed.
Correct Answers: A

Oracle数据库除了可以保存永久表外,还可以建立临时表temporary tables。这些临时表用来保存一个会话SESSION的数据,或者保存在一个事务中需要的数据。当会话退出或者用户提交commit和回滚rollback事务的时候,临时表的数据自动清空,但是临时表的结构以及元数据还存储在用户的数据字典中。 
2.详细介绍 
Oracle临时表分为会话级临时表和事务级临时表。 
会话级临时表是指临时表中的数据只在会话生命周期之中存在,当用户退出会话结束的时候,Oracle自动清除临时表中数据。 
事务级临时表是指临时表中的数据只在事务生命周期中存在。当一个事务结束(commit or rollback),Oracle自动清除临时表中数据。 
临时表中的数据只对当前Session有效,每个Session都有自己的临时数据,并且不能访问其它Session的临时表中的数据。因此,临时表不需要DML锁。 
当一个会话结束(用户正常退出 用户不正常退出 ORACLE实例崩溃)或者一个事务结束的时候,Oracle对这个会话的表执行 TRUNCATE 语句清空临时表数据.但不会清空其它会话临时表中的数据. 
你可以索引临时表和在临时表基础上建立视图.同样,建立在临时表上的索引也是临时的,也是只对当前会话或者事务有效. 临时表可以拥有触发器. 3.建立临时表 
临时表的定义对所有会话SESSION都是可见的,但是表中的数据只对当前的会话或者事务有效. 

7: In which of the scenarios will the DBA perform recovery? (Choose all that apply.)
选项
A.The alert log file is corrupted.
B.A tablespace is accidentally dropped.
C.One of the redo log members is corrupted.
D.A database user terminates the session abnormally.
E.The hard disk on which the data file is stored is corrupted.
Correct Answers: B E

A选项alert log 文件的损坏貌似不会影响运行
C选项redo log 文件有备份来着,一个损坏可以复制另外一个改个名字就好了
D选项应该是redo log 在下次启动时会自动同步执行,所以也不需要备份


8: Note the following structures in your database server:
1. Extents
2. OS Blocks
3. Tablespace
4. Segments
5. Oracle Data Block
Which option has the correct arrangement of these structures from the smallest to the largest?
A.2, 5, 1, 4, 3
B.1, 2, 3, 4, 5
C.5, 2, 1, 3, 4
D.2, 1, 5, 4, 3
Correct Answers: A
这个记住即可


9: You are working on an instance started using the SPFILE. You want to move the Flash
Recovery Area of your database to a new location. You want the Flashback log files to be stored in
the new location. Given below are the steps to accomplish the task in random order:
1) Shut down the instance.
2) Change the value of the DB_RECOVERY_FILE_DEST initialization parameter to a new
value.
3) Execute the ALTER DATABASE FLASHBACK OFF command.
4) Start up the instance and mount the database.
5) Execute the ALTER DATABASE FLASHBACK ON command.
6) Open the database.
Select the correct order in which these tasks need to be performed.
A.2, 1, 4, 3, 5, 6
B.1, 4, 3, 2, 6, 5
C.1, 4, 2, 6, 3, 5
D.3, 2, 1, 4, 5, 6
Correct Answers: A

10: A user, who is authenticated externally, logs in to a remote machine and connects to the
database instance. What action would you take to ensure that a user cannot connect to the database
instance by merely logging in to a remote machine?
A.Set REMOTE_OS_ROLES to FALSE.
B.Set the OS_ROLES parameter to FALSE.
C.Set the REMOTE_OS_AUTHENT parameter to FALSE.
D.Set the REMOTE_LOGIN_PASSWORD_FILE parameter to NONE.
Correct Answers: C

C,REMOTE_OS_AUTHENT指定远程客户端是否使用OS_AUTHENT_PREFIX参数的值来授权

D(X). 参数名有误,应为REMOTE_LOGIN_PASSWORDFILE,指定Oracle是否检查口令文件

11: Your database instance is started using the server parameter file (SPFILE). You executed a
command to change the value of the LOG_BUFFER initialization parameter:
ALTER SYSTEM SET LOG_BUFFER=32M SCOPE=BOTH;
What would be the outcome of this command?
A.The command succeeds only if Automatic Memory Management is not enabled.
B.The command succeeds, but you need to restart the database for changes to take effect.
C.The command returns an error because the size of the redo log buffer cannot be changed
dynamically.
D.The parameter value is changed and it comes into effect as soon as space becomes available in
the System Global Area (SGA).
Correct Answers: C
redo log 文件不能被动态改变



12: The database instance is currently using SPFILE. View the Exhibit and examine the error that
you received while running the DB Structure Integrity check.
Given below are the steps to recover from the error in random order:
1. Shut down the instance, if not already done.
2. Copy one of the remaining control files to a new location.
3. Change the value of the CONTROL_FILES initialization parameter to correspond to the
new location of the control files.
4. Start up the database instance to the NOMOUNT stage.
5. Recover the database to the point of failure of the control file.
6. Open the database.
Identify the correct sequence of steps?
A.1, 2, 4, 3, 5, 6
B.2, 4, 3, 5, 6; 1 not required
C.4, 5, 6, 2, 3; 1 not required
D.5, 2, 3, 4; 1 and 6 not required
Correct Answers: A
控制文件丢失的解决办法


13: View the Exhibit and examine the parameters.
User A executes the following command to update the TRANS table:
SQL> UPDATE B.trans SET tr_amt=tr_amt+500 WHERE c_code='C005';
Before user A issues a COMMIT or ROLLBACK command, user B executes the following
command on the TRANS table:
SQL> ALTER TABLE trans MODIFY (tr_type VARCHAR2(3));
What would happen in this scenario?
A.The ALTER TABLE command modifies the column successfully.
B.The DDL operation gets higher priority and transaction for user A is rolled back.
C.The ALTER TABLE command waits indefinitely until user A ends the transaction.
D.The ALTER TABLE command fails after waiting for 60 seconds due to the resource being busy.
Correct Answers: D
不允许在一个表中更新的同时,启用另外一个会话修改表的定义


14: View the Exhibit to examine the details for an incident.
Which statement is true regarding the status of the incident?

A.The DBA is working on the incident and prefers that the incident be kept in the ADR.
B.The incident is now in the Done state and the ADR can select the incident to be purged.
C.The incident has been newly created and is in the process of collecting diagnostic information.
D.The data collection for the incident is complete and the incident can be packaged and sent to
Oracle Support.
Correct Answers: D

答案解析:

ADR (Automatic Diagnostic Repository)


使用Enterprise Manager 支持工作台,可以通过执行以下常规步骤来调查、报告并(在某些情况下)解决问题:
1. 在Enterprise Manager 的“Database(数据库)”主页上,复查严重错误预警。选择一个预警查看详细资料。
2. 分析问题详细信息并查看针对问题所记录的所有意外事件的列表。可显示自动运行的所有健康状况检查的查找结果。
3. (可选)运行附加健康状况检查并调用SQL Test Case Builder,该程序将收集与SQL 问题相关的所有必需数据,并且以Oracle  技术支持能够再现该问题的方式对这些信息进行打包。
4. 使用My Oracle Support  创建一个服务请求并(可选)随问题信息一起记录服务请求号。
5. 调用意外事件打包服务,该服务可以对收集到的有关某个问题的所有诊断数据进行打包,可以选择将这些数据上载到Oracle  技术支持。上载之前可以对数据进行编辑,删除敏感信息。
6. 可以在支持工作台中维护一份服务请求的活动日志。可运行Oracle  指导以帮助修复SQL 故障或损坏的数据。
7. 为一个、一些或所有意外事件设置状态,以便关闭问题。

15: User A executes the following command to drop a large table in your database:
SQL> DROP TABLE trans;
While the drop table operation is in progress, user B executes the following command on the same
table:
SQL> DELETE FROM trans WHERE tr_type='SL';
Which statement is true regarding the DELETE command?
A.It fails to delete the records because the records are locked in SHARE mode.
B.It deletes the rows successfully because the table is locked in SHARE mode.
C.It fails to delete the records because the table is locked in EXCLUSIVE mode.
D.It deletes the rows successfully because the table is locked in SHARE ROW EXCLUSIVE
mode.
Correct Answers: C



share lock mode 大家都能查询,都不能进行DML操作,但是EXCLUSIVE就是有一个session可以进行DML操作,独占式,ROW SHARE 和ROW EXCLUSIVE 是对应的行级别的锁, SHARE ROW EXCLUSIVE允许其它的session查询或者用select for update 来锁定记录,但是不允许其它session获取SHARE锁
强弱程度
EXCLUSIVE > ROW SHARE EXCLUSIVE > SHARE > ROW EXCLUSIVE > ROW SHARE


16: Which is the correct description of a pinned buffer in the database buffer cache?
A.The buffer is currently being accessed.
B.The buffer is empty and has not been used.
C.The contents of the buffer have changed and must be flushed to the disk by the DBWn process.
D.The buffer is a candidate for immediate aging out and its contents are synchronized with the
block contents on the disk.
Correct Answers: A

Buffer States

The database uses internal algorithms to manage buffers in the cache. A buffer can be in any of the following mutually exclusive states:

  • Unused

    The buffer is available for use because it has never been used or is currently unused. This type of buffer is the easiest for the database to use.

  • Clean

    This buffer was used earlier and now contains a read-consistent version of a block as of a point in time. The block contains data but is "clean" so it does not need to be checkpointed. The database can pin the block and reuse it.

  • Dirty

    The buffer contain modified data that has not yet been written to disk. The database must checkpoint the block before reusing it.

Every buffer has an access mode: pinned or free (unpinned). A buffer is "pinned" in the cache so that it does not age out of memory while a user session accesses it. Multiple sessions cannot modify a pinned buffer at the same time.

The database uses a sophisticated algorithm to make buffer access efficient. Pointers to dirty and nondirty buffers exist on the same least recently used (LRU) list, which has a hot end and cold end. A cold buffer is one that has not been recently used. A hot buffer is frequently accessed and has been recently used.


17: View the Exhibit.
Which statements are true regarding the USERS tablespace? (Choose all that apply.)


选项
A.A bitmap is used to record free extents.
B.Free extents information is managed within the tablespace.
C.Free extents information is managed in the SYSAUX tablespace.
D.The data dictionary tables are updated when extents are allocated or deallocated.
Correct Answers: A B

分区管理方式有2种:

 

LOCAL:本地管理,默认选项,在数据文件头用位图方式管理文件内分区使用情况.

DICTIONARY:字典管理,用数据字典表记录文件分区使用情况,技术落后,不推荐使用.

18: You are working on a new Oracle Database 11g server, where only the software is installed
and no database is created. You plan to create a database on this server using the Database
Configuration Assistant (DBCA).
Some of the requirements set for your database creation task are:
1. Configure the database to operate in shared server mode.
2. Disable automatic maintenance tasks such as optimizer statistics collection.
3. Configure a naming method to help the remote user connect to the database instance.
4. Use Automatic Storage Management (ASM) for storing the database files.
5. Configure daily database backup to flash recovery area.
6. Configure Enterprise Manager Database Control to manage the database.
Which of these requirements can be met while creating the database?
A.4 and 6
B.2, 3, 4, and 6
C.1, 2, 4, 5, and 6
D.1, 2, 3, 4, 5, and 6
Correct Answers: C

DBCA创建数据库如下:


1.Database Configuration Assistant:Welcome

2.Database Configuration Assistant,Step 1 of 13:Operations 选择Create a Database

3.Database Configuration Assistant,Step 2 of 13:Database Templates 选择General Purpose or Transaction Processing

4.Database Configuration Assistant,Step 3 of 13:Database Identification 填写Global Database Name和SID

5.Database Configuration Assistant,Step 4 of 13:Management Options 选择Enterprise Manager和Automatic Maintenance Tasks

6.Database Configuration Assistant,Step 5 of 13:Database Credentials 填写密码

7.Database Configuration Assistant,Step 6 of 13:Network Configuration 选择监听器

8.Database Configuration Assistant,Step 7 of 13:Database File Locations 选择ASM

9.Database Configuration Assistant,Step 8 of 13:Recovery Configuration快速恢复区指定

10.Database Configuration Assistant,Step 9 of 13:Database Content 勾选Sample Schemas

11.Database Configuration Assistant,Step 10 of 13:Initialization Parameters 包括Memory,Sizing,Character Sets,Connection

19: Examine the following output:
SQL> SELECT index_name,status FROM dba_indexes WHERE status='UNUSABLE';
INDEX_NAME STATUS
------------------------------ -----------
EIND UNUSABLE
Which two statements about the above index are true? (Choose two.)
选项
A.It is ignored by the query optimizer.
B.It is not used while the index is being rebuilt.
C.The index cannot be rebuilt, and has to be re-created.
D.The index is automatically rebuilt when used the next time.
Correct Answers: A B
An invisible index is an index that is ignored by the optimizer unless you explicitly set the OPTIMIZER_USE_INVISIBLE_INDEXES initialization parameter to TRUEat the session or system level.


20: View the Exhibit to examine the error that occurred during the database startup.
You opened an RMAN session for the database. To repair the failure, you executed the following
command as the first RMAN command:
RMAN>REPAIR FAILURE;
Which statement describes the consequence of this command?

A.The command performs the recovery and closes the failure.
B.The command only displays the advice and the RMAN script required for recovery.
C.The command executes the RMAN script to repair the failure and remove the entry from the
Automatic Diagnostic Repository (ADR).
D.The command produces an error because the ADVISE FAILURE command was not executed
before the REPAIR FAILURE command.
Correct Answers: D

在repair failure之前,要先运行advise failure,让rman给出修复的建议,并给出修复的脚本,之后再运行repair failure
在advise failure之前,要先运行list failure,列出所要修复的错误,所以先list failure。
advise failure命令对记录在自动诊断信息库中的所有故障给出建议。默认时,此命令只列出具有critical或high优先级的那些故障。除了产生所有输入故障的摘要外,此命令还对每个故障提供一个建议修复选项。通常,advise  failure命令同时给出自动和手动修复选项。在advisefailure命令输出结束时,RMAN生成一个脚本,列出建议的修复选项的细节。如果你想自己进行修复,可以直接使用这个脚本,或者对它进行修改。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29661030/viewspace-1839904/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2015-11-16

  • 博文量
    1
  • 访问量
    3620