oracle OCP 1z0042详解 150题.docx

上传人:b****6 文档编号:8796832 上传时间:2023-02-01 格式:DOCX 页数:30 大小:510.93KB
下载 相关 举报
oracle OCP 1z0042详解 150题.docx_第1页
第1页 / 共30页
oracle OCP 1z0042详解 150题.docx_第2页
第2页 / 共30页
oracle OCP 1z0042详解 150题.docx_第3页
第3页 / 共30页
oracle OCP 1z0042详解 150题.docx_第4页
第4页 / 共30页
oracle OCP 1z0042详解 150题.docx_第5页
第5页 / 共30页
点击查看更多>>
下载资源
资源描述

oracle OCP 1z0042详解 150题.docx

《oracle OCP 1z0042详解 150题.docx》由会员分享,可在线阅读,更多相关《oracle OCP 1z0042详解 150题.docx(30页珍藏版)》请在冰豆网上搜索。

oracle OCP 1z0042详解 150题.docx

oracleOCP1z0042详解150题

1.Whichthreepiecesofinformationareconsideredwhiledecidingthesizeoftheundotablespaceinyourdatabase?

(Choosethree.)

A)thesizeofanundoblock

B)thesizeoftheredologfiles

C)undoblocksgeneratedpersecond

D)thesizeofthedatabasebuffercache

E)thevalueoftheUNDO_RETENTIONparameter

答案:

ACE

解析:

题目说的是决定UNDO表空间大小的三条:

 这题定性分析就可以了,UNDO 表空间是用来记录事务数据的.

A.每个UNDO块的大小

B.不对与redolog无关

C.每秒生成的UNDO块的量,这个越大UNDO表空间就要越大

D.与buffercache无关

E.UNDO_retention:

在事务提交以后,UNDO数据为一致性读还要保留多长时间.当然保留时间越长UNDO表空间就越大.

2.YouexecutedtheSTARTUPMOUNTcommandtostartyourdatabase.ForwhichdatabaseoperationdoyouneedtostartthedatabaseintheMOUNTstate?

A)renamingthecontrolfiles

B)droppingauserinyourdatabase

C)enablingordisablingredologarchiving

D)droppingatablespaceinyourdatabase

E)re-creatingthecontrolfiles,afteryoulostallthecontrolfilesinyourdatabase

答案:

C

解析:

数据库启动顺序,首先是nomount--读取参数文件,mount--根据参数文件打开控制文件,open=根据控制文件打开数据文件,打开数据库.所以说在mount阶段是可以改变datafile和redologfile的名称的。

在mount阶段,你可以修改数据文件的名字,同时也可以把数据改为归档或者非归档模式

3.Youwanttocreateanewoptimizeddatabaseforyourtransactionalproductionenvironmenttobeusedbyafinancialapplication.Whilecreatingthedatabase,youwanttheOraclesoftwaretotakecareofallbasicsettingstooptimizethedatabaseperformance.Whichmethodwouldyouusetoachievethisobjective?

A)UsetheCREATEDATABASE..commandtocreatethedatabasewithOracle-managedfiles.

B)UsetheDatabaseConfigurationAssistant(DBCA)tocreatethedatabasewithOracle-managedfiles.

C)UseEnterpriseManagertocreateanewdatabasewiththeOnlineTransactionProcessing(OLTP)option.

D)UseDatabaseConfigurationAssistant(DBCA)tocreatethedatabasewithTransactionProcessingtemplate.

E)UsetheCREATEDATABASE..commandtocreatethedatabasewithAutomaticStorageManagement(ASM)filesystem.

答案:

D

解析:

thekeyofthisquestionistransactionalproductionenvironment(交易生产环境)ItseemstomethatOLTP(on-linetrasactionproduction)isneeded.So,youmustcreatetheOLTPdb.AnswerA/B/Edoesnotmeettherequirementofthequestion.AnswerCiswrong.OEMcan’tcreatedb.

4.Whichthreestatementsaretrueaboutthestagesofdatabasestartup?

(Choosethree.)

A)DatafilesandredologfilescanberenamedattheMOUNTstage.

B)ControlfilesarereadattheOPENstageforthelocationofdatafiles.

C)ControlfilesarerequiredtobringthedatabasetotheNOMOUNTstage.

D)DatafilesandredologfilesaremadeavailabletousersattheOPENstage.

E)Datafilesandonlineredologfilesarecheckedforconsistencywhileopeningthedatabase(一致性检查)

答案:

ADE

解析:

数据库开启和关闭详解

5.AconstraintinatableisdefinedwiththeINITIALLYIMMEDIATEclause.YouexecutedtheALTERTABLEcommandwiththeENABLEVALIDATEoptiontoenabletheconstraintthatwasdisabled.

