Oracle10gOCP042解析(175试题)资料_第1页
Oracle10gOCP042解析(175试题)资料_第2页
Oracle10gOCP042解析(175试题)资料_第3页
Oracle10gOCP042解析(175试题)资料_第4页
Oracle10gOCP042解析(175试题)资料_第5页
已阅读5页,还剩83页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

QQ:54110058清江石

声明:对于答案的相关的说明,是个人对Oracle的理解和收集相关资料整理,主要

参考了tianlesoftware兄资料,供大家参考学习。

2011-08-02

2跟154相同,154删除

1.Becauseofapoweroutage,instancefailurehasoccurred.Fromwhatpointinthe

redologdoesrecoverybeginandwheredoesitend?

A.Currentredologandinactiveredolog

B.Checkpointpositiontoendofredolog

C.Beginningofredologtoendofredolog

D.Allredologsbeforethepointoflastcommit

E.Beginningofredologtocheckpointposition.

答案B.

Checkpoint之前的数据已经写入到数据文件。所以用restore就可以恢复。而checkpoint之后的数据

没有写入到数据文件,所以需要进行recoveryoRecovery时,对于已经commit的数据,前滚写入到数据文件,

没有commit的数据,进行回滚。

Oracle数据库中,对BUFFERCAHCE的修改操作是前台进程完成的,但是前台进程只负责将数据块从数据文

件中读到BUFFERCACHE中,不负责BUFFERCACHE写入数据文件。BUFFERCACHE写入数据文件的操作是由后台

进程DBWR来完成的。DBWR可以根据系统的负载情况以及数据块是否被其他进程使用来将一部分数据块回写到

数据文件中。这种机制下,某个数据块被写回文件的时间可能具有一定的随机性的,有些先修改的数据块可能

比较晚才被写入数据文件。而CHECKPOINT机制就是对这个机制的一个有效的补充,CHECKPOINT发生的时候,

CKPT进程会要求DBWR进程将某个SCN以前的所有被修改的块都被写回数据文件。这样一旦这次CHECKPOINT完

成后,这个SCN前的所有数据变更都已经存盘,如果之后发生了实例故障,那么做实例恢复的时候,只需要从

这次CHECKPOINT已经完成后的变化量开始就行了,CHECKPOINT之前的变化就不需要再去考虑了。

Commit仅仅写日志文件,而不写数据文件

2.Whichtwooperationscanbeflashedbackusingtheflashbacktechnology?(choose

two)

A.Dropusersmith;

B.Droptableemployees;

C.Droptablespaceusers;

D.Altertablesales_repdroppartitionpl;

E.Altertableemployeesdropcolumndesig_id;

答案:ABo(有疑问?)

1.FlashbackDatabase不能解决MediaFailure,这种错误RMAN恢复仍是唯一选择

2.如果删除了数据文件或者利用Shrink技术缩小数据文件大小,这时不能用FlashbackDatabase技术回退到

改变之前的状态,这时候就必须先利用RMAN把删除之前或者缩小之前的文件备份restore出来,然后利用

FlashbackDatabase执行剩下的FlashbackDatbaseo

3.如果控制文件是从备份中恢复出来的,或者是重建的控制文件,也不能使用FlashbackDatabaseo

4.使用FlashbackDatabase所能恢复到的最早的SCN,取决与FlashbackLog中记录的最早SCN。

答案应该是A,B,D,E

A可以通过flashbackdatabase恢复(OCPCertificationAll-in-OneExamguide中文版第548页,28.1.4)

B可用flashbackdrop

C这个有点问题.StudyGuide上说flashbackdatabase无法恢复droptablespace,但All-in-one那本上说可

以,也是在中文版的第548页(28.1.4)

D可用flashbackdatabase

E可用flashbackdatabase

SQL>createtabledropcoltest(idnumber,namevarchar2(100));

SQL>selectcurrent_scnfromv$database;

4095011

SQL>altertabledropcoltestdrop(name);

SQL>descdropcoltest;

ID

SQL>select*fromdropcoltest;

norowsselected

SQL>conn/assysdba;

SQL>shutdownimmediate;

SQL>startupmount

SQL>flashbackdatabasetosen4095011;

SQL>conn/assysdba

SQL>alterdatabaseopenresetlogs;

SQL>connganesh/oracle

SQL>descdropcoltest;

ID

NAME

/*Samethingforpartition.Icouldhavedonebothatsametime,butforbetterunderstanding,doing

seperately*/

SQL>CREATETABLEinvoices

