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

提交評論