Escolar Documentos
Profissional Documentos
Cultura Documentos
8y !ames koopmann
1echnlcal Cracle
1hls ls Lhe parL you have all been walLlng on lease lf you have [usL sklpped Lo Lhls secLlon go back Lo
Lhe personal secLlon and read lL 1here ls much Lo be galned by Lhe personal secLlon and conveylng Lo
your lnLervlewer who you are and how you Llck from day Lo day Also Lhe answers l am glvlng here are
off Lhe cuff and are noL lnLended Lo be Lhe deflnlLlve answer Lo Lhese quesLlons 1here are many aspecLs
Lo Lhese quesLlons LhaL [usL cannoL be answered here and honesLly you wlll noL have Llme Lo explaln
any of Lhese quesLlons fully ln Lhe lnLervlew process lL ls up Lo you Lo make sure your lnLervlewer
undersLands LhaL you undersLand Lhe quesLlon and have glven enough lnformaLlon LhaL Lhey know you
undersLand Lhe concepL
1 Lxplaln Lhe dlfference beLween a hoL backup and a cold backup and Lhe beneflLs assoclaLed wlLh
each
A hoL backup ls baslcally Laklng a backup of Lhe daLabase whlle lL ls sLlll up and runnlng and lL musL be ln
archlve log mode A cold backup ls Laklng a backup of Lhe daLabase whlle lL ls shuL down and does noL
requlre belng ln archlve log mode 1he beneflL of Laklng a hoL backup ls LhaL Lhe daLabase ls sLlll
avallable for use whlle Lhe backup ls occurrlng and you can recover Lhe daLabase Lo any polnL ln Llme
1he beneflL of Laklng a cold backup ls LhaL lL ls Lyplcally easler Lo admlnlsLer Lhe backup and recovery
process ln addlLlon slnce you are Laklng cold backups Lhe daLabase does noL requlre belng ln archlve
log mode and Lhus Lhere wlll be a sllghL performance galn as Lhe daLabase ls noL cuLLlng archlve logs Lo
dlsk
2 ?ou have [usL had Lo resLore from backup and do noL have any conLrol flles Pow would you go
abouL brlnglng up Lhls daLabase?
l would creaLe a LexL based backup conLrol flle sLlpulaLlng where on dlsk all Lhe daLa flles where and
Lhen lssue Lhe recover command wlLh Lhe uslng backup conLrol flle clause
3 Pow do you swlLch from an lnlLora flle Lo a spflle?
lssue Lhe creaLe spflle from pflle command
4 Lxplaln Lhe dlfference beLween a daLa block an exLenL and a segmenL
A daLa block ls Lhe smallesL unlL of loglcal sLorage for a daLabase ob[ecL As ob[ecLs grow Lhey Lake
chunks of addlLlonal sLorage LhaL are composed of conLlguous daLa blocks 1hese grouplngs of
conLlguous daLa blocks are called exLenLs All Lhe exLenLs LhaL an ob[ecL Lakes when grouped LogeLher
are consldered Lhe segmenL of Lhe daLabase ob[ecL
3 Clve Lwo examples of how you mlghL deLermlne Lhe sLrucLure of Lhe Lable uL1
use Lhe descrlbe command or use Lhe dbms_meLadaLageL_ddl package
6 Where would you look for errors from Lhe daLabase englne?
ln Lhe alerL log
7 Compare and conLrasL 18unCA1L and uLLL1L for a Lable
8oLh Lhe LruncaLe and deleLe command have Lhe deslred ouLcome of geLLlng rld of all Lhe rows ln a
Lable 1he dlfference beLween Lhe Lwo ls LhaL Lhe LruncaLe command ls a uuL operaLlon and [usL moves
Lhe hlgh waLer mark and produces a now rollback 1he deleLe command on Lhe oLher hand ls a uML
operaLlon whlch wlll produce a rollback and Lhus Lake longer Lo compleLe
8 Clve Lhe reasonlng behlnd uslng an lndex
lasLer access Lo daLa blocks ln a Lable
9 Clve Lhe Lwo Lypes of Lables lnvolved ln produclng a sLar schema and Lhe Lype of daLa Lhey hold
lacL Lables and dlmenslon Lables A facL Lable conLalns measuremenLs whlle dlmenslon Lables wlll
conLaln daLa LhaL wlll help descrlbe Lhe facL Lables
10 WhaL Lype of lndex should you use on a facL Lable?
A 8lLmap lndex
11 Clve Lwo examples of referenLlal lnLegrlLy consLralnLs
A prlmary key and a forelgn key
12 A Lable ls classlfled as a parenL Lable and you wanL Lo drop and recreaLe lL Pow would you do Lhls
wlLhouL affecLlng Lhe chlldren Lables?
ulsable Lhe forelgn key consLralnL Lo Lhe parenL drop Lhe Lable recreaLe Lhe Lable enable Lhe forelgn
key consLralnL
13 Lxplaln Lhe dlfference beLween A8CPlvLLCC mode and nCA8CPlvLLCC mode and Lhe beneflLs and
dlsadvanLages Lo each
A8CPlvLLCC mode ls a mode LhaL you can puL Lhe daLabase ln for creaLlng a backup of all LransacLlons
LhaL have occurred ln Lhe daLabase so LhaL you can recover Lo any polnL ln Llme nCA8CPlvLLCC mode
ls baslcally Lhe absence of A8CPlvLLCC mode and has Lhe dlsadvanLage of noL belng able Lo recover Lo
any polnL ln Llme nCA8CPlvLLCC mode does have Lhe advanLage of noL havlng Lo wrlLe LransacLlons Lo
an archlve log and Lhus lncreases Lhe performance of Lhe daLabase sllghLly
14 WhaL command would you use Lo creaLe a backup conLrol flle?
AlLer daLabase backup conLrol flle Lo Lrace
13 Clve Lhe sLages of lnsLance sLarLup Lo a usable sLaLe where normal users may access lL
S1A81u nCMCun1 lnsLance sLarLup
S1A81u MCun1 1he daLabase ls mounLed
S1A81u CLn 1he daLabase ls opened
16 WhaL column dlfferenLlaLes Lhe v$ vlews Lo Lhe Cv$ vlews and how?
1he lnS1_lu column whlch lndlcaLes Lhe lnsLance ln a 8AC envlronmenL Lhe lnformaLlon came from
17 Pow would you go abouL generaLlng an LxLAln plan?
CreaLe a plan Lable wlLh uLlxplansql
use Lhe explaln plan seL sLaLemenL_ld LsL1 lnLo plan_Lable for a SCL sLaLemenL
Look aL Lhe explaln plan wlLh uLlxplpsql or uLlxplssql
18 Pow would you go abouL lncreaslng Lhe buffer cache hlL raLlo?
use Lhe buffer cache advlsory over a glven workload and Lhen query Lhe v$db_cache_advlce Lable lf a
change was necessary Lhen l would use Lhe alLer sysLem seL db_cache_slze command
19 Lxplaln an C8A01333
?ou geL Lhls error when you geL a snapshoL Loo old wlLhln rollback lL can usually be solved by lncreaslng
Lhe undo reLenLlon or lncreaslng Lhe slze of rollbacks ?ou should also look aL Lhe loglc lnvolved ln Lhe
appllcaLlon geLLlng Lhe error message
20 Lxplaln Lhe dlfference beLween $C8ACLL_PCML and $C8ACLL_8ASL
C8ACLL_8ASL ls Lhe rooL dlrecLory for oracle C8ACLL_PCML locaLed beneaLh C8ACLL_8ASL ls where
Lhe oracle producLs reslde
Well we have gone Lhrough Lhe flrsL 23 quesLlons as l would answer Lhem durlng an lnLervlew lease
feel free Lo add your personal experlences Lo Lhe answers as lL wlll always lmprove Lhe process and add
your parLlcular Louch As always remember Lhese are core u8A quesLlons and noL necessarlly relaLed
Lo Lhe Cracle opLlons LhaL you may encounLer ln some lnLervlews 1ake a close look aL Lhe requlremenLs
for any [ob and Lry Lo come up wlLh quesLlons LhaL Lhe lnLervlewer may ask nexL Llme we wlll Lackle Lhe
resL of Lhe quesLlons unLll Lhen good luck wlLh Lhe process
The interview process can be quite stressful. Here is the first part of a two part series on helping you
answer those tough questions that you might experience in your quest for an Oracle DBA position.
actually wrote this article a long time ago but it is amazing how many questions still get every week from
this one. Stay tunned for Part next week.
Technical - Oracle
This is the part you have all been waiting on. Please if you have just skipped to this section, go back to
the personal section and read it. There is much to be gained by the personal section and conveying to
your interviewer who you are and how you tick from day to day. Also, the answers am giving here are off
the cuff and are not intended to be the definitive answer to these questions. There are many aspects to
these questions that just cannot be answered here and honestly, you will not have time to explain any of
these questions fully in the interview process. t is up to you to make sure your interviewer understands
that you understand the question and have given enough information that they know you understand the
concept.
1. Explain the difference between a hot backup and a cold backup and the benefits associated with each.
A hot backup is basically taking a backup of the database while it is still up and running and it must be in
archive log mode. A cold backup is taking a backup of the database while it is shut down and does not
require being in archive log mode. The benefit of taking a hot backup is that the database is still available
for use while the backup is occurring and you can recover the database to any point in time. The benefit
of taking a cold backup is that it is typically easier to administer the backup and recovery process. n
addition, since you are taking cold backups the database does not require being in archive log mode and
thus there will be a slight performance gain as the database is not cutting archive logs to disk.
2. You have just had to restore from backup and do not have any control files. How would you go about
bringing up this database?
would create a text based backup control file, stipulating where on disk all the data files where and then
issue the recover command with the using backup control file clause.
3. How do you switch from an init.ora file to a spfile?
ssue the create spfile from pfile command.
4. Explain the difference between a data block, an extent and a segment.
A data block is the smallest unit of logical storage for a database object. As objects grow they take
chunks of additional storage that are composed of contiguous data blocks. These groupings of
contiguous data blocks are called extents. All the extents that an object takes when grouped together are
considered the segment of the database object.
5. Give two examples of how you might determine the structure of the table DEPT.
Use the describe command or use the dbms_metadata.get_ddl package.
6. Where would you look for errors from the database engine?
n the alert log.
7. Compare and contrast TRUNCATE and DELETE for a table.
Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table.
The difference between the two is that the truncate command is a DDL operation and just moves the high
water mark and produces a now rollback. The delete command, on the other hand, is a DML operation,
which will produce a rollback and thus take longer to complete.
8. Give the reasoning behind using an index.
Faster access to data blocks in a table.
9. Give the two types of tables involved in producing a star schema and the type of data they hold.
Fact tables and dimension tables. A fact table contains measurements while dimension tables will contain
data that will help describe the fact tables.
10. . What type of index should you use on a fact table?
A Bitmap index.
11. Give two examples of referential integrity constraints.
A primary key and a foreign key.
12. A table is classified as a parent table and you want to drop and re-create it. How would you do this
without affecting the children tables?
Disable the foreign key constraint to the parent, drop the table, re-create the table, enable the foreign key
constraint.
13. Explain the difference between ARCHVELOG mode and NOARCHVELOG mode and the benefits
and disadvantages to each.
ARCHVELOG mode is a mode that you can put the database in for creating a backup of all transactions
that have occurred in the database so that you can recover to any point in time. NOARCHVELOG mode
is basically the absence of ARCHVELOG mode and has the disadvantage of not being able to recover to
any point in time. NOARCHVELOG mode does have the advantage of not having to write transactions to
an archive log and thus increases the performance of the database slightly.
14. What command would you use to create a backup control file?
Alter database backup control file to trace.
15. Give the stages of instance startup to a usable state where normal users may access it.
STARTUP NOMOUNT - nstance startup
STARTUP MOUNT - The database is mounted
STARTUP OPEN - The database is opened
16. What column differentiates the V$ views to the GV$ views and how?
The NST_D column which indicates the instance in a RAC environment the information came from.
17. How would you go about generating an EXPLAN plan?
Create a plan table with utlxplan.sql.
Use the explain plan set statement_id = 'tst1' into plan_table for a SQL statement
Look at the explain plan with utlxplp.sql or utlxpls.sql
18. How would you go about increasing the buffer cache hit ratio?
Use the buffer cache advisory over a given workload and then query the v$db_cache_advice table. f a
change was necessary then would use the alter system set db_cache_size command.
19. Explain an ORA-01555
You get this error when you get a snapshot too old within rollback. t can usually be solved by increasing
the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the
application getting the error message.
20. Explain the difference between $ORACLE_HOME and $ORACLE_BASE.
ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is
where the oracle products reside.
Well, we have gone through the first 25 questions as would answer them during an interview. Please
feel free to add your personal experiences to the answers as it will always improve the process and add
your particular touch. As always remember these are "core" DBA questions and not necessarily related to
the Oracle options that you may encounter in some interviews. Take a close look at the requirements for
any job and try to come up with questions that the interviewer may ask. Next time we will tackle the rest of
the questions. Until then, good luck with the process.