(invoice__noNUMBERNOTNULL,

invoice.dateDATENOTNULL,

commentsVARCHAR2(500))

PARTITIONBYRANGE(invoice_date)

(PARTITIONinvoices_qlVALUESLESSTHAN(TO_DATE('01/04/2001\'DD/MM/YYYY'))TABLESPACEusers,

PARTITIONinvoices_q2VALUESLESSTHAN(TO_DATE('01/07/2001','DD/MM/YYYY'))TABLESPACEusers,

PARTITIONinvoices_q3VALUESLESSTHAN(TO_DATE('01/09/2001\'DD/MM/YYYY'))TABLESPACEusers,

PARTITIONinvoices_q4VALUESLESSTHAN(TO_DATEC01/01/2002\'DD/MM/YYYY1))TABLESPACEusers);

SQL>selectcurrent_scnfromv$database;

4095309

SQL>altertableinvoicesdroppartitioninvoices_q1;

SQL>conn/assysdba

SQL>shutdownimmediate;

SQL>startupmount;

SQL>flashbackdatabasetosen4095309;

SQL>selectpartition_namefromuser_tab_partitionswheretable_name-INVOICES';

INVOICES.Ql

INVOICES.Q2

INV0ICES_Q3

INV0ICES_Q4

3.Youhavetoshutdownthedatabaseinstancewiththeabortoptionbecauseofahardware

failure.Whichstatementistrueaboutthesubsequentopeningofthedatabase?

A.Thedatabasewouldopennormally.

B.Thedatabasewouldnotopen,anditwouldstopatmountstage.

C.Thedatabasewouldopenalterautomaticallyperforminginstancerecovery.

D.Thedatabasewouldnotopen,andhavetoperformdatabaserecoverytoopenit.

答案:C.

如果实例异常关闭(宕机,shutdownabort),并且数据文件,控制文件,联机日志都没有丢失。

在下次启动时,要利用联机日志的内容进行恢复,这种恢复就是实例恢复(InstanceRecovery)。

InstanceRecovery主要包括3个阶段:

1)根据联机日志内容进行Rollovero(前滚)

2)打开数据库,提供服务

3)SMON或者用户进程进行Rollbacko(回滚)

具体参考Oracle备份与恢复概述中的3.2节恢复种类

/tianlesoftware/archive/2010/04/16/5490733.aspx

4.Youbackedupthecontrolfiletotrace.Whichstatementistrueaboutthetrace

filegenerated?

A.Thetracefileisinbinaryformat.

B.ThetracefilehasaSQLscriptstore-createthecontrolfile.

C.Thetracefileisabackupsetcreatedduringthebackupofthecontrolfile.

D.Thetracefilecontainstheinstructionstomanuallyre-createthecontrolfile.

E.Thetracefileisanimagecopyofthecontrolfilecreatedduringthebackupof

thethecontrolfile.

答案:B

ThetracefilehasaSQLscript,tore-createthecontrolfile.

Editor'snotes:Therearetwodifferentwaystobackupcontrolfiles.

Oneis:

ALTERDATABASEBACKUPCONTROLFILETOTRACE(asfilename);

Thisstatementisusedtocreateatracefileincludesqlstatementforcreating

controlfile

Anotheris:

ALTERDATABASEBACKUPCONTROLFILETOfilename;

Thisstatementisusedtocreatebinaryfile.it'sabackupcontrolfileforcurrent

controlfile.

联机文档:

AnalternativetotheCREATECONTROLFILEstatementisALTERDATABASEBACKUPCONTROL

FILETOTRACE,whichgeneratesaSQLscriptinthetracefiletore-createthecont

rolfile

http:〃/docs/cd/B1411701/server.101/bl0759/statements5003.htm

5.WhilerunningtheOracleUniversalInstalleronaUnixplatformtoinstallOracle

Database10gsoftware,youarepromptedtorunorainstRoot.sh.Whatdoesthisscripts

accomplish?

A.Itcreatesthepointerfile.

B.Itcreatesthebasedirectory.

C.Itcreatestheinventorypointerfile.

D.ItcreatestheOracleuserforinstallation.

E.ItmodifiestheUnixkernelparmeterstomatchOracle'srequirement.

答案:C

可以查看$ORACLE_BASE/oraInventory/orainstRoot.sh脚本的内容。该脚本实际上完成了以下工

作:

(1)仓II建softwareinventorylocationpointerfile:/etc/oralnst.loc,内容为

inventory_loc=$ORACLE_BASE/oraInventory

