Ora cle D BA Inte rview Q uestions Answ ers
By Gi t e s h T r i v e d i
Pub lish er : Ke nd b a Se rvice s
Cop y right pro te cte d @ Ken db a Service s
Oracle DBA Interview Question s Answer s
Copyright © 201 1 b y th e Kendb a Services. All right s reserved .
Fourth Reprint 2012
No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. The information contained herein is for the personal use of the reader and may not be incorporated in any commercial programs, other books, websites, databases, or any kind of software without written consent of the publisher. Making copies of this book or any portion for any purpose other than your own is a violation of copyright laws.
Lim its of Liability/ Disclaim er of W arrant y:
The autho r and publisher have used t heir best effo rts in pr eparing this book. Kendb a Services, and th e author m ake no representation of w arranties with respect to th e accuracy or com pleteness of t he content of th is boo k, and any particular pu rpose. There are no w arrant ies w hich extend beyond the descriptions contained in this paragraph. No warranty may be created or extended by sales representatives or written sales materials. The accuracy and completeness of the information proceed herein and the o pinions stated herein are not guaranteed or w arranted t o p roduce any particular results and the advice and strategies contained herein may not be suitable for every individual. Neither Kendba Services nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.
This book is dedicated to my dad, Prafulchandra Nanubhai Trivedi, my mother, Naliniben Prafulchandra Trivedi, my wife Kashmira Giteshkumar Trivedi, and my daughter Nirali Giteshkumar Trivedi. Without their constant and noble love, guidance, sacrifices and support, I would not have achieved the goal of completing this book.
About Author Gitesh P Tr ived i
Gitesh works as Project Manager/ Technical Lead at Dbametrix Solutions. He has more then 15 years of experience in the Information Technology industry. During his career, Gitesh has provided Database Administration services to clients around the globe including ones in India, UAE, Singapore, Malaysia, Australia, UK, USA, and Africa. Gitesh has been involved with Oracle right from Oracle7 to its latest version Oracle11g. Gitesh has also worked as a freelance DBA for several companies and as a corporate faculty in many reputed training institutes. He has extensive experience managing very large Oracle databases in banking and finance domains. Gitesh has helped several clients design and implement high availability and disaster management strategies.
Gitesh has Bachelor of Sciences degree from Gujarat University and is an Oracle certified professional for Oracle 11g, 10g, 9i, 8i, 8 and an Oracle RAC DBA for Oracle 11g,10g. He holds Brainbench certification for Oracle 10g, 9i, 8i and certification in Unix system administration. He has also provided Oracle recruitment services to various companies. Gitesh has been awarded best support provider and best team leader several times during his professional career. His team was awarded Best DBA team of the year in 2008.
Preface These days we are using computer systems for various tasks, cars for getting around, and cellular phone devices for communication. In the same way, this publication was not published instantaneously. The voyage of this book goes many years in the past with many individuals to be thanked for.
To start with, we want to thank all the hiring managers who decline interviewees by saying they need to know Oracle DBA fundamentals regardless of quality of their experience and high score in OCP exams. Employers typically offer jobs to those who possess a solid understanding of Oracle fundamentals. Many candidates are knowledgeable about Oracle but are not able to come up with the right answer during the interview. Interviewers have a tendency to ask trick questions or technical questions pertaining to a real time scenario. Without solid experience, it is difficult for the interviewee to understand the question and come up with the right answer. In this book, I have covered real scenario based questions and their answers for your preparation.
In this book, I have tried to cover as many tough, tricky and real time scenarios based questions as possible and have answered them based on my experiences as an Oracle DBA. I hope that this book will help you prepare for an Oracle DBA interview by providing and insight into the interviewer’s mind. The book is also intended to be a quick reference for Oracle DBAs. The book covers Oracle versions 11g / 10g / 9i / 8i. I hope it will boost your confidence, improve your knowledge and sharpen your skills. If you are an interviewer, this book should help you ask right questions to your potential employee.
I would appreciate any feedback from you about making this book and even more valuable resource for the Oracle DBA community.
[email protected] Wish you best of luck.
G itesh P T rivedi
Prere qu isite s of th is Book usage:
This book is intended to not only prepare you, but help you excel in an Oracle DBA interview. While the reader is not expected to possess detailed knowledge about Oracle internals, he is expected to have a decent understanding of Oracle architecture, advanced features and responsibilities of an Oracle DBA.
If you are an Oracle DBA, this book will not only serve as a quick reference but also help you enhance your skills. .
Backu p a nd Recov e ry
Explain th e difference betw een a hot b ackup and a cold backup and t he ben efit s associated w ith each.
A ho t b ackup is basically taking a backup of t he d atab ase w hile it is still up and runn ing and it m ust b e in archive log m ode. A cold backup is taking a backup o f th e database w hile it is shut dow n and d oes no t req uire being in archive log m od e. The ben efit o f taking a hot backup is t hat th e dat abase is still available for use w hile th e backup is occurring and you can recover t he database t o any ball in tim e. The b enefit of taking a cold b ackup is th at it is typically easier to adm inister th e backup and recovery p rocess. In add itio n, since you are t aking cold b ackup s th e database does no t req uire being in archive log mod e and thu s th ere w ill be a slight p erfo rm ance gain as th e database is no t cut tin g archive logs to disk.
You have just h ad to r estor e from backup and d o not have any cont rol files. How w ould you go about b ringing up t his database?
I w ould create a text b ased backup cont ro l file, stipu lating w here on disk all the data files w here and t hen issue th e recover com m and w ith t he using backup cont rol f ile clause.
Explain t he dif fer ence b et w een ARCHIVELOG m od e and NOARCHIVELOG m ode and th e benefit s and disadvantages to each.
ARCHIVELOG m ode is a m od e th at you can p ut th e dat abase in for creating a backup o f all tr ansaction s th at h ave occurred in t he dat abase so t hat you can recove r t o any b all in tim e. NOARCHIVELOG m od e is basically th e absence of ARCHIVELOG m ode an d h as th e d isadvant age of no t b eing able to recover t o any ball in t im e. NOARCHIVELOG m od e do es have th e advant age of no t having to w rite t ransaction s to an archive log and th us increases th e perfo rm ance of the database slightly.
W hat com m and w ould you use to create a backup control file?
Alter d atabase backup cont rol file to trace.
W hat is the pu rpo se of t he IM PORT op tio n IGNORE? W hat is its default setting?
The IM PORT IGNORE op tio n tells im po rt t o ignor e "alr eady exists" erro rs. If it is no t specified t he t ables th at already exist w ill be skipped . If it is specified, the error is ignored and the table’s data w ill be inserted. The d efault value is N.
You are using hot backup w itho ut being in archivelog m ode, can you recover in the event of a failure? W hy or w hy not?
W e are unable to take ho t backup in noarchive m ode. You can’t use hot backup w itho ut b eing in archivelog m ode. So no , you couldn’ t recover.
How m any redo logs shou ld you have and ho w shou ld th ey be configured for m axim um recoverability?
You should have at least t hree groups of tw o redo logs w ith t he tw o logs each on a separat e disk spind le (m irro red by Oracle). The red o logs sho uld n ot be o n raw devices on UN IX if it can b e avoided .
Users aren’t b eing allow ed on t he system . The fo llow ing m essage is received: ORA-00257 archiver is stu ck. Conn ect in ter nal on ly, unt il freed : W hat is the problem ?
The archive destin ation is pro bably full, take backup o f archivelogs and rem ove th em . archiver pro cess w ill re-start .
You get a call from you b ackup DBA w hile you are o n vacation. He h as corrup ted all of t he con tr ol files w hile playing w ith th e ALTER DATABASE BACKUP CONTROLFILE com m and . W hat do you do ?
CON N ECT sys as sysd ba STARTUP M OU NT
(Take any read -on ly t ablespaces of flin e b efo re next st ep ALTER DATABASE DA TAFILE .... OFFLINE;) RECOVER DATABASE USING BACKUP CONTROLFILE ALTER DATABASE OPEN RESETLOGS; (bring r ead-only t ablespaces back online) Shut dow n and b ackup t he system , th en restart If t hey have a r ecent ou t pu t file fr om t he ALTER DATABASE BACKUP CONTROL FILE TO TRACE; com m and , th ey can use th at t o r ecover as w ell. If no backup of th e contro l file is available then t he follow ing w ill be required: CON N ECT INTERNA L STARTUP N OM OUN T CREATE CON TROL FILE .....; How ever, they w ill need to know all of th e dat afiles, logfiles, and settings for M AXLOGFILES, M AXLOGM EM BERS, M AXLOGHISTORY, M AXDATAFILES fo r t h e database to use the com m and.
W hat are the steps involved in Database Start up?
Start an instance, M oun t the Database and Op en t he Database.
W hat are t he steps involved in Instance Recovery?
Rolling forw ard to recover data t hat h as no t b een recor ded in data files yet has been recorded in t he o n-line redo log, including th e con tent s of r ollback segm ent s. Rolling back tr ansactio ns th at have b een exp licitly r olled back or have not been com m itt ed as indicated b y the r ollback segment s regenerated in step a. Releasing any resources (locks) held b y tr ansactio ns in pr ocess at t he t im e of th e failure. Resolving any pendin g distr ibut ed t ransactions und ergoing a tw o-phase com m it at the t im e of the instance failure.
Can Full Backup b e perfo rm ed w hen t he dat abase is op en?
W hat are th e steps involved in Database Shut dow n?
No.
Close th e Database, Dism ou nt t he Database and Shu td ow n t he Instan ce.
W hat is Archived Redo Log?
Archived Redo Log consists of Redo Log files that have archived bef ore being reused.
W hat is Restricted M ode o f Instance Startu p?
An instance can be started in (or later altered to be in) restr icted m ode so that w hen t he database is open conn ections are lim ited on ly to th ose w hose user accou nt s hav e b een gran t ed t he RESTRICTED SESSION syst em pr ivilege
How to get Oracle D BA Interview Qu estions Book. Book Nam e: Oracle DBA Interview Question s Aut ho r: Gitesh Trivedi Edit ion: 4 t h Released d ate: M arch 19, 2012 Website: h t t p : / / w w w . k e n d b a . c o m Part ner Sit e: h t t p : / / w w w . d b a m e t r i x . c o m Book link: http://www.kendba.com/books/interview-questions-boo ks/