Whatarethetwoeffectsofthiscommand?

(Choosetwo.)

A)Itfailsifanyexistingrowviolatestheconstraint.

B)Itdoesnotvalidatetheexistingdatainthetable.

C)Itenablestheconstrainttobeenforcedattheendofeachtransaction.

D)Itpreventsinsert,update,anddeleteoperationsonthetablewhiletheconstraintisintheprocessofbeingenabled.

答案:

AD

解析:

约束状态--约束一共有四种状态 

a、enable validate-要求新旧数据必须同时满足约束规则-在规则正在进行中时是不容许在表上进行任何DML操作的 

b、enable novalidate-已存在数据可以不满足,但是新数据必须满足 

c、disable validate-不容许在表上进行任何DML操作,对主键和唯一约束来说,会删除相应的唯一索引,但约束规则仍然有效 

d、disable novalidate-数据不满足约束规则,对主键和唯一约束来说,会删除相应的唯一索引 

初始化立即执行--在每条语句执行结束时检验约束 

初始化延迟执行,一直等到事务完成后(或者调用set constraint immediate语句时)才检验约束 

SQL> create table t( x int constraint check_x check ( x > 0 ) deferrable initially immediate, 

y int constraint check_y check ( y > 0 ) deferrable initially deferred ) SQL> insert into t values ( -1,1); 

insert into t values ( -1,1);0ERROR at line 1:

 ORA-02290:

 check constraint (OPS$TKYTE.CHECK_X) violated 

由于CHECK_X是可延迟但初始化为立即执行的约束,所以这一行立刻被拒绝了。

而CHECK_Y则不同,它不仅是可延迟的,而且初始化为延迟执行,这就意味着直到我用COMMIT命令提交事务或将约束状态设置为立即执行时才检验约束。

 

SQL> insert into t values ( 1,-1); 现在它是成功的(总之到目前为止是成功的)。

我将约束检验延迟到了执行COMMIT的时候:

 

SQL> commit; 

0ERROR at line 1:

 ORA-02091:

 transaction rolled back 

ORA-02290:

 check constraint (OPS$TKYTE.CHECK_Y) violated 

此时数据库将事务回滚,因为违反约束导致了COMMIT语句的失败。

这些语句说明了初始化立即执行与初始化延迟执行约束之间的区别。

initially(初始化)部分指定Oracle什么时候会进行默认的约束检验--是在语句结束时[immediate(立即执行)],还是在事务结束时[deferred(延迟执行)]。

我还要说明deferred(可延迟)子句有什么用。

我可以发出命令,让所有可延迟的约束变为延迟执行的。

注意,你也可以对一个约束使用该命令,你不必让所有可延迟的约束都变为延迟执行的:

 

SQL>set constraints all deferred; 或者 SQL> set constraints all immediate; 

延迟约束有哪些实际用处呢?

 有很多。

它主要用于物化视图(快照)。

这些视图会使用延迟约束来进行视图刷新。

在刷新物化视图的过程中,可能会破坏完整性,而且将不能逐句检验约束。

但到执行COMMIT时,数据完整性就没问题了,而且能满足约束。

没有延迟约束,物化视图的约束可能会使刷新过程不能成功进行。

使用延迟约束的另一个普遍原因是,当预测是否需要更新父/子关系中的主键时,它有助于级联更新。

如果你将外键设为可延迟、但初始化为立即执行,那么你就可以将所有约束设置为可延迟。

 将父键更新为一个新值--至此子关系的完整性约束不会被验证。

将子外键更新为这个新值。

 COMMIT--只要所有受更新影响的子记录都指向现有的父记录,这条命令就能成功执行。

 

6. You received complaints about the degradation of SQL query performance. You identified top SQL queries that consume time. What would be your next step to find out recommendations about statistics collection and restructuring of the SQL statement to improve query performance?

 

A) run Segment Advisor 

B) run SQL Tuning Advisor on top SQL statements 

C) run the Automatic Workload Repository (AWR) report 

D) run the Automatic Database Diagnostic Monitor (ADDM) on top SQL statements 

答案:

B

解析:

当你发现sql执行慢等sql问题时,你使用top sql发现耗费时间的sql语句。

这是你需要使用SQL Tuning Advisor推荐数据收集和重建sql语句。

 可以使用 SQL 优化指导分析 SQL 语句,并获得性能建议案。

通常,会将此指导作为ADDM 性能判断工具来运行。

 addm:

auto database diagonstic(诊断) monitor 提供建议 

7. The UNDO_RETENTION parameter in your database is set to 1000 and undo retention is not guaranteed. 