inst_group=oinstall

修改该文件属性:chmod644/etc/oralnst.loc

(2)创建inventorydirectory:$ORACLE_BASE/oraInventory

修改文件属性:chmod-R770$ORACLE_BASE/oraInventory

chgrpoinstall$ORACLE_BASE/oraInventory

oralnventory目录是用来存储oracle安装的所有软件组件前信息的,每个组件可能占用150k

的空间.

6.WhilesettingupanOracledatabasefbroneofyourcriticalapplications,youwant

toensurethatthedatabaseisbackedupatregularintervalswithoutyourintervention(介

入).Whatshouldyoudotoachievetheobjective?

A.Configurethedatabasetoruninarchivelogmode.

B.ConfiguretheFlashrecoveryareatoenableautomaticdatabasebackup.

C.SchedulethedatabasebackupusingDBMS_JOBpackageaftercreatingthedatabase.

D.Schedulethedatabasebackupusingrecoverymanager(RMAN)commandsaftercreatingthe

database.

E.SchedulethedatabasebackupusingDatabaseConfigurationAssistant(DBCA)while

creatingthedatabase.

答案:E.

刚看到这个答案的时候,以为答案有问题。Google一下,真有。我们注意看题目,在安装数据

库的时候,确保数据库在没有干预的情况下规则的备份。只有E中的DBCA工具合适了。而且

DBCA还真有这个功能(玩了几年Oracle,都没有留意到,杯具中…)

Ktctabaa*Cm*MaAataart(Itv*«at

UrwCvKiiM«m«»wta)«MMORl«wtMVM*Q*•(>w»fN*tma9­g

CcfMl,**OveftMarwnt*-tn***D«*a****C«wr«O«BMHw

*M&••**1•«•*CfMrW»«M»4Q«r

7.TheapplicationdevelopmentteamhasdevelopedPL/SQLproceduresandfunctionsfbr

differentpurposesandcallsthemasandwhenrequired.Theloadingofindividual

proceduresorfunctionsintomemorydegradesperformancewitheverycall.Also,itcauses

asecurityproblemfbrindividualsubprogramsandlossofprogramunitswhenthewhole

systemistransportedintoanewlocation.Whichmethodwouldyourecommendtothe

applicationdeveloperstosolvethisproblem?

A.Avoidingtheuseofcursorsinthesubprograms.

B.Usinganonymous(匿名)PL/SQLblocksinsteadofsubprograms.

C.Referringtoviewsinsteadoftablesinsidethesubprograms.

D.creatingPL/SQLpackagestoincludeinterrelated(相关关联)subprograms.

答案:D.

8.ViewtheExhibit.

YourOracle10gdatabasehas6tablespacesinwhich:

-TEMPisthedefaulttemporarytablespace

-UNDOTBS1isthedefaultundotablespace

-USERSisthedefaultpermanenttablespace

Inthisdatabase,whichthreetablespacescanbemadeoffline?(Choosethree.)

ATEMP

BPROD

CUSERS

DSYSAUX

ESYSTEM

FUND0TBS1

答案:BCD

SYSAUX表空间是可以被OFFLINE,不能readonly,但是system>undo和temp不行,why?

SQL>altertablespacesysauxoffline;

表空间已更改。

SQL>altertablespacetempoffline;

第1行出现错误:

ORA-03217:变更TEMPORARYTABLESPACE无效的选项

SQL>altertablespacesystemoffline;

第1行出现错误:

ORA-01541:系统表空间无法脱机;如有必要请关闭

9.ThejuniorDBAinyourorganizationhasaccidentallydeletedthealertlogfile.What

willyoudotocreatenewalertlogfile?

A.Createthenewtextfileasalert.log

B.Youhavetorecoverthealertlogfilefromthevalidbackup.

C.ChangethevaluefortheBACKGROUND_DUMP_DESTparameter.

D.Noactionrequired.Thefilewouldbecreatedautomaticallybytheinstance.

答案D

10.Whileplanningtomanagemorethanonedatabaseinyoursystem,youperformthe

followingactivities:

(1)organizedifferentcategoriesoffilesintoindependentsubdirectories.

(2)Useconsistentnamingconventionfordatabasefiles.

(3)Separateadministrativeinformationpertainingtoeachdatabase.

Whichoptioncorresponds(一致)tothetypeofactivitiesperformedbyyou?

A.OracleManagedFiles.

B.OracleGridArchitecture.

C.OptimalFlexiblearchitecture.

D.Oracledatabasearchitecture.

答案:C

Flexible灵活的architecture体系结构

OracleGridArchitectureisusedforrac

Oracle的最佳灵活体系结构(OptimalFlexibleArchitecture,简称OFA),是指Oracle软件数据库文件及文件

夹的命名约和存储位置规则。

使用最佳灵活体系结构,能够简化数据库系统的管理工作,使数据库管理员更加容易地定位文件或添加文件;

还可以将Oracle系统的执行文件、管理文件、数据文件分别存储到不同的硬盘上,从而有效地使用用户系统中

的所有存储空间、克服某个(些)硬盘存储空间的限制,合理分配存储负担,降低单个硬盘存储速度方面的瓶

颈,提高整个系统的存储效率。

OFA的核心是一个命名机制

1,linux/unix下面对于mount点的命名采用/pm的方式

P:字符常量,通常是um:固定长度,通常是2

例如/uOl、/u02

2、BASE目录通常是/pm/h/u

h:常量,通常是appu:目录所有者,通常是oracle

例如/uOI/app/oracle

3、ORACLE_HOME目录通常是/pm/h/u/product/V

V:版本号,例如9.2.0、10.2.0

新增的一些组件,例如asm、db_l都在这个目录下面

例如/u01/app/oracle/producl/10.2.0

4、数据库特定的管理文件,例如启动参数文件、转储文件

/pm/h/u/admin/d/a

d表示数据库的名字a表示子目录的名称,例如参数文件是pfile,用户目录是udump

例如/u01/app/oracle/admin/ora1Og/pfile

5、关键文件通常是/pm/q/d

q通常是oradata例如/u02/oradata/oral0g

控制文件通常是controln.ctl,n表示数据位数,通常是2

例如controlOl.ctRcontrol02.ctl

redon.log,n通常是2,例如redoO1.log>redo02.log

数据文件tn.dbf,t表示表空间的名字,n通常是2

例如users01.dbf>users02.dbf等

1l.Datafilesofwhichthreetablespacescanberecoveredbyperforminganopen

recovery?(Choosethree)

A.TEMP

B.UNDO

C.INDEX

D.SYSAUX

E.SYSTEM

答案:ACD(觉得A有问题)

Editor'snots:temptablespacedoesnotneedtorecover.whenyouperform,openrecovery,

tablespacemustbetakenoffline.So,exceptundo/system/temptablespace,allofother

tablepsacecanberecoveredwhendatabaseopen.

12.Yourtnsnames.orafilehasthefollowingentryfortheservicealiasORCL:

ORCL=

(DESCRIPTION二

(ADDRESS=(PROTOCOL=TCP)(HOST=16)(PORT=1521))

(CONNECT_DATA二

(SERVER二DEDICATED)

(SERVICE_NAME=)

)

)

TheTNSPINGcommandexecutessuccessfullywhentestedwithORCLbutyouarenotableto

connecttothedatabaseinstancewiththefollowingcommand:

SQL>CONNECTscott/tiger@orcl

Whatcouldbethereasonforthis?

A)Thelistenerisnotrunningattheserver.

B)TheTNS_ADMINenvironmentalvariableissettoawrongvalue.

C)Thedatabaseserviceisnotregisteredwiththelistener.

D)TheDEFAULT_DOMAINparameterissettoawrongvalueintheSQLNET.ORAfile.

答案:C.

当SERVICE_NAME填写不正确时,你可以tnsping通数据库实例,但是却无法连接到数据库实例,因为你填写错

的SERVICE_NAME并没有注册到LISTENER当中

listener是在dbserver上配置,凡是在client端要连接db都需要通过listener,就像非本单位员工要想进

入该单位所在的办公大楼必须去保安那里登记一下自己的信息(亮名自己的身份同时说出来要找谁、办什么事

儿),之后保安打电话和你要找的人进行确认和求证。host和port很好理解,不多赘述,重要的是这个

SERVICE.NAME到底是指什么?这里明确说明一下,它就是我们在listenerstatus信息中显示的那些服务“X”,

这里的X=B,C,a,TEST(看上面的listenerstalus信息),这里如果SERVICE_NAME=B|C,那么通过这个tns连接

所对应的session它使用的就是动态注册的listener连接db的;如果SERVICE_NAME=a,那么通过这个tns连

接所对应的session它使用的就是静态注册的lislener连接db的;如果SERVICE_NAME=test的话,那么通过

这个tns连接所对应的session它使用的到底是通过动态还是静态listener连接db的呢?