Which statement regarding retention of undo data is correct?

 

A) Undo data becomes obsolete after 1,000 seconds. 

B) Undo data gets refreshed after every 1,000 seconds. 

C) Undo data will be stored permanently after 1,000 seconds. 

D) Committed undo data would be retained for 1,000 seconds if free undo space is available. 

E) Undo data will be retained in the UNDO tablespace for 1,000 seconds, then it gets moved to the TEMPORARY tablespace to provide read consistency. 

答案:

D

解析:

UNDO_RETENTION=1000s undo retention is not guaranteed Committed的undo数据会在undo表空间中保留1000s,只要undo 表空间有空闲undo表空间够用 

 

8. View the Exhibit. 

Which statement regarding the dept and emp tables is true?

 

A) When you delete a row from the emp table, you would receive a constraint violation error. 

B) When you delete a row from the dept table, you would receive a constraint violation error. 

C) When you delete a row from the emp table, automatically the corresponding rows are deleted from the dept table. 

D) When you delete a row from the dept table, automatically the corresponding rows are deleted from the emp table. 

E) When you delete a row from the dept table, automatically the corresponding rows are updated with null values in the emp table. 

F) When you delete a row from the emp table, automatically the corresponding rows are updated with null values in the dept table.

答案:

D

解析:

on delete cascade 级联删除  主表dept删除一条记录,则emp表相关联的记录也被删除

9. Which three statements are correct about temporary tables?

 (Choose three.) 

A) Indexes and views can be created on temporary tables. 

B) Both the data and the structure of temporary tables can be exported. 

C) Temporary tables are always created in a user's temporary tablespace. 

D) The data inserted into a temporary table in a session is available to other sessions. 

E) Data manipulation language (DML) locks are never acquired on the data of temporary tables.

答案:

A C E

解析:

可以对临时表创建索引,视图,触发器,可以用export和import工具导入导出表的定义,但是不能导出数据。

表的定义对所有的会话可见。

建立在临时表上的索引也是临时的,也是只对当前会话或者事务有效. 尽管对临时表的DML操作速度比较快,但同样也是要产生 Redo Log 。

D,E都一个道理,不存在并发,就不存在锁,每个人看到的都是自己的东西 。

临时表的数据只在一个transaction或session中有效,对数据操作不需要DML锁、速度快,对临时表可以创建索引、视图、触发器。

 一个用户的临时表就放在当前用户的临时表空间中,创建临时表后并不产生任何segments分配,与普通表不同。

 

10. Which statement regarding the contents of the V$PARAMETER view is true?

 

A) displays only the list of default values 

B) displays only the list of all basic parameters 

C) displays the currently in effect parameter values 

D) displays only the list of all advanced parameters 

E) displays the list of all the parameter files of a database 

F) displays the current contents of the server parameter file 

答案:

C

解析:

V$PARAMETER只是显示现在起作用的参数(currently in effect parameter values)

11.According to your backup strategy, you performed an incremental level 0 backup of your database. Which 

statement regarding this backup is true?

 

A) The backup is similar to image copy. 

B) The backup contains all used data blocks. 

C) The backup contains only unused data blocks. 

D) The backup contains all data blocks changed since the last incremental level 1 backup. 

答案:

B

解析:

备份分为完全备份和增量备份

完全备份:

创建所备份的文件中包含数据的所有数据块的副本

增量备份:

创建一个包含自以前某次备份以来更改过的所有数据块的副本(分为级别0和级别1两种)

级别0:

等同于完全备份

级别1:

累积备份:

备份自上次级别0备份以来的所有更改

差异备份:

备份自上次增量备份以来的所有更改(可以采用级别0或级别1)

12.Which step do you need to perform to enable a user with the SYSDBA privilege to log in as SYSDBA in 

iSQL*Plus?

 

A) The user must be granted the database administrator (DBA) privilege. 

B) The user must be listed in the password file for the authentication. 

C) No special setup is needed for the user to connect as SYSDBA in iSQL*Plus. 

D) Set up a user in the Oracle Application Server Containers for J2EE (OC4J) user manager, and grant the webDba 

role to the user 

答案:

D

解析:

isql*plus不能登录DBA身份,按D的步骤所做就可以了

13.Because of a power outage, instance failure has occurred. From what point in the redo log does recovery 

begin and where does it end?

 

A) current redo log and inactive redo log 

B) checkpoint position to end of redo log 

C) beginning of redo log to end of redo log 

D) all redo logs before the point of last commit 

E) beginning of redo log to checkpoint position

答案:

B

解析:

Checkpoint之前的数据已经写入到数据文件。

所以用restore就可以恢复。

而ch

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 外语学习 > 日语学习

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1