SQL>selectsid,service_namefromv$sessionwheresid=(selectsidfromv$mystat

whererownum=l);153SYSSUSERS,很显然SERVICE_NAME=SYS$USERS其对应的tnsa使用的service_name=a是

静态注册的信息可以通过如下视图查看db活动的service_name:SQL>selectnamefromv$active_services;

C,B,TEST,SYS$BACKGROUND--后台进程对应的session的service_name都看作SYS$BACKGROUND,

SYS$USERS—oracle统一把静态注册到lislener的globaldb_name信息对应的service_name都看作

SYS$USERS,以上db是运行在专用模式下,当然我们配置的tns使用的都是专用模式在配置tns时service_name

必须是通过动态注册到listener中的service_names信息,通过静态注册的listener信息是不能通过共享模

式连接db

/thread-l170687・.html(warehouse详细讲解)

13.ViewtheExhibit,andexaminethealertmessages.

YouaddedspacetotheTESTtablespacetobringthespaceusagebelowthethres

holdvalue.

WhichstatementistrueabouttheTablespaceFullalert?

▼Aleds

Category隔W*卬)Criticalx1Warning公3

XUMMDMnS।、ju;3Jul11,20CEo46;20

Metnc46AM

TabM&pacnFdl口如:》。TEST>37MlJul11,20063.11.55

闻AM

闻AuditAuditedUswf中,上土由七.「u;3$」:.y”1Jul11,20062.26;为

AM

虫UiwrAuditAudited片叫SR1叫?山"fromA-OPAUFMNCIIiFJul11,2006225:39

AM

A)Thealertispurgedbecauseitisathresholdalert.

B)Thealertisclearedandtransferredtothealertlogfile.

C)Thealertisautomaticallyclearedandsenttothealerthistory.

D)ThealertappearsinOracleEnterpriseManagerDatabaseControluntilitismanually

cleared.

答案:c

在EM上的表空间空间不够用的告警信息会在你扩大表空间后,自动被清除,同时移动到alter

history

select*fromdba_outstanding_alerts警告记录地方,只记录根据度量产生的

select*fromdba_alert_history(警告归档后的地方,记录所有的)

14.Whichisthememoryareathatiscreatedwhenadedicatedserverprocessisstarted,

andcontainsdataandcontrolinformationforthatserverprocess?

A.SGA

B.PGA

C.SharedPool

D.StreamsPool

答案:B

.独立服务进程启动时,里面包括这个进程的数据和控制信息

在ORACLE9I中,只需要调整PGA_AGGREGATE_TARGETO

Oracle内存架构详解

/tianlesoftware/archive/2010/05/16/5594080.aspx

SGA是一组为系统分配的共享的内存结构,可以包含一个数据库实例的数据或控制信息。

PGA(ProgramGlobalArea程序全局区)是一块包含一个服务进程的数据和控制信息的内存区域。

15.WhichtwostatementsaboutRecoveryManager(RMAN)backupsaretrue?(Choosetwo).

A.Onlineredologfilescanbebackedup.

B.Archivedredologfilesarebackedup.

C.Onlyuseddatablockscanbebackedupasbackupsets.

D.Onlyconsistentdatabasebackupscanbeperformed.

E.RMANbackupcanbetakenonlyifthedatabaseisconfiguredinARCHIVELOGmode.

答案:BC

归档日志可以使用rman备份、只有使用过的数据块可以被备份成备份集

如何搭建RMAN备份平台

http:〃/tianlesoftware/archive/2010/07/16/5740896.aspx

对于E选项:

在NOARCHIVELOG模式下,rman备份会报ORA-19602:无法按NOARCHIVELOG模式备份或复制

活动

文件,但是当SQL>altertablespaceusersoffline;Wc#SQL>altertablespaceusersread

only;后就可以执行备份了.或者在mount状态下也可以rman备份

16.Whichthreepiecesofinformationaretobemanatorilyprovidedwhilecreatinganew

listenerusingEnterpriseManagerdatabaseControl?(Choosethree).

A.Theportusedbythelistener.

B.Theprotocolusedbythelistener.

C.Theservernamewherethelistenerruns.

D.Thelogfileandtracefiledestinationforthelistener.

E.Thedatabaseservicestoberegisteredwiththelistener.

答案:ABC

Protocol:协议

17.TheSCOTTuserhasanindexontheITEM_DESCcolumnoftheITEMtable.Aspartof

theyear-endingtask,SCOTTupdatestheITEM_DESCcolumnformostoftherowsintheITEM

table.Howdoesthischangetothetableaffecttheindex?

A.Anupdateinaleafrowtakesplace.

B.Theindexbecomesinvalidaftertheupdate.

C.Theleafblockcontainingtherowtobeupdatedismarkedasinvalid.

D.Arowintheleafblockoftheindexforthekeyvalueisdeletedandinserted.

答案:D

每年用户一个表上的一个列,那么在这个列上的索引,行数据在索引leafblock的值会删除

再被插入(估计是便于维护),索引叶子节点包括rowid(需实验)

18.Inthemiddleofatransactionsusersessionwasabnormallyterminatedbutthe

instanceisstillupandthedatabaseisopen.Whichtwostatementsaretrueinthescenario

(方案)?(Choosetwo).

A.Eventviewergivesmoredetailsonthefailure.

B.Thealertlogfilegivesdetailedinformationaboutthefailure.

C.PMONrollsbackthetransactionandreleasesthelocks.

D.SMONrollsbackthetransactionandreleasesthelocks.

E.Thetransactionisrolledbackupbythenextsessionthatreferstoanyoftheblocks

updatedbythefailedtransaction.

F.Datamodifiedbythetransactionuptothelastcommitbeforetheabnormaltermination

isretainedinthedatabase.

答案:CF

当在一个transaction中时,会话不正常结束,这时PMON会自动将没有提交的数据rollback,

commited的脏数据放到datafile中

F的意思如果一个SESSION,前面有COMMIT的部分是不回滚的。只有还未COMMIT部分被回滚了

PMON:进程监控进程

1:进程负责在反常中断的连接之后的清理工作。

2:PMON监控其他oracle后台进程,如果有必要(和有可能)重新启动他们

3:使用OracleTNS监听器登记

SMON:系统监控,SMON是负责做所有系统级的工作。相对于PMON对单个进程感兴趣,SMON是一

个系统级别的观点,是一种用于库的“垃圾收集者

1.清理临时空间以及临时段

SMON负责在数据库启动时清理临时表空间中的临时段,或者一些异常操作过程遗留下来的临时

段,例如,当创建索引过程中,创建期间分配给索引的Segment被标志为TEMPORARY,如果Create

Index(或rebuildIndex等)会话因某些原因异常中断,SMON负责清理这些临时段。

2.接合空闲空间

在DMT(字典管理表空间)中,SMON负责把那些在表空间中空闲的并且互相是邻近的Extent接合

成一个较大的空闲扩展区,这需要表空间的pctincrease设置为非零值。

3.执行实例恢复(Instancerecovery)

在实例恢复过程中,SMON的工作包括三个环节:应用Redo执行前滚、打开数据库提供访问、回

滚未提交数据

4,离线(Offline)回滚段

在自动回滚段管理(AUM)中负责Offline不再需要的回滚段

5.执行并行恢复。

SMON:Paralleltransactionrecoverytried

19.Theapplicationworkloadonyourdatabaseissamebwtween10a.m.And11a.m.On

weekdays.Suddenlyyouobservepoorperformancebetween10a.m.And11a.m.Inthemiddle

oftheweek.Howwouldyouidentifythechangesinconfigurationsettings,workload

profile,andstatisticstodiagnosethepossiblecausesoftheperformancedegradation?

A.ByusingtheSQLaccessadvisor

B.Byusingtheautomaticworkloadrepositoryreport.

C.Byrunningtheautomaticdatabasediagnosticmonitor(ADDM)

D.Byusingtheautomaticworkloadrepository(AWR)compareperiodreport.

E.Byanalyzingtheoutputofthev$ACTIVE_SESSION_HISTORYview.

答案:D

查看awr报告选择开始快照和结束快照之间数据库不要重启

WhileanAWRreportshowsAWRdatabetweentwosnapshots(ortwopointsintime),the

AWRComparePeriodsreportshowsthedifferencebetweentwoperiods(ortwoAWRreports,

whichequatestofoursnapshots).UsingtheAWRComparePeriodsreporthelpsyouto

identifydetailedperformanceattributesandconfigurationsettingsthatdifferbetween

twotimeperiods.(即可以对比两个不同时间段的AWR报告)

TogenerateanAWRComparePeriodsreport:@$ORACLE_HOME/rdbms/admin/awrddrpt.sql

AutomaticDatabaseDiagnosticMonitor(ADDM)ADDM在创建每个AWR快照之后自动运行。每

次创建快照后,ADDM都会分析与最后两个快照对应的时段。多数情况下,ADDM会为检测到的问

题提供建议解决方案,甚至可以量化这些建议案的

优势。ADDM分析的结果存放在AWR中。

OracleAWR介绍

http:〃/tianlesoftwar6/archive/2009/10/17/4682300.aspx

20.YourdatabaseisinNOARCHIVELOGmode.Afterwhichtwooperationsyoushouldtake

thebackupofthecontrolfile?

A.Addinganewusertothedatabase.

B.Droppingauserfromthedatabase.

C.Droppingatablefromthedatabase.

D.Droppingadatafilefromatablespace.

E.Addinganewtablespacetothedatabase.

答案:DE.

控制文件里保存了数据文件的信息,所以添加删除都会修改控制文件里的内容,所以需要修改。

注意本题是在非归档下,要完全恢复的时候只能用冷备份方式,添加删除都会对当前控制文件有改

动,显然只能用备份的控制文件才能恢复到最近冷备份的那一刻。

Oracle控制文件

/tianlesoftware/archive/2009/12/13/4974440.aspx

21.WhichthreestatementsaretrueregardingthelogicalstructureoftheOracledatabase?

(Choosethree).

A.Eachsegmentcontainsoneormoreextents.

B.Multipletablespacecansharesingledatafile.

C.AdatablockisthesmallestunitofI/Ofordatafiles.

D.Itispossibletohavetablespaceofdifferentblocksizesinadatabase.

E.EachdatablockinthedatabasealwayscorrespondstooneOSblock.

答案:ACD

区间(extent)是oracle的最小空间分配单元,而block是oracle的最小io操作单元。

Oracle以区间为单位将空间分配给对象段,而段内则是以block为单位进行空间使用和管理.

表空间(tableSpace)段(segment)盘区(extent)块(block)关系

http:〃/tianlesoftware/archive/2009/12/13/4962476.aspx

22.Youexecutedthefollowingcommandtostartthedatabase:

SQL>STARTUP

ORACLEinstancestarted.

TotalSystemGlobalArea281018368bytes

FixedSize789000bytes

VariableSize229635576bytes

DatabaseBuffers50331648bytes

RedoBuffers262144bytes

ORA-00205:errorinidentifyingcontrolfile,checkalertlogformoreinfo

Whichviewwouldyouqueryatthisstagetoinvestigatethismissingcontrolfile?

A)VSINSTANCE

B)V$CONTROLFILE

C)DBA_CONTROL_FILES

D)V$DATABASE_PROPERTIES

E)V$CONTROLFILE_RECORD_SECTION

答案:B

当控制文件丢失时,你可以通过动态性能视图V$controlfile来查看丢失的控制文件

疑问:v开头视图绝大部门来自控制文件或内存,如果控制文件丢失了,这个视图还能查吗

无C选项对应视图

查询v$controlfile一record_section可以得出控制文件的使用情况

23.WhichtwoarevalidlockinglevelsthatareusedbytransactionsinanOracledatabase?

(Choosetwo)

A.Rowlevel

B.Blocklevel

C.Objectlevel

D.Schemalevel

E.Databaselevel

答案:AC

事务级别的锁定:行,对象

ORACLE锁机制

/tianlesoftware/archive/2009/10/20/4696896.aspx

24.Yourdatabaseisstartedbyusingtheserverparameterfile(SPFILE).Youissuedthis

commandtochangethevalueoftheLOG_BUFFERinitializationparameter:

ALTERSYSTEMSETLOG_BUFFER=24MSCOPE=BOTH;

Whatwouldbetheoutcomeofthiscommand?

A)ThecommandwouldreturnanerrorbecauseLOG_BUFFERisastaticparameter.

B)Theparametervaluewouldbechangedanditwouldcomeintoeffectimmediately.

C)Youneedtorestartthedatabasesothatparameterchangescancomeintoeffect.

D)ThecommandwouldsucceedonlyifinitializationparameterLOG_ARCHIVE_MAX_PROCESS

issettovalue2.

答案:A

LOG_BUFFER是个静态参数,只能scope=spfile,修改完后重启数据库才能生效

LOG_BUFFERspecifiestheamountofmemory(inbytes)thatOracleuseswhenbuffering

redoentriestoaredologfile.Redologentriescontainarecordofthechangesthat

havebeenmadetothedatabaseblockbuffers.TheLGWRprocesswritesredologentries

fromthelogbuffertoaredologfile.

Thelogbuffersizedependsonthenumberofredostrandsinthesystem.Oneredo

strandisallocatedforevery16CPUsandhasadefaultsizeof2MB.Oracleallocates

aminimumof2redostrandsperinstance.Whenthelogbuffersizeisnotspecified,any

remainingmemoryintheredogranulesisgiventothelogbuffer.

LOG_BUFFER

/docs/cd/El1882_01/server.112/el0820/initparamsl27.htm#REF

RN10094

SQL>selectname,issys_modifiablefromv$parameterwherename='log_buffeT;

NAMEISSYS_MOD

log_bufferFALSE

通汪这个查询,我们知道,修改这个参数必须重启数据库。

25.WhichtwostatementsaretrueabouttherolesintheOracledatabase?(Choosetwo)

A.Arolecanbegrantedtoitself.

B.Rolesareownedbythesysuser.

C.Rolescanbegrantedtootherroles.

D.Arolecannotbeassignedexternalauthentication.

E.Arolecancontainbothsystemandobjectprivileges.

答案:C,E

externalauthentication外部认证

createrolerolelidentifiedexternally;

角色在定义是可以加口令验证,但是使用identifiedexternally时用户属于外部认正,书上说

是系统认证,而且定义是不用设置口令,这时我要激活角色该怎么提供口令呢?

role可以赋予给其它的role,同时role的权限可以包括系统权限和对象权限

查看角色具有的系统权限

select*fromdba_sys_privswheregrantee-DBA';

查看角色具有的对象权限

select*fromdba_tab_privswheregrantee=Tole_test';

查看用户具有的加咨

select*fromdba_role_privswheregrantee='ROLE_TEST'

26.Youhavebeenrecentlyhiredasadatabaseadministrator.Yourseniormanagerasks

youtostudythe

productiondatabaseserverandsubmitareportonthesettingsdonebythepreviousDBA.

Whileobserving

theserversettings,youfindthatthefollowingparameterhasbeensetintheparameter

fileofthedatabase:

REMOTE_OS_AUTHENT=TRUE

WhatcouldhavebeenthereasontosetthisparameterasTRUE?

A)toenableoperatingsystemauthenticationforaremoteclient

B)torestrictthescopeofadministrationtoidenticaloperatingsystems

C)toallowthestartupandshutdownofthedatabasefromaremoteclient

D)toenabletheadministrationoftheoperatingsystemfromaremoteclient

E)todisabletheadministrationoftheoperatingsystemfromaremoteclient

答案:A

初始化参数REMOTE_OS_AUTHENT用来控制是否允许远端操作系统验证,默认情况下,数据库只

运行本地服务器上的操作系统验证

OSAUTH_PREFIX_DOMAIN

SQL>showparameteros_authent_prefix

SQL>altersystemsetos_authent_prefix=nscope=spfile;

SQL>createuserIhidentifiedexternallydefaulttablespaceusers;

SQL>grantconnecttoIh;

SQL>selectusername,passwordfromdba_userswhereusemame=,LH,;

SYSDBA,SYSOPER这两个权限比较特殊而已,SYSDBA权限大些

如果操作系统认证,sqlplussysassysdba后面口令不需要,类似保险柜的门不加密码,有钥匙

房子都是你的.sqlplusa/bassysdba只要assysdba就能连,都挂在sys用户下

Win下,管理-->ora_dba组,有administrator类似linux下的dba组

只要有权限来操作索统服务器危险,其他都一张白纸

1.1注册表项:OSAUTH_PREFIX_DOMAIN(字符串键名)

OSAUTH_PREFIX_DOMAIN默认值为TRUE,该项位于注册表

Oracle9i版本:HKEY_LOCAL_MACHINESOFTWAREORACLEHOMEO

Oracle10g版本:在HKEY_LOCAL_MACHINESOFTWAREOracleKEY_OraDb10g_home1

如果注册表中没有OSAUTH_PREFIX_DOMAIN这项,说明OSAUTH_PREFIX_DOMAIN为true,这时

进行

操作系统验证需要在用户名和os_authent_prefix之间增加,主机名,信息;若在注册表中加入此

参数OSAUTH_PREFIX_DOMAIN,并设其值为FALSE,则其规则和UNIX系统中的操作系统验证一致,

即:OS_AUTHENT_PREFIX的值||操作系统的用户名

1.2SQLNET.ORA参数文件里,必须设置

SQLNET.AUTHENTICATION_SERVICES=(NTS)

否则,登录时系统会报:

SQL>CONNECT/

ORA-01004:defaultusernamefeaturenotsupported;logondenied

Warning:Youa

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论