Oracle Interview Questions : The Interviewer’s Prespective "We're interviewing an Oracle guy tomorrow, can you give me a few questions to ask him?" Not an uncommon request. The prolem is, there are literally thousan!s of potential Oracle questions, ut it all !epen!s on what are you trying to achieve. o # pushe! ack$ "What kin! of Oracle%relate! skills woul! the can!i!ate nee! that you want to ask for?" "&ou tell us. We ust want to know if he knows Oracle. Whatever an Oracle guy woul! nee! to know." (retty soon thereafter # figure! out that it was a pointless conversation to continue, although # !i! love the way he summari)e! !o)ens of very !ifferent positions into that one term$ "Oracle *uy." Nevertheless, it got me thinking. What makes for a goo! technical question? # have con!ucte!, or een invite! to, several interviews, so it got me to thinking aout which questions were most effective at getting to the heart of the matter$ "Will this can!i!ate succee! technically in this role?" +lements of a *oo! Technical #nterview uestion. -. ust require knowle!ge of the area, inclu!ing !omain an! philosophy, to solve. # !on't think it's enough that a can!i!ate !emonstrates proficiency with the technology. # like to see if they un!erstan! the overall philosophy of the pro!uct /Oracle, in this case0$ What nee!s was it meant to provi!e, what kin! of prolems was it !esigne! to solve, how !oes it accomplish those tasks. 1. ust require overall technical skill2e3perience2un!erstan!ing to solve. # mean to say that a goo! question shows if the can!i!ate un!erstan!s /for e3ample0 relational !ataases themselves, not ust a particular relational !ataase. 4arrying this e3ample, !oes your 455 !eveloper un!erstan! algorithms an! software !esign? 6. 7oes not require knowle!ge of precise synta3 #n my min!, anyone can look something up in a manual. &ou !on't nee! to walk into an empty oar!room an! know e3actly how something is calle!. # !on't t hink knowle!ge of synta3 is a reliale in!icator of the suitaility of a can!i!ate. 8or e3ample, you coul! have a goo! can!i!ate "lank out" on the syntactic !etails, an! you coul! also have a a! can!i!ate who swallowe! a reference manual the night efore the interview. Now, # woul! e worrie! if the can!i!ate !i!n't know 9:#4 synta3. 9ut # !on't want to waste precious time asking asic questions, an! if he is truly is that ine3perience!, # shoul! e ale to figure it out in other ways. ;. 4an e answere! quickly. Time is precious in an interview, an! you shoul!n't nee! long, convolute! questions to !etermine whether or not a can!i!ate "gets it." : goo! question !emonstrates ! emonstrates quickly if the can!i!ate is on the right path, or woul!n't get it regar!less of how much time he ha!. <. #s not a "gotcha" #'ve met some interviewers that seem to use the opportunity not to evaluate the can!i!ate, ut to prove how clever they are /either to the can!i!ate or the manager0. They !o this y asking really oscure tricks, sometimes referre! to as "gotchas." The prolem with asking questions in the oscure corners is that even very e3perience! can!i!ates may not have worke! in that area an!, if they have, may not have stumle! across that particular gem. =ust rememer, the purpose of the interview isn't to make &O> look clever, an! asking silly questions might make a great can!i!ate think "what kin! of clown show am # getting myself into?" . @as many possile solutions an! approaches The most effective questions # have ever aske!, or een aske!, were the ones that triggere! lively technical !iscussions etween the interviewer an! the can!i!ate. Why? &ou get to catch a glimpse not only of the can!i!ates thinking process, ut also how he communicates. # also like the a!!e! enefit of not punishing /in fact, rewar!ing0 those that approach prolems !ifferently than the interviewer. Page 1 of 74
A. Bequires asking for more information /or make assumptions0. (ersonally, # elieve one of the keys to success in #T is to !efine a prolem efore approaching it. That's why # lean towar!s these types of questions. 7i! the can!i!ate come ack, or ust try to solve it? #f he came ack, what kin! of questions !i! he ask? #n the face of an incompletely%!efine! prolem, !i! he get stuck, or !i! he make some assumptions an! continue? #f so, what assumptions !i! he make? C. #s relevant to the usiness2o eing consi!ere! Woul! you hire a cleaning service with awar!%winning carpet cleaning if you ha! har!woo! floors? Woul! you hire a running ack who e3cels in a! weather if you playe! in a !ome? Woul! you hire an accomplishe! science%fiction writer to author your iography? No? Then why proe for technical skills that !on't !irectly apply to the position you're attempting to fill? 4losing Thoughts #nci!entally, in the en! # referre! the manager in question to a couple of links which have hun!re!s of Oracle%interview questions. &ou can pick your favourites ut, more likely, you can rea! them until you come up with goo! i!eas that suit your nee!s. http$22www.orafaq.com2forum2t2DAE212 http$22www.!ataaseournal.com2features2oracle2article.php26EC<-A :s an asi!e, that last article was written y one of my preferre! columnists, =ames Foopmann. @e hasn't written much recently, ut check out his archives, he's got some great articles there. 8or instance, check out his series on Oracle ession Tracing. Set 1
Oracle Technical #nterview uestions :nswere! G (a rt=ames Foopmann, koopmannHqwest.net
The interview process can e quite stressful. @ere is the first part of a two part series on helping you answer those tough questions that you might e3perience in your quest for an Oracle 79: position. +ver since # wrote the past article on the Oracle Technical #nterview, # have een omar!e! with e%mails asking for help on getting through the interview questions that # presente!. ost of you # have answere!, others # was reluctant to post all of the answers so that you coul! egin your own quest for the answers. Now, however, # have !eci!e! to post the answers knowing that we can all enefit from them. #f there are any questions here that you still nee! clarification on, please e%mail me an! # will !o my est to further e3plain the answer # have given. (lease rememer that as you go through the article, it is not enough to know the answer to a particular question, you must try an! put yourself in an interview situation an! e3perience answering the question for yourself. Therefore, after you have gone through the questions an! answers rea! the question yourself an! then answer it with your own wor!s. :s always, goo! luck, an! cheers. (ersonal This part of the interview question is not to e regar!e! as insignificant. #f the interviewer asks you these questions take it as a sign that they are intereste! in you, your qualities, an! how you interact with people throughout the !ay. Take it as an opportunity to prove that you have een aroun! the lock a few times, are willing to work with other people, an! enoy the o you !o. any times people see 79: types as stuffy stuff y an! pointe!, not willing to work with others, an! only concerne! with the !ataase an! its !ay%to%!ay operational nee!s. (ut asi!e the nee!s of the !ataase an! talk aout how you work with people an! the !ifferent !epartments in the organi)ation an! are concerne! with provi!ing them with top notch !ataase services. -.
What 79: activities !i! you to !o to!ay?
Wow, this is a loa!e! question an! almost egs for you to answer it with "What 79: activities !o you I#F+ to !o on a !aily asis?." :n! that is how # woul! answer this question. :gain, !o not get caught up in the "typical" !ay%to%!ay operational issues of !ataase a!ministration. ure, you can talk aout the in!e3 you reuilt, the monitoring of system an! session waits that were occurring, or the space you a!!e! to a !ata file, these are all goo! an! great an! you shoul! convey that you un!erstan! the !ay%to%!ay operational issues. What you shoul! also throw into this answer are the meetings that you atten! to provi!e !irection in the !ataase arena, the people that you meet an! talk with !aily to answer a!hoc questions aout !ataase use, the mo!eling of usiness nee!s within the !ataase, an! the e3tra time Page 2 of 74
A. Bequires asking for more information /or make assumptions0. (ersonally, # elieve one of the keys to success in #T is to !efine a prolem efore approaching it. That's why # lean towar!s these types of questions. 7i! the can!i!ate come ack, or ust try to solve it? #f he came ack, what kin! of questions !i! he ask? #n the face of an incompletely%!efine! prolem, !i! he get stuck, or !i! he make some assumptions an! continue? #f so, what assumptions !i! he make? C. #s relevant to the usiness2o eing consi!ere! Woul! you hire a cleaning service with awar!%winning carpet cleaning if you ha! har!woo! floors? Woul! you hire a running ack who e3cels in a! weather if you playe! in a !ome? Woul! you hire an accomplishe! science%fiction writer to author your iography? No? Then why proe for technical skills that !on't !irectly apply to the position you're attempting to fill? 4losing Thoughts #nci!entally, in the en! # referre! the manager in question to a couple of links which have hun!re!s of Oracle%interview questions. &ou can pick your favourites ut, more likely, you can rea! them until you come up with goo! i!eas that suit your nee!s. http$22www.orafaq.com2forum2t2DAE212 http$22www.!ataaseournal.com2features2oracle2article.php26EC<-A :s an asi!e, that last article was written y one of my preferre! columnists, =ames Foopmann. @e hasn't written much recently, ut check out his archives, he's got some great articles there. 8or instance, check out his series on Oracle ession Tracing. Set 1
Oracle Technical #nterview uestions :nswere! G (a rt=ames Foopmann, koopmannHqwest.net
The interview process can e quite stressful. @ere is the first part of a two part series on helping you answer those tough questions that you might e3perience in your quest for an Oracle 79: position. +ver since # wrote the past article on the Oracle Technical #nterview, # have een omar!e! with e%mails asking for help on getting through the interview questions that # presente!. ost of you # have answere!, others # was reluctant to post all of the answers so that you coul! egin your own quest for the answers. Now, however, # have !eci!e! to post the answers knowing that we can all enefit from them. #f there are any questions here that you still nee! clarification on, please e%mail me an! # will !o my est to further e3plain the answer # have given. (lease rememer that as you go through the article, it is not enough to know the answer to a particular question, you must try an! put yourself in an interview situation an! e3perience answering the question for yourself. Therefore, after you have gone through the questions an! answers rea! the question yourself an! then answer it with your own wor!s. :s always, goo! luck, an! cheers. (ersonal This part of the interview question is not to e regar!e! as insignificant. #f the interviewer asks you these questions take it as a sign that they are intereste! in you, your qualities, an! how you interact with people throughout the !ay. Take it as an opportunity to prove that you have een aroun! the lock a few times, are willing to work with other people, an! enoy the o you !o. any times people see 79: types as stuffy stuff y an! pointe!, not willing to work with others, an! only concerne! with the !ataase an! its !ay%to%!ay operational nee!s. (ut asi!e the nee!s of the !ataase an! talk aout how you work with people an! the !ifferent !epartments in the organi)ation an! are concerne! with provi!ing them with top notch !ataase services. -.
What 79: activities !i! you to !o to!ay?
Wow, this is a loa!e! question an! almost egs for you to answer it with "What 79: activities !o you I#F+ to !o on a !aily asis?." :n! that is how # woul! answer this question. :gain, !o not get caught up in the "typical" !ay%to%!ay operational issues of !ataase a!ministration. ure, you can talk aout the in!e3 you reuilt, the monitoring of system an! session waits that were occurring, or the space you a!!e! to a !ata file, these are all goo! an! great an! you shoul! convey that you un!erstan! the !ay%to%!ay operational issues. What you shoul! also throw into this answer are the meetings that you atten! to provi!e !irection in the !ataase arena, the people that you meet an! talk with !aily to answer a!hoc questions aout !ataase use, the mo!eling of usiness nee!s within the !ataase, an! the e3tra time Page 2 of 74
you spen! early in the morning or late at night to get the o !one. =ust ecause the question stipulates "to!ay" !o not take "to!ay" to mean "to!ay." ake sure you wrap up a few goo! !ays into "to!ay" an! talk aout them. This question also egs you to ask the question of "What typical 79: activities are performe! !ay to !ay within J 4orporation?" 1.
What is your typical !ay like?
#f you spen! enough time on question -, this question will never e aske!. #t is really a continuation of question - to try an! get you to open up an! talk aout the type of things you like to !o. (ersonally, # woul! continue with the theme of question - if you are cut short or this question is aske! later in the interview process. =ust note that this question is not all geare! towar! the !ay%to%!ay operational issues you e3perience as a 79:. This question also gives you the opportunity to see if they want to know aout you as an in!ivi!ual. ince the question !i! not stipulate "on the o" # woul! throw in a few items like, # get up at <$EEam to get into work an! get some quiet time to rea! up on new tren!s or you help coach your son2!aughter's soccer team. =ust test the waters to what is acceptale. #f the interviewer starts to pull you ack to "o" relate! issues, !o not go to personal. :lso, if you go to the office of the interviewer please notice the surroun!ings, if there are pictures of his2her family, it is proaly a goo! i!ea to venture !own the personal path. #f there is a fly%fishing picture on the wall, !o not say you like !eep%sea fishing. &ou get the picture. 6.
What other parts of your organi)ation !o you interact with an! how?
:gain, if you have e3hauste! question - an! 1 you may never get to this question. 9ut if you have een apprehensive to opening up an! e3plaining yourself, take note that you may have an issue an! the interviewer might also e alrea!y getting tire! of the interview process. #f you get to this question consi!er yourself in troule. &ou really nee! to forget all your hang%ups an! start e3plaining what it is that you like to !o as a 79:, an! why you want to work for this particular company. &ou are going to have to reel this interviewer ack into the interview process or you might not get to the true technical question part of the interview. ;.
7o you consi!er consi!er yourself yourself a !evelopment 79: or a pro!uction pro!uction 79: 79: an! why?
# take this as a trick question an! e3plain it that way. Never in my !ataase carrier have # !istinguishe! etween "!evelopment" an! "pro!uction." =ust ask your !evelopment staff or K( of engineering how much time an! money is lost if !evelopment systems are !own. +3plain to the interviewer that oth systems are equally important to the operation of the company an! oth shoul! e consi!ere! as pro!uction systems ecause there are people relying on them an! money is lost if either one of them is !own. Ok you may e saying, an! # know you are, that we lose more money if the pro!uction system is !own. Ok, convey that tha t to the interviewer an! you won't get anyone to !isagree with you unless your company sells software or there are million !ollar !eals on the tale that are e3pecting the ne3t release of your pro!uct or service. <.
:re you a nuts%n%olts 79: or a tools%n%props 79:
This question egs for me to give !efinition aroun! the terms # asically group 79:s into. These are not goo! or a! groups ut something # like to think aout when talking to 79:s. : nuts%n%olts n uts%n%olts 79: is the type that likes to figure out every little item aout how the !ataase works. @e2she is a 79: who typically h ates a *># environment an! prefers prefe rs the comman! line to e3ecute comman!s an! accomplish tasks. : nuts%n%olts 79: like to feel in control of the !ataase an! only feels comfortale at the comman! line an! vi as an e!itor. The tools%n%props 79: is mostly the opposite of a nuts%n%olts 79:, they like the feel of a *>#, the ease at which things th ings can e accomplishe! without knowing much aout the !ataase. They want to get the o !one with the least amount of intervention from having to figure out what everything is !oing ehin! the scenes. Now the answer, # woul! e3plain m yself as a comination of the two. t wo. #, having een in this usiness for over 1E years, have grown up in a comman! line era where the *>#s never seeme! to work. There was high comple3ity in systems an! not much goo! !ocumentation on how things worke!. Thus, # ha! to learn everything aout most aspects of the !ataase environment # was working in an! thus ecame a nuts%n%olts 79:. # was a true comman! line an! vi igot. Times have change! an! the *>#s are very reliale, un!erstan! the environment they are installe! on, an! can generally get the o !one quicker for in!ivi!uals new to !ataase a!ministration. # too am slowly slipping over to the !ark si!e of *># a!ministration. #f you fin! f in! yourself as a tools%n%props 79:, try to convey that you are aware of some tasks that require you to e a nuts%n%olts 79:. Technical G Oracle This is the part you h ave all een waiting on. (lease if you have ust skippe! to this section, go ack to the personal section an! rea! it. There is much to e gaine! y the personal section an! conveying to your interviewer who you are an! how you tick from !ay to !ay. :lso, the answers # am giving here are off the cuff an! are not inten!e! to e the !efinitive answer to these questions. There are many aspects to these questions that ust cannot e answere! here an! honestly, you will not have time to t o e3plain any of these questions fully in the interview process. #t is up to you to make sure your interviewer un!erstan!s that you un!erstan! the question an! have given enough information that they know you un!erstan! the concept. -.
+3plain the !ifference etween a hot ackup ackup an! a col! ackup an! the enefits associate! with each. Page 3 of 74
: hot ackup is asically taking a ackup of the !ataase while it is still up an! running an! it must e in archive log mo!e. : col! ackup is taking a ackup of the !ataase while it is shut !own an! !oes not require eing in archive log mo!e. The enefit of taking a hot ackup is that the !ataase is still availale for use while the ackup is occurring an! you can recover the !ataase to any point in time. The enefit of taking a col! ackup is that it is typically easier to a!minister the ackup an! recovery process. #n a!!ition, since you are taking col! ackups the !ataase !oes not require eing in archive log mo!e an! thus there will e a slight performance gain as the !ataase is not cutting archive logs to !isk. 1. &ou have ust ha! to restore from ackup an! !o not have any control files. @ow woul! you go aout ringing up this !ataase? # woul! create a te3t ase! ackup control file, stipulating where on !isk all the !ata files where an! then issue the recover comman! with the using ackup control file clause. 6.
@ow !o you switch from an init.ora file to a spfile?
#ssue the create spfile from pfile comman!. ;.
+3plain the !ifference etween a !ata lock, an e3tent an! a segment.
: !ata lock is the smallest unit of logical storage for a !ataase oect. :s oects grow they take chunks of a!!itional storage that are compose! of contiguous !ata locks. These groupings of contiguous !ata locks are calle! e3tents. :ll the e3tents that an oect takes when groupe! together are consi!ere! the segment of the !ataase oect. <.
*ive two e3amples of how you might !etermine the structure of the tale 7+(T.
>se the !escrie comman! or use the !msLmeta!ata.getL!!l package. .
Where woul! you look for errors from the !ataase engine?
#n the alert log. A.
4ompare an! contrast TB>N4:T+ an! 7+I+T+ for a tale.
9oth the truncate an! !elete comman! have the !esire! outcome of getting ri! of all the rows in a tale. The !ifference etween the two is that the truncate comman! is a 77I operation an! ust moves the high water mark an! pro!uces a now rollack. The !elete comman!, on the other han!, is a 7I operation, which will pro!uce a rollack an! thus take longer to complete. C.
*ive the reasoning ehin! using an in!e3.
8aster access to !ata locks in a tale. D.
*ive the two types of tales involve! in pro!ucing a star schema an! the type of !ata they hol!.
8act tales an! !imension tales. : fact tale contains measurements while !imen sion tales will contain !ata that will help !escrie the fact tales. -E. . What type of in!e3 shoul! you use on a fact tale? : 9itmap in!e3. --. *ive two e3amples of referential integrity constraints. : primary key an! a foreign key. -1. : tale is classifie! as a parent tale an! you want to !rop an! re%create it. @ow woul! you !o this without affecting the chil!ren tales? 7isale the foreign key constraint to the parent, !rop the tale, re%create the tale, enale the foreign key constraint. -6. +3plain the !ifference etween :B4@#K+IO* mo!e an! NO:B4@#K+IO* mo!e an! the enefits an! !isa!vantages to each. :B4@#K+IO* mo!e is a mo!e that you can put the !ataase in for creating a ackup of all transactions that have occurre! in the !ataase so that you can recover to any point in time. NO:B4@#K+IO* mo!e is asically the asence Page 4 of 74
of :B4@#K+IO* mo!e an! has the !isa!vantage of not eing ale to recover to any point in time. NO:B4@#K+IO* mo!e !oes have the a!vantage of not having to write transactions to an archive log an! thus increases the performance of the !ataase slightly. -;. What comman! woul! you use to create a ackup control file? :lter !ataase ackup control file to trace. -<. *ive the stages of instance startup to a usale state where normal users may access it. T:BT>( NOO>NT % #nstance startup T:BT>( O>NT % The !ataase is mounte! T:BT>( O(+N % The !ataase is opene! -. What column !ifferentiates the KM views to the *KM views an! how? The #NTL#7 column which in!icates the instance in a B:4 environment the information came from. -A. @ow woul! you go aout generating an +J(I:#N plan? 4reate a plan tale with utl3plan.sql. >se the e3plain plan set statementLi! 'tst-' into planLtale for a I statement Iook at the e3plain plan with utl3plp.sql or utl3pls.sql -C. @ow woul! you go aout increasing the uffer cache hit ratio? >se the uffer cache a!visory over a given workloa! an! then query the vM!LcacheLa!vice tale. #f a change was necessary then # woul! use the alter system set !LcacheLsi)e comman!. -D. +3plain an OB:%E-<<< &ou get this error when you get a snapshot too ol! within rollack. #t can usually e solve! y increasing the un!o retention or increasing the si)e of rollacks. &ou shoul! also look at the logic involve! in the application getting the error message. 1E. +3plain the !ifference etween MOB:4I+L@O+ an! MOB:4I+L9:+. OB:4I+L9:+ is the root !irectory for oracle. OB:4I+L@O+ locate! eneath OB:4I+L9:+ is where the oracle pro!ucts resi!e. 7ecemer -1, 1EE6 Oracle Technical #nterview uestions :nswere! % (art1 9y =ames Foopmann
This is the secon! part of the two part series on helping you answer those tough questions that you might e3perience in your quest for an Oracle 79: position. The Oracle Technical #nterview can e quite !aunting. &ou never quite know what to stu!y for an! how to prepare. # am fully aware of this, as # have receive! many emails since my original article on interview questions was release!. While these questions are only gui!elines as to what shoul! an! more than likely will e aske!, # hope that you fin! some comfort in the review of them. :s always, !o not ust memori)e the answers, as there are ewels to e foun! in the quest of figuring out the answer from the question. :s always, rememer that as you go through the article, it is not enough to know the answer to a particular question you must try to put yourself in an interview situation an! e3perience answering the question for yourself. Therefore, after you have gone through the questions an! answers rea! the question again an! then answer it with your own wor!s. :s always, goo! luck, an! cheers. Technical % Oracle Iast time, we answere! questions - thru 1E of the technical part of the interview. @ere are the ne3t 6E in this section. 7epen!ing on the moo! of the interview an! your aility to elaorate on the answer, try to give some insight that you Page 5 of 74
know more than ust the simple answer to some of these questions. :lso, e sensitive to the interviewer getting tire! of you talking too much. Well here they are. 1-. @ow woul! you !etermine the time )one un!er which a !ataase was operating? select 79T#+PON+ from !ual 11. +3plain the use of setting *IO9:ILN:+ equal to TB>+. etting *IO9:ILN:+ !ictates how you might connect to a ! ataase. This variale is either TB>+ or 8:I+ an! if it is set to TB>+ it enforces !ataase links to have the same name as the remote !ataase to which they are linking. 16. What comman! woul! you use to encrypt a (I2I application? WB:( 1;. +3plain the !ifference etween a 8>N4T#ON, (BO4+7>B+ an! (:4F:*+. : function an! proce!ure are the same in that they are inten!e! to e a collection of (I2I co!e that carries a single task. While a proce!ure !oes not have to return any values to the calling application, a function will return a single value. : package on the other han! is a collection of functions an! proce!ures that are groupe! together ase! on their commonality to a usiness function or application. 1<. +3plain the use of tale functions. Tale functions are !esigne! to return a set of rows through (I2I logic ut are inten!e! to e use! as a normal tale or view in a I statement. They are also use! to pipeline information in an +TI process. 1. Name three a!visory statistics you can collect. 9uffer 4ache :!vice, egment Ievel tatistics, Q Time! tatistics 1A. Where in the Oracle !irectory tree structure are au!it traces place!? #n uni3 MOB:4I+L@O+2r!ms2au!it, in Win!ows the event viewer 1C. +3plain materiali)e! views an! how they are use!. ateriali)e! views are oects that are re!uce! sets of information that have een summari)e!, groupe!, or aggregate! from ase tales. They are typically use! in !ata warehouse or !ecision support systems. 1D. When a user process fails, what ackgroun! process cleans up after it? (ON 6E. What ackgroun! process refreshes materiali)e! views? The =o ueue (rocesses. 6-. @ow woul! you !etermine what sessions are connecte! an! what resources they are waiting for? >se of KM+#ON an! KM+#ONLW:#T 61. 7escrie what re!o logs are. Be!o logs are logical an! physical structures that are !esigne! to hol! all the changes ma!e to a !ataase an! are inten!e! to ai! in the recovery of a !ataase. 66. @ow woul! you force a log switch? :IT+B &T+ W#T4@ IO*8#I+ 6;. *ive two metho!s you coul! use to !etermine what 77I changes have een ma!e. &ou coul! use Iogminer or treams 6<. What !oes coalescing a talespace !o? Page 6 of 74
4oalescing is only vali! for !ictionary%manage! talespaces an! !e%fragments space y comining neighoring free e3tents into large single e3tents. 6. What is the !ifference etween a T+(OB:B& talespace an! a (+B:N+NT talespace? : temporary talespace is use! for temporary oects such as sort structures while permanent talespaces are use! to store those oects meant to e use! as the true oects of the !ataase. 6A. Name a talespace automatically create! when you create a !ataase. The &T+ talespace. 6C. When creating a user, what permissions must you grant to allow them to connect to the !ataase? *rant the 4ONN+4T to the user. 6D. @ow !o you a!! a !ata file to a talespace? :IT+B T:9I+(:4+ RtalespaceLnameS :77 7:T:8#I+ R!atafileLnameS #P+ Rsi)eS ;E. @ow !o you resi)e a !ata file? :IT+B 7:T:9:+ 7:T:8#I+ R!atafileLnameS B+#P+ RnewLsi)eS ;-. What view woul! you use to look at the si)e of a !ata file? 79:L7:T:L8#I+ ;1. What view woul! you use to !etermine free space in a talespace? 79:L8B++L(:4+ ;6. @ow woul! you !etermine who has a!!e! a row to a tale? Turn on fine grain au!iting for the tale. ;;. @ow can you reuil! an in!e3? :IT+B #N7+J Rin!e3LnameS B+9>#I7 ;<. +3plain what partitioning is an! what its enefit is. (artitioning is a metho! of taking large tales an! in!e3es an! splitting them into smaller, more manageale pieces. ;. &ou have ust compile! a (I2I package ut got errors, how woul! you view the errors? @OW +BBOB ;A. @ow can you gather statistics on a tale? The :N:I&P+ comman!. ;C. @ow can you enale a trace for a session? >se the 79L+#ON.+TLILTB:4+ or >se :IT+B +#ON +T ILTB:4+ TB>+ ;D. What is the !ifference etween the IIoa!er an! #(OBT utilities? These two Oracle utilities are use! for loa!ing !ata into the !ataase. The !ifference is that the import utility relies on the !ata eing pro!uce! y another Oracle utility +J(OBT while the IIoa!er utility allows !ata to e loa!e! that has een pro!uce! y other utilities from !ifferent !ata sources ust so long as it conforms to :4## formatte! or !elimite! files.
N#J +very 79: shoul! know something aout the operating system that the !ataase will e running on. The questions here are relate! to >N#J ut you shoul! equally e ale to answer questions relate! to common Win!ows environments. Page 7 of 74
-. @ow !o you list the files in an >N#J !irectory while also showing hi!!en files? ls %ltra 1. @ow !o you e3ecute a >N#J comman! in the ackgroun!? >se the "Q" 6. What >N#J comman! will control the !efault file permissions when files are create!? >mask ;. +3plain the rea!, write, an! e3ecute permissions on a >N#J !irectory. Bea! allows you to see an! list the !irectory contents. Write allows you to create, e!it an! !elete files an! su!irectories in the !irectory. +3ecute gives you the previous rea!2write permissions plus allows you to change into the !irectory an! e3ecute programs or shells from the !irectory. <. the !ifference etween a soft link an! a har! link? : symolic /soft0 linke! file an! the targete! file can e locate! on the same or !ifferent file system while for a har! link they must e locate! on the same file system. . *ive the comman! to !isplay space usage on the >N#J file system. !f %lk A. +3plain iostat, vmstat an! netstat. #ostat reports on terminal, !isk an! tape #2O activity. Kmstat reports on virtual memory statistics for processes, !isk, tape an! 4(> activity. Netstat reports on the contents of network !ata structures. C. @ow woul! you change all occurrences of a value using K#? >se $Us2Rol!S2RnewS2g D. *ive two >N#J kernel parameters that effect an Oracle install @:J Q @N# -E. 9riefly, how !o you install Oracle software on >N#J. 9asically, set up !isks, kernel parameters, an! run orainst. # hope that these interview questions were not too har!. Bememer these are "core" 79: questions an! not necessarily relate! to the Oracle options that you may encounter in some interviews. Take a close look at the requirements for any o an! try to e3tract questions that interviewers may ask from manuals an! real life e3periences. 8or instance, if they are looking for a 79: to run their !ataases in B:4 environments, you shoul! try to !etermine what har!ware an! software they are using 9+8OB+ you get to the interview. This woul! allow you to rush up on particular environments an! not e caught off%guar!. *oo! luckV Set 1
#nterview uestions for Oracle, 79:, 7eveloper 4an!i!ates (I2I uestions$ -. 7escrie the !ifference etween a proce!ure, function an! anonymous pl2sql lock. Ievel$ Iow
Page 8 of 74
+3pecte! answer $ 4an!i!ate shoul! mention use of 7+4I:B+ statement, a function must return a value while a proce!ure !oesn?t have to. 1. What is a mutating tale error an! how can you get aroun! it? Ievel$ #nterme!iate +3pecte! answer$ This happens with triggers. #t occurs ecause the trigger is trying to up!ate a row it is currently using. The usual fi3 involves either use of views or temporary tales so the !ataase is selecting from one while up!ating the other. 6. 7escrie the use of UBOWT&(+ an! UT&(+ in (I2I Ievel$ Iow +3pecte! answer$ UBOWT&(+ allows you to associate a variale with an entire tale row. The UT&(+ associates a variale with a single column type. ;. What packages /if any0 has Oracle provi!e! for use y !evelopers? Ievel$ #nterme!iate to high +3pecte! answer$ Oracle provi!es the 79L series of packages. There are many which !evelopers shoul! e aware of such as 79LI, 79L(#(+, 79LTB:N:4T#ON, 79LIO4F, 79L:I+BT, 79LO>T(>T, 79L=O9, 79L>T#I#T&, 79L77I, >TIL8#I+. #f they can mention a fe w of these an! !escrie how they use! them, even etter. #f they inclu!e the I routines provi!e! y Oracle, great, ut not really what was aske!. <. 7escrie the use of (I2I tales Ievel$ #nterme!iate +3pecte! answer$ (I2I tales are scalar arrays that can e reference! y a inary integer. They can e use! to hol! values for use in later queries or calculations. #n Oracle C they will e ale to e of the UBOWT&(+ !esignation, or B+4OB7. . When is a !eclare statement nee!e! ? Ievel$ Iow The 7+4I:B+ statement is use! in (I2I anonymous locks such as with stan! alone, non%store! (I2I proce!ures. #t must come first in a (I2I stan! alone file if it is use!. A. #n what or!er shoul! a open2fetch2loop set of comman!s in a (I2I lock e implemente! if you use the UNOT8O>N7 cursor variale in the e3it when statement? Why? Ievel$ #nterme!iate +3pecte! answer$ O(+N then 8+T4@ then IOO( followe! y the e3it when. #f not specifie! in this or!er will result in the final return eing !one twice ecause of the way the UNOT8O>N7 is han!le! y (I2I. C. What are I4O7+ an! I+BB an! why are they important for (I2I !evelopers? Ievel$ #nterme!iate +3pecte! answer$ I4O7+ returns the value of the error numer for the last error encountere!. The I+BB returns the actual error message for the last error encountere!. They can e use! in e3ception han!ling to report, or, store in an error log tale, the error that occurre! in the co!e. These are especially useful for the W@+N OT@+B e3ception. D. @ow can you fin! within a (I2I lock, if a cursor is open? Ievel$ Iow +3pecte! answer$ >se the U#O(+N cursor status variale. -E. @ow can you generate !eugging output from (I2I? Ievel$#nterme!iate to high +3pecte! answer$ >se the 79LO>T(>T package. :nother possile metho! is to ust use the @OW +BBOB comman!, ut this only shows errors. The 79LO>T(>T package can e use! to show interme!iate results from loops an! the status of variales as the proce!ure is e3ecute!. The new package >TIL8#I+ can also e use!. --. What are the types of triggers? Ievel$#nterme!iate to high Page 9 of 74
+3pecte! :nswer$ There are -1 types of triggers in (I2I that consist of cominations of the 9+8OB+, :8T+B, BOW, T:9I+, #N+BT, >(7:T+, 7+I+T+ an! :II key wor!s$ 9+8OB+ :II BOW #N+BT :8T+B :II BOW #N+BT 9+8OB+ #N+BT :8T+B #N+BT etc. 79:$ -. *ive one metho! for transferring a tale from one schema to another$ Ievel$#nterme!iate +3pecte! :nswer$ There are several possile metho!s, e3port%import, 4B+:T+ T:9I+... : +I+4T, or 4O(&. 1. What is the purpose of the #(OBT option #*NOB+? What is it?s !ef ault setting? Ievel$ Iow +3pecte! :nswer$ The #(OBT #*NOB+ option tells import to ignore "alrea!y e3ists" errors. #f it is not specifie! the tales that alrea!y e3ist will e skippe!. #f it is specifie!, the error is ignore! an! the tales !ata will e inserte!. The !efault value is N. 6. &ou have a rollack segment in a version A.1 !ataase that has e3pan!e! eyon! optimal, how can it e restore! to optimal? Ievel$ Iow +3pecte! answer$ >se the :IT+B T:9I+(:4+ ..... @B#NF comman!. ;. #f the 7+8:>IT an! T+(OB:B& talespace clauses are left out of a 4B+:T+ >+B comman! what happen s? #s this a! or goo!? Why? Ievel$ Iow +3pecte! answer$ The user is assigne! the &T+ talespace as a !efault an! temporary talespace. This is a! ecause it causes user oects an! temporary segments to e place! into the &T+ talespace resulting in fragmentation an! improper tale placement /only !ata !ictionary oects an! the system rollack segment shoul! e in &T+0. <. What are some of the Oracle provi!e! packages that 79:s shoul! e aware of? Ievel$ #nterme!iate to @igh +3pecte! answer$ Oracle provi!es a numer of packages in the form of the 79L packages owne! y the & user. The packages use! y 79:s may inclu!e$ 79L@:B+7L(OOI, 79L>T#I#T&, 79LI, 79L77I, 79L+#ON, 79LO>T(>T an! 79LN:(@OT. They may also try to answer with the >TI.I or 4:T.I series of I proce!ures. These can e viewe! as e3tra cre!it ut aren?t part of the answer. . What happens if the constraint name is left out of a constraint clause? Ievel$ Iow +3pecte! answer$ The Oracle system will use the !efault name of &L43333 where 3333 is a system generate! numer. This is a! since it makes tracking which tale the constraint elongs to or what the constraint !oes har!er. A. What happens if a talespace clause is left off of a primary key constraint clause? Ievel$ Iow +3pecte! answer$ This results in the in!e3 that is automatically generate! eing place! in then users !efault talespace. ince this will usually e the same talespace as the tale is eing create! in, this can cause serious performance prolems. C. What is the proper metho! for !isaling an! re%enaling a primary key constraint? Ievel$ #nterme!iate +3pecte! answer$ &ou use the :IT+B T:9I+ comman! f or oth. @owever, for the enale clause you must specify the >#N* #N7+J an! T:9I+(:4+ clause for primary keys. D. What happens if a primary key constraint is !isale! an! then enale! without fully specifying the in!e3 clause? Ievel$ #nterme!iate Page 10 of 74
+3pecte! answer$ The in!e3 is create! in the user?s !efault talespace an! all si)ing information is lost. Oracle !oesn?t store this information as a part of the constraint !efinition, ut only as part of the in!e3 !efinition, when the constraint was !isale! the in!e3 was !roppe! an! the information is gone. -E. /On >N#J0 When shoul! more than one 79 writer process e use!? @ow many shoul! e use!? Ievel$ @igh +3pecte! answer$ #f the >N#J system eing use! is capale of asynchronous #O then only one is require!, if the system is not capale of asynchronous #O then up to twice the numer of !isks use! y Oracle numer of 79 writers shoul! e specifie! y use of the !Lwriters initiali)ation parameter. --. &ou are using hot ackup without eing in archivelog mo!e, can you recover in the event of a failure? Why or why not? Ievel$ @igh +3pecte! answer$ &ou can?t use hot ackup without eing in archivelog mo!e. o no, you coul!n?t recover. -1. What causes the "snapshot too ol!" error? @ow can this e prevente! or mitigate!? Ievel$ #nterme!iate +3pecte! answer$ This is cause! y large or long running transactions that have either wrappe! onto their own rollack space or have ha! another transaction write on part of their rollack space. This can e prevente! or mitigate! y reaking the transaction into a set of smaller transactions or increasing the si)e of the rollack segments an! their e3tents. -6. @ow can you tell if a !ataase oect is invali!? Ievel$ Iow +3pecte! answer$ 9y checking the status column of the 79:L, :IIL or >+BLO9=+4T views, !epen!ing upon whether you own or only have permission on the view or are using a 79: account. -;. : user is getting an OB:%EED;1 error yet you know you have grante! them permission on the tale, what else shoul! you check? Ievel$ Iow +3pecte! answer$ &ou nee! to check that the user has specifie! the full name of the oect /select empi! from scott.emp instea! of select empi! from emp0 or has a synonym that points to the oect /create synonym emp for scott.emp0 -<. : !eveloper is trying to create a view an! the !ataase won?t let him. @e has the "7+K+IO(+B" role which has the "4B+:T+ K#+W" system privilege an! +I+4T grants on the tales he is using, what is the prolem? Ievel$ #nterme!iate +3pecte! answer$ &ou nee! to verify the !eveloper has !irect grants on all tales use! in the view. &ou can?t create a store! oect with grants given through views. -. #f you have an e3ample tale, what is the est way to get si)ing !ata for the pro!uction tale implementation? Ievel$ #nterme!iate +3pecte! answer$ The est way is to analy)e the tale an! then use the !ata provi!e! in the 79:LT:9I+ view to get the average row length an! other pertinent !ata for the calculation. The quick an! !irty way is to look at the numer of locks the tale is actually using an! ratio the numer of rows in the tale to its numer of locks against the numer of e3pecte! rows. -A. @ow can you fin! out how many users are currently logge! into the !ataase? @ow can you fin! their operating system i!? Ievel$ high +3pecte! answer$ There are several ways. One is to look at the vMsession or vMprocess views. :nother way is to check the currentLlogins parameter in the vMsysstat view. :nother if you are on >N#J is to !o a "ps %efgrep oraclewc %l? comman!, ut this only works against a single instance installation. -C. : user selects from a sequence an! gets ack two values, his select is$ +I+4T pkLseq.ne3tval 8BO !ual Page 11 of 74
What is the prolem? Ievel$ #nterme!iate +3pecte! answer$ omehow two values have een inserte! into the !ual tale. This tale is a single row, single column tale that shoul! only have one value in it. -D. @ow can you !etermine if an in!e3 nee!s to e !roppe! an! reuilt? Ievel$ #nterme!iate +3pecte! answer$ Bun the :N:I&P+ #N7+J comman! on the in!e3 to vali!ate its structure an! then calculate the ratio of I8L9IFLI+N2I8L9IFLI+N59BL9IFLI+N an! if it isn?t near -.E /i.e. greater than E.A or so0 then the in!e3 shoul! e reuilt. Or if the ratio 9BL9IFLI+N2 I8L9IFLI+N59BL9IFLI+N is nearing E.6. I2 I(lus -. @ow can variales e passe! to a I routine? Ievel$ Iow +3pecte! answer$ 9y use of the Q symol. 8or passing in variales the numers -%C can e use! /Q-, Q1,...,QC0 to pass the values after the comman! into the I(I> session. To e prompte! for a specific variale, place the ampersan!e! variale in the co!e itself$ "select from !aLtales where ownerQownerLname" . >se of !oule ampersan!s tells I(I> to resustitute the value for each susequent use of the variale, a single ampersan! will cause a reprompt for the value unless an :44+(T statement is use! to get the value from the user. 1. &ou want to inclu!e a carriage return2linefee! in your output from a I script, how can you !o this? Ievel$ #nterme!iate to high +3pecte! answer$ The est metho! is to use the 4@B/0 function /4@B/-E0 is a return2linefee!0 an! the concatenation function "". :nother metho!, although it is har! to !ocument an! isn?t always portale is to use the return2linefee! as a part of a quote! string. 6. @ow can you call a (I2I proce!ure from I? Ievel$ #nterme!iate +3pecte! answer$ 9y use of the +J+4>T+ /short form +J+40 comman!. ;. @ow !o you e3ecute a host operating system comman! from within I? Ievel$ Iow +3pecte! answer$ 9y use of the e3clamation point "V" /in >N#J an! some other O0 or the @OT /@O0 comman!. <. &ou want to use I to uil! I, what is this calle! an! give an e3ample Ievel$ #nterme!iate to high +3pecte! answer$ This is calle! !ynamic I. :n e3ample woul! e$ set lines DE pages E termout off fee!ack off verify off spool !ropLall.sql select ?!rop user ?username? casca!e? from !aLusers where username not in /"&?,?&T+?0 spool off +ssentially you are looking to see that they know to inclu!e a comman! /in this case 7BO( >+B...4:4:7+0 an! that you nee! to concatenate using the ?? the values selecte! from the !ataase. . What I(lus comman! is use! to format output from a select? Ievel$ low +3pecte! answer$ This is est !one with the 4OI>N comman!. A. &ou want to group the following set of select returns, what can you group on? a3/sumLofLcost0, min/sumLofLcost0, count/itemLno0, itemLno Ievel$ #nterme!iate Page 12 of 74
+3pecte! answer$ The only column that can e groupe! on is the "itemLno" column, the rest have aggregate functions associate! with them. C. What special Oracle feature allows you to specify how the cost ase! system treats a I statement? Ievel$ #nterme!iate to high +3pecte! answer$ The 4OT ase! system allows the use of @#NTs to control the optimi)er path selection. #f they can give some e3ample hints such as 8#BT BOW, :II BOW, >#N* #N7+J, T:B, even etter. D. &ou want to !etermine the location of i!entical rows in a tale efore attempting to place a unique in!e3 on the tale, how can this e !one? Ievel$ @igh +3pecte! answer$ Oracle tales always have one guarantee! unique column, the rowi! column. #f you use a min2ma3 function against your rowi! an! then select against the propose! primary key you can squee)e out the rowi!s of the !uplicate rows pretty quick. 8or e3ample$ select rowi! from emp e where e.rowi! S /select min/3.rowi!0 from emp 3 where 3.empLno e.empLno0 #n the situation where multiple columns make up the propose! key, they must all e use! in the where clause. -E. What is a 4artesian pro!uct? Ievel$ Iow +3pecte! answer$ : 4artesian pro!uct is the result of an unrestricte! oin of two or more tales. The result set of a three tale 4artesian pro!uct will have 3 y ) numer of rows where 3, y, ) correspon! to the numer of rows in each tale involve! in the oin. --. &ou are oining a local an! a remote tale, the network manager complains aout the traffic involve!, how can you re!uce the network traffic? Ievel$ @igh +3pecte! answer$ (ush the processing of the remote !ata to the remote instance y using a view to pre%select the information for the oin. This will result in only the !ata require! for the oin eing sent across. -1. What is the !efault or!ering of an OB7+B 9& clause in a +I+4T statement? Ievel$ Iow +3pecte! answer$ :scen!ing -6. What is tkprof an! how is it use!? Ievel$ #nterme!iate to high +3pecte! answer$ The tkprof tool is a tuning tool use! to !etermine cpu an! e3ecution times for I statements. &ou use it y first setting time!Lstatistics to true in the initiali)ation file an! then turning on tracing for either the entire !ataase via the sqlLtrace parameter or for the session using the :IT+B +#ON comman!. Once the trace file is generate! you run the tkprof tool against the trace file an! then look at the output from the tkprof tool. This can also e use! to generate e3plain plan output. -;. What is e3plain plan an! how is it use!? Ievel$ #nterme!iate to high +3pecte! answer$ The +J(I:#N (I:N comman! is a tool to tune I statements. To use it you must have an e3plainLtale generate! in the user you are running the e3plain plan for. This is create! using the utl3plan.sql script. Once the e3plain plan tale e3ists you run the e3plain plan comman! giving as its argument the I statement to e e3plaine!. The e3plainLplan tale is then querie! to see the e3ecution plan of the statement. +3plain plans can also e run using tkprof. -<. @ow !o you set the numer of lines on a page of output? The wi!th? Ievel$ Iow
Page 13 of 74
+3pecte! answer$ The +T comman! in I(I> is use! to control the numer of lines generate! per page an! the wi!th of those lines, for e3ample +T (:*+#P+ E I#N+#P+ CE will generate reports that a re E lines long with a line wi!th of CE characters. The (:*+#P+ an! I#N+#P+ options can e shortene! to (:*+ an! I#N+. -. @ow !o you prevent output from coming to the screen? Ievel$ Iow +3pecte! answer$ The +T option T+BO>T controls output to the screen. etting T+BO>T O88 turns off screen output. This option can e shortene! to T+B. -A. @ow !o you prevent Oracle from giving you informational messages !uring an! after a I statement e3ecution? Ievel$ Iow +3pecte! answer$ The +T options 8++79:4F an! K+B#8& can e set to O88. -C. @ow !o you generate file output from I? Ievel$ Iow +3pecte! answer$ 9y use of the (OOI comman! Tuning uestions$ -. : talespace has a tale with 6E e3tents in it. #s this a!? Why or why not. Ievel$ #nterme!iate +3pecte! answer$ ultiple e3tents in an! of themselves aren?t a!. @owever if you also have chaine! rows this can hurt performance. 1. @ow !o you set up talespaces !uring an Oracle installation? Ievel$ Iow +3pecte! answer$ &ou shoul! always attempt to use the Oracle 8le3ile :rchitecture stan!ar! or another partitioning scheme to ensure proper separation of &T+, BOII9:4F, B+7O IO*, 7:T:, T+(OB:B& an! #N7+J segments. 6. &ou see multiple fragments in the &T+ talespace, what shoul! you check first? Ievel$ Iow +3pecte! answer$ +nsure that users !on?t have the &T+ talespace as their T+(OB:B& or 7+8:>IT talespace assignment y checking the 79:L>+B view. ;. What are some in!ications that you nee! to increase the @:B+7L(OOIL#P+ parameter? Ievel$ #nterme!iate +3pecte! answer$ (oor !ata !ictionary or lirary cache hit ratios, getting error OB:%E;E6-. :nother in!ication is stea!ily !ecreasing performance with all other tuning parameters the same. <. What is the general gui!eline for si)ing !LlockLsi)e an! !LmultiLlockLrea! for an application that !oes many full tale scans? Ievel$ @igh +3pecte! answer$ Oracle almost always rea!s in ;k chunks. The two shoul! have a pro!uct equal to ; or a multiple of ;. . What is the fastest query metho! for a tale? Ievel$ #nterme!iate +3pecte! answer$ 8etch y rowi! A. +3plain the use of TF(BO8? W hat initiali)ation parameter shoul! e turne! on to get full TF(BO8 output? Ievel$ @igh +3pecte! answer$ The tkprof tool is a tuning tool use! to !etermine cpu an! e3ecution times for I statements. &ou use it y first setting time!Lstatistics to true in the initiali)ation file an! then turning on tracing for either the entire !ataase via the sqlLtrace parameter or for the session using the :IT+B +#ON comman!. Once the trace file is generate! you run the tkprof tool against the trace file an! then look at the output from the tkprof tool. This can also e use! to generate e3plain plan output. Page 14 of 74
C. When looking at vMsysstat you see that sorts /!isk0 is high. #s this a! or goo!? #f a! %@ow !o you correct it? Ievel$ #nterme!iate +3pecte! answer$ #f you get e3cessive !isk sorts this is a!. This in!icates you nee! to tune the sort area parameters in the initiali)ation files. The maor sort are parameter is the OBTL:B+:L#Pe parameter. D. When shoul! you increase copy latches? What parameters control copy latches? Ievel$ high +3pecte! answer$ When you get e3cessive contention for the copy latches as shown y the "re!o copy" latch hit ratio. &ou can increase copy latches via the initiali)ation parameter IO*L#>IT:N+O>L4O(#+ to twice the numer of 4(>s on your system. -E. Where can you get a list of all initiali)ation parameters for your instance? @ow aout an in!ication if they are !efault settings or have een change!? Ievel$ Iow +3pecte! answer$ &ou can look in the init.ora file for an in!ication of manually set parameters. 8or all parameters, their value an! whether or not the current value is the !efault value, look in the vMparameter view. --. 7escrie hit ratio as it pertains to the !ataase uffers. What is the !ifference etween instantaneous an! cumulative hit ratio an! which shoul! e use! for tuning? Ievel$ #nterme!iate +3pecte! answer$ The hit ratio is a measure of how many times the !ataase was ale to rea! a value from the uffers verses how many times it ha! to re%rea! a !ata value from the !isks. : value greater than CE%DEU is goo!, less coul! in!icate prolems. #f you simply take the ratio of e3isting parameters this will e a cumulative value since the !ataase starte!. #f you !o a comparison etween pairs of rea!ings ase! on some aritrary time span, this is the instantaneous ratio for that time span. *enerally speaking an instantaneous rea!ing gives more valuale !ata since it will tell you what your instance is !oing for the time it was generate! over. -1. 7iscuss row chaining, how !oes it happen? @ow can you re!uce it? @ow !o you correct it? Ievel$ high +3pecte! answer$ Bow chaining occurs when a K:B4@:B1 value is up!ate! an! the length of the new value is longer than the ol! value an! won?t fit in the remaining lock space. This results in the row chaining to another lock. #t can e re!uce! y setting the storage parameters on the tale to appropriate values. #t can e correcte! y e3port an! import of the effecte! tale. -6. When looking at the estat events report you see that you are getting usy uffer waits. #s this a!? @ow can you fin! what is causing it? Ievel$ high +3pecte! answer$ 9uffer usy waits coul! in!icate contention in re!o, rollack or !ata locks. &ou nee! to check the vMwaitstat view to see what areas are causing the prolem. The value of the "count" column tells where the prolem is, the "class" column tells you with what. >N7O is rollack segments, 7:T: is !ata ase uffers. -;. #f you see contention for lirary caches how can you fi3 it? Ievel$ #nterme!iate +3pecte! answer$ #ncrease the si)e of the share! pool. -<. #f you see statistics that !eal with "un!o" what are they really talking aout? Ievel$ #nterme!iate +3pecte! answer$ Bollack segments an! associate! structures. -. #f a talespace has a !efault pctincrease of )ero what will this cause /in relationship to the smon process0? Ievel$ @igh +3pecte! answer$ The ON process won?t automatically coalesce its free space fragments. -A. #f a talespace shows e3cessive fragmentation what are some metho!s to !efragment the talespace? /A.-,A.1 an! A.6 only0 Ievel$ @igh Page 15 of 74
+3pecte! answer$ #n Oracle A.E to A.1 The use of the 'alter session set events 'imme!iate trace name coalesce level tsX'? comman! is the easiest way to !efragment contiguous free space fragmentation. The tsX parameter correspon!s to the tsX value foun! in the tsM & tale. #n version A.6 the ?alter talespace coalesce? is est. #f the free space isn?t contiguous then e3port, !rop an! import of the talespace contents may e the only way to reclaim non%contiguous free space. -C. @ow can you tell if a talespace has e3cessive fragmentation? Ievel$ #nterme!iate #f a select against the !aLfreeLspace tale shows that the count of a talespaces e3tents is greater than the count of its !ata files, then it is fragmente!. -D. &ou see the following on a status report$ re!o log space requests 16 re!o log space wait time E #s this something to worry aout? What if re!o log space wait time is high? @ow can you fi3 this? Ievel$ #nterme!iate +3pecte! answer$ ince the wait time is )ero, no. #f the wait time was high it might in!icate a nee! for more or larger re!o logs. 1E. What can cause a high value for recursive calls? @ow can this e fi3e!? Ievel$ @igh +3pecte! answer$ : high value for recursive calls is cause y improper cursor usage, e3cessive !ynamic space management actions, an! or e3cessive statement re%parses. &ou nee! to !etermine the cause an! correct it 9y either relinking applications to hol! cursors, use proper space management techniques /proper storage an! si)ing0 or ensure repeat queries are place! in packages for proper reuse. 1-. #f you see a pin hit ratio of less than E.C in the estat lirary cache report is this a prolem? #f so, how !o you fi3 it? Ievel$ #nterme!iate +3pecte! answer$ This in!icate that the share! pool may e too small. #ncrease the share! pool si)e. 11. #f you see the value for reloa!s is high in the estat lirary cache report is this a matter for concern? Ievel$ #nterme!iate +3pecte! answer$ &es, you shoul! strive for )ero reloa!s if possile. #f you see e3cessive reloa!s then increase the si)e of the share! pool. 16. &ou look at the !aLrollackLsegs view an! see that there is a large numer of shrinks an! they are of relatively small si)e, is this a prolem? @ow can it e fi3e! if it is a prolem? Ievel$ @igh +3pecte! answer$ : large numer of small shrinks in!icates a nee! to increase the si)e of the rollack segment e3tents. #!eally you shoul! have no shrinks or a small numer of large shrinks. To fi3 this ust increase the si)e of the e3tents an! a!ust optimal accor!ingly. 1;. &ou look at the !aLrollackLsegs view an! see that you have a large numer of wraps is this a prolem? Ievel$ @igh +3pecte! answer$ : large numer of wraps in!icates that your e3tent si)e for your rollack segments are proaly too small. #ncrease the si)e of your e3tents to re!uce the numer of wraps. &ou can look at the average transaction si)e in the same view to get the information on transaction si)e. 1<. #n a system with an average of ;E concurrent users you get the following from a query on rollack e3tents$ BOII9:4F 4>B +JT+NT %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%% BE- -BE1 C BE6 -1 BE; D &T+ ; &ou have room for each to grow y 1E more e3tents each. #s there a prolem? houl! you take any action? Page 16 of 74
Ievel$ #nterme!iate +3pecte! answer$ No there is not a prolem. &ou have ;E e3tents showing an! an average of ;E concurrent users. ince there is plenty of room to grow no action is nee!e!. 1. &ou see multiple e3tents in the temporary talespace. #s this a prolem? Ievel$ #nterme!iate +3pecte! answer$ :s long as they are all the same si)e this isn?t a prolem. #n fact, it can even improve performance since Oracle won?t have to create a new e3tent when a user nee!s one. #nstallation24onfiguration -. 7efine O8:. Ievel$ Iow +3pecte! answer$ O8: stan!s for Optimal 8le3ile :rchitecture. #t is a metho! of placing !irectories an! files in an Oracle system so that you get the ma3imum fle3iility for future tuning an! file placement. 1. @ow !o you set up your talespace on installation? Ievel$ Iow +3pecte! answer$ The answer here shoul! show an un!erstan!ing of separation of re!o an! rollack, !ata an! in!e3es an! isolation os &T+ tales from other tales. :n e3ample woul! e to specify that at least A !isks shoul! e use! for an Oracle installation so that you can place &T+ talespace on one, re!o logs on two /mirrore! re!o logs0 the T+(OB:B& talespace on another, BOII9:4F talespace on another an! still have two for 7:T: an! #N7+J+. They shoul! in!icate how they will han!le archive logs an! e3ports as well. :s long as they have a logical plan for comining or further separation more or less !isks can e specifie!. 6. What shoul! e !one prior to installing Oracle /for the O an! the !isks0? Ievel$ Iow +3pecte! :nswer$ a!ust kernel parameters or O tuning parameters in accor!ance with installation gui!e. 9e sure enough contiguous !isk space is availale. ;. &ou have installe! Oracle an! you are now setting up the actual instance. &ou have een waiting an hour for the initiali)ation script to finish, what shoul! you check first to !etermine if there is a prolem? Ievel$ #nterme!iate to high +3pecte! :nswer$ 4heck to make sure that the archiver isn?t stuck. #f archive logging is turne! on !uring install a large numer of logs will e create!. This can fill up your archive log !estination causing Oracle to stop to wait for more space. <. When configuring IN+T on the server what files must e set up? Ievel$ #nterme!iate +3pecte! answer$ #N#T#:I#P:T#ON file, TNN:+.OB: file, IN+T.OB: file . When configuring IN+T on the client what files nee! to e set up? Ievel$ #nterme!iate +3pecte! answer$ IN+T.OB:, TNN:+.OB: A. What must e installe! with O794 on the client in or!er for it to work with Oracle? Ievel$ #nterme!iate +3pecte! answer$ IN+T an! (BOTO4OI /for e3ample$ T 4(#( a!apter0 layers of the transport programs. C. &ou have ust starte! a new instance with a large *: on a usy e3isting server. (erformance is terrile, what shoul! you check for? Ievel$ #nterme!iate +3pecte! answer$ The first thing to check with a large *: is that it isn?t eing swappe! out. D. What O user shoul! e use! for the first part of an Oracle installation /on >N#J0? Ievel$ low Page 17 of 74
+3pecte! answer$ &ou must use root first. -E. When shoul! the !efault values for Oracle initiali)ation parameters e use! as is? Ievel$ Iow +3pecte! answer$ Never --. @ow many control files shoul! you have? Where shoul! they e locate!? Ievel$ Iow +3pecte! answer$ :t least 1 on separate !isk spin!les. 9e sure they say on separate !isks, not ust file systems. -1. @ow many re!o logs shoul! you have an! how shoul! they e configure! for ma3imum recoveraility? Ievel$ #nterme!iate +3pecte! answer$ &ou shoul! have at least three groups of two re!o logs with the two logs each on a separate !isk spin!le /mirrore! y Oracle0. The re!o logs shoul! not e on raw !evices on >N#J if it can e avoi!e!. -6. &ou have a simple application with no "hot" tales /i.e. uniform #O an! access requirements0. @ow many !isks shoul! you have assuming stan!ar! layout for &T+, >+B, T+( an! BOII9:4F talespaces? +3pecte! answer$ :t least A, see !isk configuration answer aove. 7ata o!eler$ -. 7escrie thir! normal form? Ievel$ Iow +3pecte! answer$ omething like$ #n thir! normal form all attriutes in an entity are relate! to the primary key an! only to the primary key 1. #s the following statement true or false$ ":ll relational !ataases must e in thir! normal form" Why or why not? Ievel$ #nterme!iate +3pecte! answer$ 8alse. While 6N8 is goo! for logical !esign most !ataases, if they have more than ust a few tales, will not perform well using full 6N8. >sually some entities will e !enormali)e! in the logical to physical transfer process. 6. What is an +B7? Ievel$ Iow +3pecte! answer$ :n +B7 is an +ntity%Belationship%7iagram. #t is use! to show the entities an! relationships for a !ataase logical mo!el. ;. Why are recursive relationships a!? @ow !o you resolve them? Ievel$ #nterme!iate : recursive relationship /one where a tale relates to itself0 is a! when it is a har! relationship /i.e. neither si!e is a "may" oth are "must"0 as this can result in it not eing possile to put in a top or perhaps a ottom of the tale /for e3ample in the +(IO&++ tale you coul!n?t put in the (B+#7+NT of the company ecause he has no oss, or the unior anitor ecause he has no suor!inates0. These type of relationships are usually resolve! y a!!ing a small intersection entity. <. What !oes a har! one%to%one relationship mean /one where the relationship on oth en!s is "must"0? Ievel$ Iow to interme!iate +3pecte! answer$ This means the two entities shoul! proaly e ma!e into one entity. . @ow shoul! a many%to%many relationship e han!le!? Ievel$ #nterme!iate +3pecte! answer$ 9y a!!ing an intersection entity tale Page 18 of 74
A. What is an artificial /!erive!0 primary key? When shoul! an artificial /or !erive!0 primary key e use!? Ievel$ #nterme!iate +3pecte! answer$ : !erive! key comes from a sequence. >sually it is use! when a concatenate! key ecomes too cumersome to use as a foreign key. C. When shoul! you consi!er !enormali)ation? Ievel$ #nterme!iate +3pecte! answer$ Whenever performance analysis in!icates it woul! e eneficial to !o so without compromising !ata integrity. >N#J$ -. @ow can you !etermine the space left in a file system? Ievel$ Iow +3pecte! answer$ There are several comman!s to !o this$ !u, !f, or !f 1. @ow can you !etermine the numer of IN+T users logge! in to the >N#J system? Ievel$ #nterme!iate +3pecte! answer$ IN+T users will show up with a process unique name that egins with oracle, if you !o a ps %ef grep oraclewc %l you can get a count of the numer of users. 6. What comman! is use! to type files to the screen? Ievel$ Iow +3pecte! answer$ cat, more, pg ;. What comman! is use! to remove a file? Ievel$ Iow +3pecte! answer$ rm <. 4an you remove an open file un!er >N#J? Ievel$ Iow +3pecte! answer$ yes . @ow !o you create a !ecision tree in a shell script? Ievel$ interme!iate +3pecte! answer$ !epen!ing on shell, usually a case%esac or an if%en!if or fi structure A. What is the purpose of the grep comman!? Ievel$ Iow +3pecte! answer$ grep is a string search comman! that parses the specifie! string from the specifie! file or files C. The system has a program that always inclu!es the wor! nocomp in its name, how can you !etermine the numer of processes that are using this program? Ievel$ interme!iate +3pecte! answer$ ps %efgrep nocompwc %l D. What is an ino!e? Ievel$ #nterme!iate +3pecte! answer$ an ino!e is a file status in!icator. #t is store! in oth !isk an! memory an! tracts file status. There is one ino!e for each file on the system. -E. The system a!ministrator tells you that the system hasn?t een reoote! in months, shoul! he e prou! of this? Ievel$ @igh Page 19 of 74
+3pecte! answer$ aye. ome >N#J systems !on?t clean up well after themselves. #no!e prolems an! !ea! user processes can accumulate causing possile performance an! corruption prolems. ost >N#J systems shoul! have a sche!ule! perio!ic reoot so file systems can e checke! an! cleane! an! !ea! or )omie processes cleare! out. --. What is re!irection an! how is it use!? Ievel$ #nterme!iate +3pecte! answer$ re!irection is the process y which input or output to or from a process is re!irecte! to another process. This can e !one using the pipe symol "", the greater than symol "S" or the "tee" comman!. This is one of the strengths of >N#J allowing the output from one comman! to e re!irecte! !irectly into the input of another comman!. -1. @ow can you fin! !ea! processes? Ievel$ #nterme!iate +3pecte! answer$ ps %efgrep )omie %% or %% who %! !epen!ing on the system. -6. @ow can you fin! all the processes on your system? Ievel$ Iow +3pecte! answer$ >se the ps comman! -;. @ow can you fin! your i! on a system? Ievel$ Iow +3pecte! answer$ >se the "who am i" comman!. -<. What is the finger comman!? Ievel$ Iow +3pecte! answer$ The finger comman! uses !ata in the passw! file to give information on system users. -. What is the easiest metho! to create a file on >N#J? Ievel$ Iow +3pecte! answer$ >se the touch comman! -A. What !oes SS !o? Ievel$ #nterme!iate +3pecte! answer$ The "SS" re!irection symol appen!s the output from the comman! specifie! into the file specifie!. The file must alrea!y have een create!. -C. #f you aren?t sure what comman! !oes a particular >N#J function what is the est way to !etermine the comman!? +3pecte! answer$ The >N#J man %k comman! will search the man pages for the value specifie!. Beview the results from the comman! to fin! the comman! of interest. Oracle Trouleshooting$ -. @ow can you !etermine if an Oracle instance is up from the operating system level? Ievel$ Iow +3pecte! answer$ There are several ase Oracle processes that will e running on multi%user operating systems, these will e smon, pmon, !wr an! lgwr. :ny answer that has them using their operating system process showing feature to check for these is acceptale. 8or e3ample, on >N#J a ps %efgrep !wr will show what instances are up. 1. >sers from the (4 clients are getting messages in!icating $ Ievel$ Iow OB:%E--;$ /4nct err, can't get err t3t. ee ervr sgs Q 4o!es anual0 What coul! the prolem e? +3pecte! answer$ The instance name is proaly incorrect in their connection string. Page 20 of 74
6. >sers from the (4 clients are getting the following error stack$ Ievel$ Iow +BBOB$ OB:%E-E6;$ OB:4I+ not availale OB:%EA6-C$ smsget$ open error when opening sga!ef.!f file. @(%>J +rror$ 1$ No such file or !irectory What is the proale cause? +3pecte! answer$ The Oracle instance is shut!own that they are trying to access, restart the instance. ;. @ow can you !etermine if the IN+T process is running for IN+T K-? @ow aout K1? Ievel$ Iow +3pecte! answer$ 8or IN+T K- check for the e3istence of the orasrv process. &ou can use the comman! "tcpctl status" to get a full status of the K- T4(#( server, other protocols have similar comman! formats. 8or IN+T K1 check for the presence of the I#T+N+B process/s0 or you can issue the comman! "lsnrctl status". <. What file will give you Oracle instance status information? Where is it locate!? Ievel$ Iow +3pecte! answer$ The alert.ora log. #t is locate! in the !irectory specifie! y the ackgroun!L!umpL!est parameter in the vMparameter tale. . >sers aren?t eing allowe! on the system. The following message is receive!$ Ievel$ #nterme!iate OB:%EE1
--. &ou get a call from you ackup 79: while you are on vacation. @e has corrupte! all of the control files while playing with the :IT+B 7:T:9:+ 9:4F>( 4ONTBOI8#I+ comman!. What !o you !o? Ievel$ @igh +3pecte! answer$ :s long as all !atafiles are safe an! he was successful with the 9:4F>( controlfile comman! you can !o the following$ 4ONN+4T #NT+BN:I T:BT>( O>NT /Take any rea!%only talespaces offline efore ne3t step :IT+B 7:T:9:+ 7:T:8#I+ .... O88I#N+0 B+4OK+B 7:T:9:+ >#N* 9:4F>( 4ONTBOI8#I+ :IT+B 7:T:9:+ O(+N B++TIO* /ring rea!%only talespaces ack online0 hut!own an! ackup the system, then restart #f they have a recent output file from the :IT+B 7:T:9:+ 9:4F>( 4ONTBOI 8#I+ TO TB:4+ comman!, they can use that to recover as well. #f no ackup of the control file is availale then the following will e require!$ 4ONN+4T #NT+BN:I T:BT>( NOO>NT 4B+:T+ 4ONTBOI 8#I+ ..... @owever, they will nee! to know all of the !atafiles, logfiles, an! settings for :JIO*8#I+, :JIO*+9+B, :JIO*@#TOB&, :J7:T:8#I+ for the !ataase to use the comman!. SET 3
-. To see current user name qlS show user 1. 4hange I prompt name IS set sqlprompt Yanimara S Y animara S animara S 6. witch to 7O prompt IS host ;. @ow !o # eliminate the !uplicate rows ? IS !elete from taleLname where rowi! not in /select ma3/rowi!0 from tale group y !uplicateLvaluesLfiel!Lname0 or IS !elete from taleLname ta where rowi! S/select min/rowi!0 from taleLname t where ta.!vt.!v an! .....0 +3ample. Tale +mp +mpno +name -Ecott -E1 =iyo -E6 illor -E; =iyo -E< mith !elete from emp a where rowi! R / select ma3/rowi!0 from emp where a.ename .ename 0 The output like, +mpno +name -Ecott -E6 illor -E; =iyo -E< mith <. @ow !o # !isplay row numer with recor!s? To achive this use rownum pseu!ocolumn with query, like IS IS select rownum, ename from emp Output$ cott 1 illor Page 22 of 74
6 ;
=iyo mith
. 7isplay the recor!s etween two range select rownum, empno, ename from emp where rowi! in /select rowi! from emp where rownum RQupto minus select rowi! from emp where rownumRQtart0 +nter value for upto$ -E +nter value for tart$ A BOWN> +(NO +N:+ %%%%%%%%% %%%%%%%%% %%%%%%%%%% AAC1 4I:BF 1 AACC 4OTT 6 AC6D F#N* ; AC;; T>BN+B A. # know the nvl function only allows the same !ata type/ie. numer or char or !ate Nvl/comm, E00, if commission is null then the te3t YNot :pplicaleZ want to !isplay, instea! of lank space. @ow !o # write the query? IS select nvl/toLchar/comm.0,'N:'0 from emp Output $ NKI/TOL4@:B/4O0,'N:'0 %%%%%%%%%%%%%%%%%%%%%%% N: 6EE N7, cursorLnameUBOW4O>NT, cursorLnameU#O(+N -E. #mplicit 4ursor attriutes ame as e3plicit cursor ut prefi3e! y the wor! I IU8oun!, IUNOT8O>N7, IUBOW4O>NT, IU#O(+N Tips $ -. @ere IU#O(+N is false, ecause oracle automatically close! the implicit cursor after e3ecuting I statements. $ 1. :ll are 9oolean attriutes. --. 8in! out nth highest salary from emp tale +I+4T 7#T#N4T /a.sal0 8BO +( : W@+B+ QN /+I+4T 4O>NT /7#T#N4T /.sal00 8BO +( 9 W@+B+ a.salR.sal0 +nter value for n$ 1 :I %%%%%%%%% 6AEE -1. To view installe! Oracle version information IS select anner from vMversion Page 23 of 74
-6. 7isplay the numer value in Wor!s IS select sal, /toLchar/toL!ate/sal,''0, 'sp'00 from emp the output like, :I /TOL4@:B/TOL7:T+/:I,'='0,'=('00 %%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CEE eight hun!re! -EE one thousan! si3 hun!re! -1II [N2:\ to reset IS et N>II [\ -D. What are the more common pseu!o%columns? &7:T+, >+B , >#7, 4>BK:I, N+JTK:I, BOW#7, BOWN> 1E. What is the output of #*N function? - for positive value, E for Pero, %- for Negative value. 1-. What is the ma3imum numer of triggers, can apply to a single tale? -1 triggers. Set 4 : PL/SQL interview questions
Which of the following statements is true aout implicit cursors? #mplicit cursors are use! for I statements that are not name!. 7evelopers shoul! use implicit cursors with great care. #mplicit cursors are use! in cursor for loops to han!le !ata processing. #mplicit cursors are no longer a feature in Oracle. Page 24 of 74
Which of the following is not a feature of a cursor 8OB loop? Becor! type !eclaration. Opening an! parsing of I statements. 8etches recor!s from cursor. Bequires e3it con!ition to e !efine!. : !eveloper woul! like to use referential !atatype !eclaration on a variale. The variale name is +(IO&++LI:TN:+, an! the correspon!ing tale an! column is +(IO&++, an! IN:+, respectively. @ow woul! the !eveloper !efine this variale using referential !atatypes? >se employee.lnameUtype. >se employee.lnameUrowtype. Iook up !atatype for +(IO&++ column on I:TN:+ tale an! use that. 7eclare it to e type ION*. Which three of the following are implicit cursor attriutes? Ufoun! UtooLmanyLrows Unotfoun! Urowcount Urowtype #f left out, which of the following woul! cause an infinite loop to occur in a simple loop? IOO( +N7 IOO( #8%T@+N +J#T Which line in the following statement will pro!uce an error? cursor actionLcursor is select name, rate, action into actionLrecor! from actionLtale There are no errors in this statement. The comman! use! to open a 4>BOB 8OB loop is open fetch parse None, cursor for loops han!le cursor opening implicitly. What happens when rows are foun! using a 8+T4@ statement #t causes the cursor to close #t causes the cursor to open #t loa!s the current row values into variales #t creates the variales to hol! the current row values Bea! the following co!e$ 4B+:T+ OB B+(I:4+ (BO4+7>B+ fin!Lcpt /vLmovieLi! ]:rgument o!e^ N>9+B, vLcostLperLticket ]argument mo!e^ N>9+B0 # 9+*#N #8 vLcostLperLticket S C.< T@+N +I+4T costLperLticket #NTO vLcostLperLticket 8BO grossLreceipt W@+B+ movieLi! vLmovieLi! +N7 #8 +N7 Which mo!e shoul! e use! for KL4OTL(+BLT#4F+T? #N O>T B+T>BN #N O>T Page 25 of 74
Bea! the following co!e$ 4B+:T+ OB B+(I:4+ TB#**+B up!ateLshowLgross ]trigger information^ 9+*#N ]a!!itional co!e^ +N7 The trigger co!e shoul! only e3ecute when the column, 4OTL(+BLT#4F+T, is greater than M6. Which trigger information will you a!!? W@+N /new.costLperLticket S 6.A<0 W@+N /$new.costLperLticket S 6.A< W@+B+ /new.costLperLticket S 6.A<0 W@+B+ /$new.costLperLticket S 6.A<0 What is the ma3imum numer of han!lers processe! efore the (I2I lock is e3ite! when an e3ception occurs? Only one :ll that apply :ll reference! None 8or which trigger timing can you reference the N+W an! OI7 qualifiers? tatement an! Bow tatement only Bow only Oracle 8orms trigger Bea! the following co!e$ 4B+:T+ OB B+(I:4+ 8>N4T#ON getLu!get/vLstu!ioLi! #N N>9+B0 B+T>BN numer # vLyearlyLu!get N>9+B 9+*#N +I+4T yearlyLu!get #NTO vLyearlyLu!get 8BO stu!io W@+B+ i! vLstu!ioLi! B+T>BN vLyearlyLu!get +N7 Which set of statements will successfully invoke this function within I(lus? K:B#:9I+ gLyearlyLu!get N>9+B +J+4>T+ gLyearlyLu!get $ *+TL9>7*+T/--0 K:B#:9I+ gLyearlyLu!get N>9+B +J+4>T+ $gLyearlyLu!get $ *+TL9>7*+T/--0 K:B#:9I+ $gLyearlyLu!get N>9+B +J+4>T+ $gLyearlyLu!get $ *+TL9>7*+T/--0 K:B#:9I+ gLyearlyLu!get N>9+B $gLyearlyLu!get $ *+TL9>7*+T/--0 4B+:T+ OB B+(I:4+ (BO4+7>B+ up!ateLtheater /vLname #N K:B4@:B vLtheaterLi! #N N>9+B0 # 9+*#N >(7:T+ theater +T name vLname W@+B+ i! vLtheaterLi! +N7 up!ateLtheater When invoking this proce!ure, you encounter the error$ OB:%EEE$ >nique constraint/4OTT.T@+:T+BLN:+L>F0 violate!.@ow shoul! you mo!ify the function to han!le this error? Page 26 of 74
:n user !efine! e3ception must e !eclare! an! associate! with the error co!e an! han!le! in the +J4+(T#ON section. @an!le the error in +J4+(T#ON section y referencing the error co!e !irectly. @an!le the error in the +J4+(T#ON section y referencing the >N#>+L+BBOB pre!efine! e3ception. 4heck for success y checking the value of IU8O>N7 imme!iately after the >(7:T+ statement. Bea! the following co!e$ 4B+:T+ OB B+(I:4+ (BO4+7>B+ calculateLu!get # vLu!get stu!io.yearlyLu!getUT&(+ 9+*#N vLu!get $ getLu!get/--0 #8 vLu!get R 6EEEE T@+N setLu!get/--,6EEEEEEE0 +N7 #8 +N7 &ou are aout to a!! an argument to 4:I4>I:T+L9>7*+T. What effect will this have? The *+TL9>7*+T function will e marke! invali! an! must e recompile! efore the ne3t e3ecution. The +TL9>7*+T function will e marke! invali! an! must e recompile! efore the ne3t e3ecution. Only the 4:I4>I:T+L9>7*+T proce!ure nee!s to e recompile!. :ll three proce!ures are marke! invali! an! must e recompile!. Which proce!ure can e use! to create a customi)e! error message? B:#+L+BBOB I+BB B:#+L:((I#4:T#ONL+BBOB B:#+L+BK+BL+BBOB The 4@+4FLT@+:T+B trigger of the T@+:T+B tale has een !isale!. Which comman! can you issue to enale this trigger? :IT+B TB#**+B checkLtheater +N:9I+ +N:9I+ TB#**+B checkLtheater :IT+B T:9I+ checkLtheater +N:9I+ checkLtheater +N:9I+ checkLtheater +3amine this !ataase trigger 4B+:T+ OB B+(I:4+ TB#**+B preventLgrossLmo!ification ]a!!itional trigger information^ 9+*#N #8 TOL4@:B/sys!ate, 7&0 ON T@+N B:#+L:((I#4:T#ONL+BBOB/%1EEEE,*ross receipts cannot e !elete! on on!ay0 +N7 #8 +N7 This trigger must fire efore each 7+I+T+ of the *BOLB+4+#(T tale. #t shoul! fire only once for the entire 7+I+T+ statement. What a!!itional information must you a!!? 9+8OB+ 7+I+T+ ON grossLreceipt :8T+B 7+I+T+ ON grossLreceipt 9+8OB+ /grossLreceipt 7+I+T+0 8OB +:4@ BOW 7+I+T+7 8BO grossLreceipt +3amine this function$ 4B+:T+ OB B+(I:4+ 8>N4T#ON setLu!get /vLstu!ioLi! #N N>9+B, vLnewLu!get #N N>9+B0 # 9+*#N >(7:T+ stu!io +T yearlyLu!get vLnewLu!get W@+B+ i! vLstu!ioLi! #8 IU8O>N7 T@+N Page 27 of 74
B+T>BN TB>+l +I+ B+T>BN 8:I+ +N7 #8
4O#T +N7 Which co!e must e a!!e! to successfully compile this function? :!! B+T>BN right efore the # keywor!. :!! B+T>BN numer right efore the # keywor!. :!! B+T>BN oolean right after the # keywor!. :!! B+T>BN oolean right efore the # keywor!. >n!er which circumstance must you recompile the package o!y after recompiling the package specification? :ltering the argument list of one of the package constructs :ny change ma!e to one of the package constructs :ny I statement change ma!e to one of the package constructs Bemoving a local variale from the 7+4I:B+ section of one of the package constructs (roce!ure an! 8unctions are e3plicitly e3ecute!. This is !ifferent from a !ataase trigger. When is a !ataase trigger e3ecute!? When the transaction is committe! 7uring the !ata manipulation statement When an Oracle supplie! package references the trigger 7uring a !ata manipulation statement an! when the transaction is committe! Which Oracle supplie! package can you use to output values an! messages from !ataase triggers, store! proce!ures an! functions within I(lus? 79L7#(I:& 79LO>T(>T 79LI#T 79L7+4B#9+ What occurs if a proce!ure or function terminates with failure without eing han!le!? :ny 7I statements issue! y the construct are still pen!ing an! can e committe! or rolle! ack. :ny 7I statements issue! y the construct are committe! >nless a *OTO statement is use! to continue processing within the 9+*#N section, the construct terminates. The construct rolls ack any 7I statements issue! an! returns the unhan!le! e3ception to the calling environment. +3amine this co!e 9+*#N theaterLpck.vLtotalLseatsLsol!Loverall $ theaterLpck.getLtotalLforLyear +N7 8or this co!e to e successful, what must e true? 9oth the KLTOT:IL+:TLOI7LOK+B:II variale an! the *+TLTOT:IL8OBL&+:B function must e3ist only in the o!y of the T@+:T+BL(4F package. Only the *+TLTOT:IL8OBL&+:B variale must e3ist in the specif ication of the T@+:T+BL(4F package. Only the KLTOT:IL+:TLOI7LOK+B:II variale must e3ist in the specification of the T @+:T+BL(4F package. 9oth the KLTOT:IL+:TLOI7LOK+B:II variale an! the *+TLTOT:IL8OBL&+:B function must e3ist in the specification of the T@+:T+BL(4F package. : store! function must return a value ase! on con!itions that are !etermine! at runtime. Therefore, the +I+4T statement cannot e har!%co!e! an! must e create! !ynamically when the function is e3ecute!. Which Oracle supplie! package will enale this feature? 79L77I 79L7I 79L&N 79LI nswers ] Thanks again for publishing my questions.
Page 28 of 74
Tech Interviews comment by Sachin Rastogi ([email protected]) . !.! ". #.($"$#) %.! &." '.# .! .! *.("$#) . !.# ". #. %." &." '. .($#) .# !*." !.# !!.! !".# !#." !%.# please let me know how many answers are right. in this pl+sql test. Thanks , Regar-s$ Su-hir Rao. Tech Interviews comment by Su-hir nswer to question/! is # Tech Interviews comment by 0nname!# IS # Tech Interviews comment by -c1 The answer to the question is wrong2 shoul- be ". Tech Interviews comment by Stephen 3acob nswer to number shoul- be #. 4ow can you check for the initial value$ if there is no user input5 Tech Interviews comment by Stephen 3acob The nswer to the question is "r- 6hoice. Tech Interviews comment by hame- Tharik.7 8uestion " all the four answers are wrong $ the function e9ecute- like this S8:; select get?T<0A>?T() BBBBC :et me know$ if you have any Suggestions. Tech Interviews comment by hame- Tharik.7 The nswer to the question % is #r- 6hoice. If you are missing the ?7A :DDE (!)$ the loop -o not work$ proce-ure -oes not compile. Tech Interviews comment by Francisco 3. an-a The nswer to the question % is r- 6hoice. ItiGs imposible that both " an- # are correct. He -o not nee- location (where) we nee- time (when).
Page 29 of 74
Tech Interviews comment by Francisco 3. an-a The nswer to the question % is "r- 6hoice. The #r- (Dracle Forms trigger) is in some way correct$ but oracle triggers an- Forms triggers are not the same. This question is about Dracle triggers (not Forms). Tech Interviews comment by Francisco 3. an-a 4i hame- Tharik.7 your answer is correct$ but also answer number ! works to be able to see the result uses S8:;print g
Page 30 of 74
answer for is Tech Interviews comment by oraguru Right answer to 80S.% is #th option co1 if en- loop is misse- in programming it wu- through error while compiling $ but if u misse- ?MIT $ the program wu- not know where to e9it the loop Nan- loop wu- go on Tech Interviews comment by cobra . !. # ". #. $"$# %. ! &. !$" '. # . " . # *. . ! !. " ". ! #.# %. " &. " '.! . . " !*." !. # !!. ! Tech Interviews comment by aa
^ Set ! : SQL "PL/SQL # $%& Interview Questions
_message X1A;;` 8ri, E6 Octoer 1EE6 E6$;6 *urusuramanyam essages$ AC -. @ow to implement #N>+B#4 function in I (lus ? etho! -$ elect length /translate /trim /columnLname0,' 5%.E-16;<ACD',' '00 from !ual Will give you a )ero if it is a numer or greater than )ero if not numeric /actually gives the count of non numeric characters0 etho! 1$ select instr/translate/'wwww', 'ac!efghiklmnopqrstuvw3y):947+8*@#=FINO(BT>KWJ&P', 'JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ'0,'J'0 8BO !ual #t returns E if it is a numer, - if it is not. 1. @ow to elect last N recor!s from a Tale? select from /select rownum a, 4I:L4O7+,4I:L7+4 from clm0 where a S / select /ma3/rownum0%-E0 from clm0 @ere N -E The following query has a (rolem of performance in the e3ecution of the following query where the tale ter.terLmaster have 1116- recor!s. o the results are otaine! after hours. Page 31 of 74
4ursor remLmaster/repno K:B4@:B10 # select a. from ter.terLmaster a where NOT a.repno in /select repno from ermast0 an! /repno ':II' or a.repno S repno0 Or!er y a.repno What are steps require! tuning this query to improve its performance? ? @ave an in!e3 on T+BL:T+B.B+(NO an! one on +B:T.B+(NO ? 9e sure to get familiar with +J(I:#N (I:N. This can help you !etermine the e3ecution path that Oracle takes. #f you are using 4ost 9ase! Optimi)er mo!e, then e sure that your statistics on T+BL:T+B are up%to%!ate. ? :lso, you can change your I to$ +I+4T a. 8BO ter.terLmaster a W@+B+ NOT +J#T /+I+4T .repno 8BO ermast W@+B+ a.repno.repno0 :N7 /a.repno ':II' or a.repno S a.repno0 OB7+B 9& a.repno 6. What is the !ifference etween Truncate an! 7elete interms of Beferential #ntegrity? 7+I+T+ removes one or more recor!s in a tale, checking referential 4onstraints /to see if there are !epen!ent chil! recor!s0 an! firing any 7+I+T+ triggers. #n the or!er you are !eleting /chil! first then parent0 There will e no prolems. TB>N4:T+ removes :II recor!s in a tale. #t !oes not e3ecute any triggers. :lso, it only checks for the e3istence /an! status0 of another foreign key (ointing to the tale. #f one e3ists an! is enale!, then you will get The following error. This is true even if you !o the chil! tales first. OB:%E11$ unique2primary keys in tale reference! y enale! foreign keys &ou shoul! !isale the foreign key constraints in the chil! tales efore issuing the TB>N4:T+ comman!, then re%enale them afterwar!s. 4I#+NT2+BK+B What !oes preemptive in preemptive multitasking mean ? (reemptive refers to the fact that each task is allote! fi3e! time slots an! at the en! of that time slot the ne3t task is starte!. What !oes the OIT( stan!s for ? OIT( stan!s for On Iine Transaction (rocessing What is the most important requirement for OIT( ? OIT( requires real time response. #n a client server environment, what woul! e the maor work that the client !eals with ? The client !eals with the user interface part of the system. Why is the most of the processing !one at the sever ? To re!uce the network traffic an! for application sharing an! implementing usiness rules. What !oes teh term upsi)ing refer to ? :pplications that have outgrown their environment are re%engineere! to run in a larger environment. This is upsi)ing. What !oes one !o when one is rightsi)ing ? Page 32 of 74
With rightsi)ing, one woul! move applications to the most appropriate server platforms. What !oes the term !ownsi)ing refer to ? : host ase! application is re%engineere! to run in smaller or I:N ase! environment. What is event trigger ? :n event trigger, a segment of co!e which is associate! with each event an! is fire! when the event occurs. Why !o store! proce!ures re!uce network traffic ? When a store! proce!ure is calle!, only the proce!ure call is sent to the server an! not the statements that the proce!ure contains. What are the types of processes that a server runs ? 8oregroun! process an! 9ackgroun! process. What is a event han!ler ? :n event han!ler is a routine that is written to respon! to a particular event. What is an integrity constraint ? :n integrity constraint allows the !efinition of certain restrictions, at the tale level, on the !ata that is entere! into a tale. What are the various uses of !ataase triggers ? 7ataase triggers can e use! to enforce usiness rules, to maintain !erive! values an! perform value%ase! au!iting. What is a transaction ? : transaction is a set of operations that egin when the first 7I is issue! an! en! when a commit or rollack is issue!. 9+*#N 4O#T2BOII9:4F are the oun!ries of a transaction. Why are the integrity constraints preferre! to !ataase triggers ? 9ecause it is easier to !efine an integrity constraint than a !ataase trigger. Why is it etter to use an integrity constraint to vali!ate !ata in a tale than to use a store! proce!ure ? 9ecause an integrity constraint is automatically checke! while !ata is inserte! into a tale. : store! has to e specifically invoke!. What are the three components of a client server mo!el ? : 4lient, : erver an! : Network24ommunication software. What are the a!vantages of client2server mo!el ? 8le3iility of the system, scalaility, cost saving, centralise! control an! implementation of usiness rules, increase of !evelopers pro!uctivity, portaility, improve! network an! resource utili)ation. What are the !isa!vantages of the client2server mo!el ? @eterogeneity of the system results in re!uce! reliality. ay not e suitale for all applications. anaging an! tuning networks ecomes !ifficult. What are the !ifferent topologies availale for network ? Page 33 of 74
tar, 9us, Bing. What is the first work of 4lient process ? : client process at first estalishes connection with the erver. What are the responsiilities of a erver ? -. anage resources optimally across multiple clients. 1. 4ontrolling !ataase access an! security. se curity. 6. (rotecting the !atase an! recovering it from crashes. ;. +nforcing integrity rules gloally. #n a 4lient2erver conte3t, what !oes :(# /:pplication (rogramming #nterface0 refer to ? :n :(#, in a 4lient2erver conte3t, is a specification of a set of functions for communication etween the client an! the server. *ive some e3amples of stan!ar! :(#bs ? Open 7ataase 4onnectivity /O7940, #ntegrate! 7ataase :pplication (rogramming #nterface /#7:(#0, JOpen I24I# What is the main a!vantage of !eveloping an application using an :(# ? The application can e connecte! to any ack en! server that is supporte! y the :(#. What is the main !isa!vantage of !eveloping an application using an :(# ? The application cannot use any special features of the acken! server. Why is an event !riven program referre! to a passive program ? 9ecause an event !riven program is always waiting for something to happen efore processing. What are the four types of events ? -. ystem +vents. 1. 4ontrol +vents 6. >ser +vents ;. Other +vents. What is the !ifference etween file server an! a !ataase server ? : file server ust transfers all the !ata requeste! y all its client an! the client processes the !ata while a !ataase server runs the query an! sen!s only the query output. What is inheritance ? #nheritance is a metho! y which properties an! metho!s of an e3isting oect are automatically passe! to any oect !erive! from it. What are the two components of O794 ? -. :n O794 manager2a!ministrator an! 1. O794 !river. What is the function of a O794 manager ? The O794 anager manages all the !ata sources that e3ists in the system. What is the function of a O794 7river ? Page 34 of 74
The O794 7river allows the !eveloper to talk to the ack en! !ataase. What !escription of a !ata source is require! for O794 ? The name of the 79, the location of the source an! the !ataase !epen!ent information. @ow is a connection estalise! y O794 ? O794 uses the !escription of the !atasource availale in the O794.#N# file to loa! the require! !rivers to access that particular ack en! !ataase. B79 8>N7:+NT:I #. #NTBO7>4#N* 7:T:9:+ $ 4oncept of a 7ataase $ Tra!itional :pproach $ #n this approach, in!epen!ent application programs access their own in!epen!ent !ata files. This results in many prolems in !ata storage an! retrieval. 7ataase :pproach $ #n this approach, all application access a common !ataase, which is a centrali)e! !ata storage system. This approach has the following a!vantages $ Be!un!ancy of !ata storage is re!uce!, #nconsistency in !ata is eliminate! Q 7ata sharing etween applications is possile. #nteracting with a 7ataase $ 7ataase anagement ystem /790 $ 79 is a software that interfaces etween applications an! a !ataase for all !ata processing activities. >sers of a 79 $ +n! >sers, :pplication (rogrammers an! 7ataase :!ministrators use a 79, either !irectly or in!irectly. @ow users interact with a 7ataase $ -. +n! users sen! queries to the 79 through applications. 1. The 79 translates the queries. 6. The 79 retrieves !ata from the !ataase. ;. The 79 sen!s !ata to the application, which present the !ata to the en! users. 8unctions of a 79 $ 8unction of 79 7escription (rovi!e! y using 7efining the !ata structure 7efining structure of !ata to e store! in !ataase 7ata 7efinition Ianguage /77I0 anipulating 7ata Betrieving, a!!ing, mo!ifying, !eleting !ata. 7ata anipulation Ianguage /7I0 7ata ecurity (reventing unauthori)e! access to ! ata. >ser%i!s an! (asswor!s. 4ontrol of 7ata :ccess :llowing users to use only relevant !ata 7ata 4ontrol Ianguage /74I0 :rchitecture of a 7ataase $ Nee! for an :rchitecture $ The !etails aout comple3ity an! structure of !ata in a !ataase in not require! y en!%users. Therefore, !ifferentiating what the en!%users see an! what is actually there in a !ataase is important. :rchitecture of a 7ataase $ The architecture of a !ataase comprises a set of three levels at which a !ataase can e viewe!. +3ternal Ievel or Kiew, 4onceptual Ievel or Kiew Q #nternal Ievel or Kiew. ##. >#N* B+I:T#ON:I 7:T:9:+ $ 9asics of Belational 7ataase $ Belational 7ataase anagement ystem /B790 $ B79 is the most popular form of 79 use! in the worl!. #t uses a relational !ataase to organi)e !ata. : relational !ataase comprise relations, which are represente! as tales. Belation $ : relation stores information aout an oect in the real worl!. : relation is represente! as a tale. :ttriute $ +ach attriute of a relation stores a piece of information aout an oect. :ttriutes are represente! as columns in a tales an! can e arrange! in any or!er. +ach attriute in a relation is unique an! contain atomic values i.e. :tomic value contain a single value of !ata an! Non%:tomic values contain a set of values. The numer of attriutes in a relation is calle! the !egree of the relation. Tuple $ : row in a tale is calle! a tuple of the relation. The numer of tuples in a relation is known as the car!inality of the relation. Tuples in a tale are unique an! can e arrange! in any or!er. 7omain $ : !omain is a set of vali! atomic values that an attriute can take. Within a single !ataase, an attriute cannot have !ifferent !omains associate! with it. : !omain can inclu!e a null n ull value, if the value for the !omain is unknown or !oes not e3ist. #!entifiers for Belations $ (rimary Fey $ :n attriute that uniquely i!entifies a row in a tale is calle! its primary key. : relation can have only one primary key. The primary key cannot have any null values. #n case no unique key is foun! in a relation, two or more attriutes can e treate! as the primary key. uch keys are calle! 4omposite Feys. 4an!i!ate Fey $ : relation can have more than one attriute that uniquely i!entifies a tuple. :ny one of these keys can e selecte! as the primary key. :ll such attriutes are calle! 4an!i!ate Feys. :ll can!i!ate keys that are not primary keys are calle! :lternate Feys.
Page 35 of 74
8oreign Fey $ :n attriute that is not a can!i!ate key is calle! a Nonkey. : nonkey attriute of a relation whose value matches the primary key in some other tale is calle! 8oreign Fey OB is a column in a tale that uniquely i!entifies rows from a !ifferent tale. ###. #NT+B(B+T#N* 7:T: $ +ntities an! Belationships $ +ntity $ :n entity is an oect that e3ists in the real worl! an! is !istinguishale from other oects. +ach entity is represente! as a tale in a relational !ataase. Types of +ntities $ +ntities can e classifie! in two ways % ase! on e3istence an! ase! on susets. 9ase! on e3istence, entities can e classifie! as 7ominant an! Weak entities. 9ase! on susets, entities can e classifies as upertypes an! utypes. Belationships $ : relationship is an association etween two entities. Types of Belationships $ Belationships are classifie! into three types ase! on the occurrence of the relate! entities. One%to%One/-%-0, One%to%any/-%0 Q any%to%any/%0. >sing +2B 7iagram $ : +2B !iagram represent rep resent entities an! relationships in a !ataase system. Be!ucing +2B 7iagrams to Belations $ apping +ntities $ : !ominant entity is mappe! to a new relation. : weak entity is mappe! to a new relation. The primary key of the correspon!ing !ominant entity is inclu!e! as the foreign key in the weak entity relation. upertypes an! sutypes are mappe! to separate relations. The primary key of the supertype ecomes the primary key of the sutype. apping Belationships $ : -%- relationship is mappe! using a foreign key. The primary key of either of the entities is inclu!e as a foreign key in the relation of the other entity. This relationship is rare, ecause !ata elements relate! in this way are normally place! in the same tale. : -% or %- is mappe! y intro!ucing a foreign key. : primary key is the bdoneb si!e of the relationship, an! the foreign key is the bdmanyb si!e of the relationship. This relationship are most common. : % involves the creation of a new relation. % are prolematic an! cannot e a!equately e3presse! !irectly in a relational !. #t is e3presse! using intersection tales. :n intersection tale contains two /or more0 foreign keys, relating the primary key values of two /or more0 tales to each other. The role of an intersection tale is to convert the % into two -% relationships that can e easily han!le! y the !ataase. #K. #(I#8N* 7:T: $ Nee! for implifying 7ata $ Normali)ation $ Normali)ation is a formal process of !eveloping !ata structures in a manner that eliminates re!un!ancy an! promotes integrity. &ou nee! to simplify structure of !ata in relations for easy storage an! retrieval. The process of simplifying relations is calle! normali)ation. The new relations that are otaine! after normali)ation are calle! normali)e! relations. Normali)ation has three well !efine! steps $ The relations that you get at the en! of the first step are sai! to e in -N8. The relations that you get at the en! of the secon! step are sai! to e in 1N8. The relations that you get at the en! of the thir! step are sai! to e in 6N8. implifying 7ata to -N8 /+liminate Bepeating *roups0 $ : repeating group is a set of columns that store similar info that repeats in the same tale. To simplify !ata to -N8, you ensure that all attriutes values in a relation have atomic values. #f there are attriutes in a relation with non%atomic values, move these attriutes to a new relation an! choose an appropriate primary key for it. +.g. up#tem Tale #tem fiel! having atomic. implifying 7ata to 1N8 /+liminate Be!un!ant 7ata0 $ Be!un!ant !ata is !ata that is e3presse! multiple times unnecessarily, or !epen!s only on part of a multi%value! key. 8unctionally 7epen!ent :ttriutes $ 8unctionally 7epen!ent :ttriutes are those that elong to a single entity or relationship an! !epen! on its unique i!entifier. To simplify !ata to 1N8, you ensure that all nonkey attriutes in a relation are functionally !epen!ent on the whole key an! not part of the key. 4onversion from -N8 to 1N8 $ To convert a relation in -N8 to 1N8, move all nonkey attriutes that are not wholly !epen!ent on the primary key, to a new relation. Then, choose an appropriate primary key for the new relation. +.g. eparating up. tale an! #tem tale. implifying 7ata to 6N8 /+liminate 4olumns not 7epen!ent on the Fey0 $ 4olumns in each tale shoul! e a group of columns in which the !ata in each column contriutes to the !escription of each row in the tale. Transitively 7epen!ent :ttriutes $ Transitively 7epen!ent :ttriutes in a relation are those that are !epen!ent on a nonkey attriute an! not the primary key. To simplify !ata to 6N8, you ensure that there are no attriutes in a relation that are transitively !epen!ent on other attriutes. 4onversion from 1N8 to 6N8 $ To convert a relation in 1N8 to 6N8, move all transitively !epen!ent attriutes to a new relation. Then, choose an appropriate primary key for the new relation. +.g. tatus is !epen!ent on 4ity in up. tale, so move those two to separate tale. implifying 7ata to ;N8 /#solate #n!epen!ent ultiple Belationships0 $ K. TOB#N* Q B+TB#+K#N* 7:T: $ Ianguage upport for an B79 $ I $I is the language that provi!es pro vi!es comman! to interact with the !ata in the !ataase. I consists of three components % 77I, 7I Q 74I. 77I $ 77I comprises comman!s you can use to create an! mo!ify the !ataase structure. 7I $ 7I comprises comman!s you can use to a!!, mo!ify, !elete an! query !ata in the !ataase. Page 36 of 74
74I $ 74I comprises comman!s you can use to control the user access to the !ataase. Organi)ing the 7ataase $ 9ase Tales $ : !ataase comprises ase tales, which have the following features $ They physically e3ist on the !isk, +ach of them has a unique name Q they contain !ata that is crucial to an organi)ation. Their attriutes have !ata types such as character, integer, !ecimal, !ate an! time. 4B+:T+ T:9I+ $ This is a 77I comman! in I that creates a new tale in a !ataase. ynta3 $ 4B+:T+ T:9I+ tale%name /column%name !ata%type __si)e`` NOT N>II27+8:>IT !efault%value`` 4@+4F /column%name S E0 >N#>+ /column%name0 (B#:B& F+& /column%name0 8OB+#*N F+& /column%name0 B+8+B+N4+ tale%name0 :IT+B T:9I+ $ This is a 77I comman! in I that mo!ifies the structure of an e3isting tale. ynta3 $ :IT+B T:9I+ tale%name :77 /column%name !ata%type __si)e`` __NOT N>II 7+8:>IT``...0 primary key !efinition 2 foreign key !efinition 7BO( (B#:B& F+& 2 7BO( 8OB+#*N F+&0 7BO( T:9I+ $ This is 77I comman! in I that !eletes the an e3isting tale. Once you !elete a tale, all !ata containe! in it is lost an! cannot e recovere!. The storage space use! y this tale is also release!. ynta3 $ 7BO( T:9I+ tale%name #nteracting with a 7ataase $ +I+4T $ This is a 7I comman! in I that retrieves !ata from the !ataase in the form of query results. The comman! supports the following keywor!s an! clauses $ 8BO This keywor! specifies the name of the tale. This keywor! selects all the columns of the tale. W@+B+ This keywor! gives the search con!ition that specifies the !ata to e retrieve!. :N7 This operator is use! to comine two or more search con!itions. OB7+B 9& This keywor! sorts the query result on one or more columns. *BO>( 9& This keywor! groups the query result an! lets you generate summary result for each group. N>II values This value in!icates that the !ata is not present. uquery This is the query that is place insi!e the main query. #t passes its query result to the main query. #N+BT $ This is a 7I comman! in I that you use to a!! !ata in rows of a tale. &NT:J $ #N+BT #NTO tale%name /column%names0 K:I>+ /constant2N>II0 >(7:T+ $ This is a 7I comman! in I that you use to change !ata on rows of a tale. ynta3 $ >(7:T+ tale%name +T column%name%value W @+B+ con!ition 7+I+T+ $ This is a 7I comman! in I that removes one or more rows of !ata from a tale. ynta3 $ 7+I+T+ 8BO tale%name W@+B+ con!ition. +n!%user's Kiew of a 7ataase $ Kiews $ Kiews are relations that are !erive! from one or more source tales. Kiews have the following features$ Kiews let you restrict the access to !ata so that en!%users see !ata relevant to them. Kiews !o not physically e3ist in the !ataase an! only their !efinition is store! y an B79. :n B79 accesses the source tales for !ata to e retrieve! from a view. :ny changes that users make to views !o not reflect in the source tales if the view has een create! using a =oin con!ition. Kiews create! W#T@ 4@+4F O(T#ON allows for an a!!e! measure of security in a view. 8or e3ample, the user will not e ale to insert or up!ate a row that coul! not e selecte! y the view%with check option prevents this from happening. 4B+:T+ K#+W $ : view can e create! using the 4B+:T+ K#+W comman!. ynta3 $ 4B+:T+ K#+W view%name /column%names0 : query. Betrieving 7ata from a Kiew $ Once you create a view, you can retrieve !ata from it using the +I+4T comman!, ust as you !o for a tale. Bestricting :ccess to a 7ataase $ *B:NT $ This is a 74I comman! in I that you use to grant a specific set of authorities to one or more users. ynta3 $ *B:NT /I comman!0 /column%names0 ON tale%name TO user%name. B+KOF+ $ This is a 74I comman! in I that you use to take away a specific set of authorities from one or more users. ynta3 $ B+KOF+ /I comman!0 ON tale%name TO u ser%name. K#. +N>B#N* #NT+*B#T& O8 7:T: $ The concept of 7ata #ntegrity $ 7ata #ntegrity $ 7ata #ntegrity refers to the correctness an! completeness of !ata in a !ataase. #ntegrity 4onstraints $ #ntegrity constraints allows only correct changes to e ma!e to a !ataase. There are two types of integrity constraints % entity integrity an! referential integrity. +ntity #ntegrity $ +ntity #ntegrity ensures that for each row in a tale, the value of the primary key is unique an! is not null. Beferential #ntegrity $ Beferential #ntegrity ensures that for each row in a tale, the value of the foreign key is present in the reference tale. Page 37 of 74
*rouping comman!s relate! to a task $ Transaction (rocessing $ : transaction is a sequence of one or more I comman!s that together form a logical task. Transaction (rocessing ensures that when the B79 is making changes relate! to a single task, either all changes are ma!e as a unit or no changes are ma!e. 4ommit $ 4ommit is an I comman! that in!icates the successful en! of a transaction. :fter an B79 e3ecutes this comman! all the changes are ma!e to the !ataase. Bollack $ Bollack is an I comman! that cancels a transaction efore it is complete. The rollack comman! removes the changes of all previous comman!s in a transaction from the uffer. 4ontrolling 4oncurrent 7ata :ccess $ 4oncurrency 4ontrol $ :ll B79 must ensure that the transactions of concurrent users !o not interfere with each other. #f it !oes not han!le the transactions properly, the prolems of lost up!ate, uncommitte! !ata, or inconsistent !ata might occur. Iost >p!ate (rolem $ Iost up!ate prolem occurs when an up!ate ma!e y a transaction is lost !ue to an up!ate ma!e y another transaction. >ncommitte! 7ata (rolem $ >ncommitte! !ata prolem occurs when a transaction accesses !ata that has een up!ate! y a previous transaction that has not yet en!e!. #nconsistent 7ata (rolem $ #nconsistent !ata prolem occurs when a transaction accesses !ata from the !ataase an! simultaneously another transaction is changing that !ata. Iocking $ Iocking is a facility provi!e! y an B79 to ensure that a transaction !oes not interfere with any other transaction. Iocking prevents the prolem of lost up!ate, uncommitte! !ata an! inconsistent !ata. :n B79 provi!e! two types of locks for locking a part of the !ataase % share! locks an! e3clusive locks. hare! Iocks $ #f a transaction is only rea!ing !ata from a !ataase, it gets a share! lock on that part of the !ataase. Other transactions can also get a share! lock on that part of the !ataase to rea! !ata. @owever, they cannot change the !ata. +3clusive Iocks $ #f a transaction is up!ating !ata in a !ataase, it gets an e3clusive lock on that part of the !ataase. No other transaction can rea! or change this !ata. 4lient erver 4omputing o!el #. 4lient erver (ara!igm $ #ntro!uction $ #n the past !eca!e, organi)ations have restructure! an! ecome gloal. The gloali)ation an! restructuring have le! to a nee! for !istriute! an! fle3ile information access. That tra!itional computing para!igms like host%ase! an! master2slave processing !o not a!equately a!!ress the information requirements of mo!ern usiness. That the client2server mo!el provi!es an architecture that harness contemporary technology to meet the computing nee!s of the mo!ern usiness organi)ation. :lso calle! 7istriute! :pplication (rocessing or 4o%Operative :pplication (rocessing @ost 9ase! (rocessing % The 4entrali)e! (ara!igm $ 4entrali)e! computing treate! applications as an integrate! unit. :pplications ran on a single processor. The same processor generate! the user interface an! manipulate! !ata. 7um terminals were use! for !ata access an! !isplay. 7isa!vantages are $ 7ata was centrali)e! an! often not accessile to those who nee!e! it. The host compute! !i! all the work, was frequently overloa!e!, an! response times were often poor. @ar!ware choices an! scalaility were limite! y proprietary architecture's. >ser interfaces were unfrien!ly, 7ata access was infle3ile an! governe! y availale 6*I programs. aster2lave % The 8irst 7istriute! 4omput ing (ara!igm $ :s (4's an! intelligent terminals ecame availale, a limite! amount of processing was transferre! to the terminal. #ntelligent terminals often vali!ate! !ata an! provi!e! e!iting functions. uch terminal were calle! laves. laves were controlle! y aster computer which !i! the main processing an! store! all !ata. #t ha! one !istinct a!vantage. #t re!uce! the loa! on the main processor. @owever, the other prolems associate! with host%ase! processing remaine!. 4lient2erver % : 7istriute! 4omputing (ara!igm $ The client2server para!igm evolve! as an attempt to a!!ress the new computing nee!s of usiness an! utili)e new technologies. :!vantages $ 4lient2erver makes it possile to harness the computing power availale on (4s an! other workstations in an organi)ation. Besponse times are improve! as processors are not overloa!e!. @ar!ware an! software choices can e application oriente! as they !o not necessarily have to run on a proprietary computer. Network traffic is re!uce! ecause the processing power availale at the en! user terminal makes it unnecessary to sen! !etaile! instructions over the network as in the case of host ase! Q master2slave systems. 4omputing power can e a!!e! in smaller units making the system easily scaleale. 7isa!vantages $The inherent heterogeneity makes ystem #ntegration, :!ministration Q aintenance a formi!ale challenge. OB:4I+ A is an e3ceptional B79 Q also an e3cellent 79 server ecause it supports all ma or O for oth clients Q servers i.e. 7O, Netware, >ni3ware, O21 etc. Oracle Network software IN+T support all maor network communication protocols T4(2#(, (J2#(, Name! (ipes Q 7+4N+T. #t has got client server feature that !evelopers can use to minimi)e network traffic etween clients Q servers. @as features that makes it easy to a!minister a complicate! client server system. 4lient2erver :pproach $ The client2server para!igm optimi)es the use of computer resources y !istriuting application processing among multiple processors. The client2server mo!el computers are classifie! as 4lients an! ervers, where 4lients are requesters of services an! ervers are provi!er of services. Typically, clients han!le user interface function Q server han!le !ata management function. Page 38 of 74
4lient2erver :rchitecture requires (rocessing to e !istriute! over more than one computing system. 4lient%initiate! client2server interactions. erver control over the services that can e requeste! y the client. ervers to aritrate etween conflicting client requests. : communication system that enales clients Q servers to communicate. ultitasking can e !efines as the capaility of an O to run multiple applications concurrently. : ultitasking O allocates a certain amount of 4(> time to each task. #n (reemptive multitasking, the O controls the amount of 4(> time allocate! to a task. #n non%preemptive multitasking, the application controls the 4(> time an! the 4(> is release! only after the task is complete!. ultithrea!ing is an e3tension of multitasking. #t allows multitasking within an application. (rograms an! suroutines within a program can e3ecute concurrently in a multithrea!e! environment. everal user process for a single server process. 7ataase erver shoul! have preemptive multitasking Q multithrea!ing capaility. upport a stan!ar! B79. upport a stan!ar! Network Operating ystem. Tools such as B79, :pplication oftware, :pplication (rogram #nterface s, tore! (roce!ures, Bemote (roce!ure 4all /B(40 Q :pplication 7evelopment Tools are an important part of client2server systems. uch tools improve pro!uctivity an! also play a role in making client2server systems more open. :n :(# is a set of functions that translates client requests into a format that the server can un!erstan!. B(4 is essentially a messaging system which allows store! proce!ures to e invoke!. any B(4s allows proce!ures to e invoke! across heterogeneous platforms an! also provi!e the require! !ata translation services. There are several application !esigns possile in the client2server mo!el !epen!ing on how application processing is !istriute!. #n 7istriute! (resentation, the presentation function is !ivi!e! etween the client Q the server. >seful in situations where (4 or workstations are connecte! to mainframes. >se! to enhance the user interface of mainframe ase! applications. #n Bemote (resentation, the entire presentation part of the application resi!es on a !ifferent computer than the one that has the logic function. >se! in applications where user interaction is completely static an! pre!etermine!. #n 7istriute! Iogic, the logic function is place! on more than one platform thus, improving response time y allowing the logic to e3ecute simultaneously on several processors. #n Bemote 7ata anagement, the application logic resi!es on !ifferent computer than the one that has the !ata an! the 79. +asy to implement an! often provi!e en!%users with totally transparent access to !ata. #n 7istriute! 7ata anagement, the !ata an! 79 is !istriute! among multiple no!es an! !istriution of application logic. *oals of 4lient2erver (ara!igm is the en!%user. 4lient2erver seeks to provi!e en!%user transparent access to the computing resources of the organi)ation. The goal is referre! to as single system image. There are four attriutes of single system image $ Iocation Transparency $ >sers must e ale to access !ata without knowing the location of the !ata. >sers shoul! not have to learn Q use !ifferent comman!s for accessing !ata from !ifferent locations. #nteroperaility requires that applications an! processing tasks e freely portale across heterogeneous computing resources. 4onsistent >ser #nterfaces require that applications retain the same user interface across heterogeneous computing platforms. 4ommon computing tasks are represente! consistently across applications. +nterprise%wi!e Besource haring is the common threa! that links all of an enterprise's computing resource ##. 4oncepts for 4lient2erver $ #ntro!uction $ B79's stan!ar!i)e !ata storage an! access an! are therefore i!eal for implementing client2server systems. The physical structure of a network is calle! Network Topology i.e. refers to the way the caling of a network is physically structure!. The rules that govern the process of !ata transmission in a network are collectively referre! to as Network (rotocol. *raphical >ser #nterfaces improve pro!uctivity ecause they re!uce learning time an! are easier to use. 7istriute! 7ataase upport $ The capaility of an B79 to manage !ataases lying at more than one location. To provi!e !istriute! !ataase support, an B79 must e ale to provi!e transparent access to !ata, =oin tales on !ifferent platforms, @an!le an! manage !istriute! queries an! +nsure that transactions are successfully complete! on all relevant !ataases. Network $ Network has si3 asic functions, Naming, egmentation, egmenting, 8low 4ontrol, ynchroni)ation, (riority Q +rror 4ontrol. There are three types of network topologies, 9us, tar Q Bing. There are three types of transmission me!ia, Twiste! (air, 4oa3ial 4ale Q Optic 8ire. There are three types of !ata transmission metho!s, 4entrali)e!, 7istriute! Q Ban!om. *>#s $ *># must support mouse events, keyoar! events, menu events, resi)ing events, activation2!eactivation events an! initiali)e2terminate events. *># shoul! e portale, shoul! support wi!e variety of !evelopment tools Q e an in!ustry stan!ar!. ###. 4lient2erver oftware $ 9ack%en! oftware $ #t is ma!e up of 7ataase ervers Q Network Operating ystems. The !ataase server manages !ata on the system Q maintains !ata integrity. 7ataase server requires some special features. 4ompatiility i.e. must e ale to work on !ifferent operating systems. I #mplementation i.e. m ust support stan!ar! :N# I since it can communicate with !ifferent I !ialects. tore! (roce!ures i.e. must e ale to use ( as they are analy)e!, compile! an! optimi)e!. Beferential #ntegrity i.e. allows the server to synchroni)e change to columns that are part of multiple tales. 7eclarative B# estalishes precise rules for use of columns that are common across tales. 9uilt into ! software an! enforce! y !efault. #n (roce!ural B#, each ! comman! is associate! with a trigger. When comman! is issue!, the Page 39 of 74
trigger sets of a series of comman!s that make the necessary changes. 7isa!vantage is programmers must write triggers lea!ing to errors. ultithrea!ing i.e. support e3ecution of multiple tasks simultaneously. 7istriute! 7ataase upport i.e. ale to !ivi!e !ataase tasks among multiple 4(>s. :lso, ale to oin tales locate! on !ifferent servers, Q manage I queries sent to !ifferent servers. 4oncurrency 4ontrol i.e. support automatic escalation, the server locks a recor!, if a single recor! is eing mo!ifie!. : page, if several recor!s are eing mo!ifie!. : tale, if several pages are eing mo!ifie!. Transaction 4ontrol i.e. protect transactions from system failures. #n two phase commit, all workstations are notifie! of !ataase changes, an! if system fails, all sites rollack. NO controls the transmission of !ata across the network an! manages the sharing of har!ware an! software resource on the network. 8our important features are Operating +nvironment upport, Workstation upport, ecurity Q (rotocol upport. 7evelopment Tools are ma!e up of I26*I programming tools Q 8ront%en! !evelopment tools. +n! >ser Tools are ma!e up of 7ecision upport Tools an! (4%ase! a!!%ons. #K. igrating to 4lient2erver $ +valuating the 4lient2erver Option $ To e valuate the following efore !eci!ing on client2server. :pplication requirements, *eographical requirements Q (ro!uctivity *ains. 4lient2erver is most suitale for applications are !ecision support or on%line transaction processing /OIT(0. The !istances are site or city Q oth !eveloper Q en!%user pro!uctivity are e3pecte! to increase. (lanning for igration $ (lanning is nee!e! to re!uce prolems with network loa!, training Q systems maintenance. igration plan must inclu!e analysis, selection, p rototyping Q implementation as activities. (lanning must inclu!e en!% users, !evelopers an! system a!ministrators as resources. To specify system requirements for en!%users, !evelopers, system managers an! the usiness as a whole. To evaluate usiness priorities to eliminate stagnation Q !isruption. #mplementing 4lient2erver $ The ystems #ntegration Iife 4ycle /#I40 is ma!e up of preparation, !etailing an! e3ecution. anaging #I4 proects involves planning, controlling Q completing. ystem maintenance involves ensures reliaility, ensuring serviceaility an! monitoring performance. The training must cover en!%users, !evelopers Q system a!ministrators. OB:4I+ #. I(I> $ I is an +nglish like language consisting of comman!s to store, retrieve, maintain Q regulate access to your !ataase. I(I> is an application that recogni)es Q e3ecutes I com man!s Q speciali)e! I(lus comman!s that can customi)e reports, provi!e help Q e!it facility Q maintain system variales. NKI $ Null value function converts a null value to a non%null value for the purpose of evaluating an e3pression. Numeric 8unctions accept numeric #2( Q return numeric values. They are O7, BT, BO>N7, TB>N4 Q (OW+B. 7ate 8unctions are :77LONT@, I:TL7:&, N+JTL7:&, ONT@L9+TW++N Q &7:T+. 4haracter 8unctions are #N#T4:(, >((+B, IOW+B, >9TB Q I+N*T@. :!!itional functions are *B+:T+T Q I+:T. *roup 8unctions returns results ase! upon groups of rows rather than one result per row, use group functions. They are :K*, 4O>NT, :J, #N Q >. TT#TI+ Q 9T#TI+ are comman!s to control report hea!ings Q footers. 4OI>N comman! !efine column hea!ings Q format !ata values. 9B+:F comman! clarify reports y suppressing repeate! values, skipping lines Q allowing for controlle! reak points. 4O(>T+ comman! control computations on susets create! y the 9B+:F comman!. +T comman! changes the system variales affecting the report environment. (OOI comman! creates a print file of the report. =O#N is the form of +I+4T comman! that comines info from two or more tales. Types of =oins are imple /+quioin Q Non%+quioin0, Outer Q elf oin. +quioin returns rows from two or more tales oine! together ase! upon a equality con!ition in the W@+B+ clause. Non%+quioin returns rows from two or more tales ase! upon a relationship other than the equality con!ition in the W@+B+ clause. Outer =oin comines two or more tales returning those rows from one tale that have no !irect match in the other tale. elf =oin oins a tale to itself as though it were two separate tales. et Operators supporte! y Oracle are $ >nion is the pro!uct of two or more tales. #ntersect is the pro!uct of two tales listing only the matching rows. inus is the pro!uct of two tales listing only the non%matching rows. 4orrelate! uquery is a suquery that is evaluate! once for each row processe! y the parent statement. (arent statement can e elect, >p!ate or 7elete. >se 4B to answer multipart questions whose answer !epen!s on the value in each row processe! y parent statement. ultiple columns can e returne! from a Neste! uquery. equences are use! for generating sequence numers without any overhea! of locking. 7rawack is that after generating a sequence numer if the transaction is rolle! ack, then that sequence numer is lost. ynonyms is the alias name for tale, views, sequences Q proce!ures an! are create! for reasons of ecurity an! 4onvenience. Two levels are (ulic % create! y 79: Q accessile to all the users. (rivate % :ccessile to creator only. :!vantages are referencing without specifying the owner an! 8le3iility to customi)e a more meaningful naming convention. Page 40 of 74
#n!e3es are optional structures associate! with tales use! to spee! query e3ecution an!2or guarantee uniqueness. 4reate an in!e3 if there are frequent retrieval of fewer than -E%-se! primarily with Truste! Oracle. Or!er of I statement e3ecution $ Where clause, *roup 9y clause, @aving clause, Or!er 9y clause Q elect. Transaction is !efine! as all changes ma!e to the !ataase etween successive commits. 4ommit is an event that attempts to make !ata in the !ataase i!entical to the !ata in the form. #t involves writing or posting !ata to the !ataase an! committing !ata to the !ataase. 8orms check the vali!ity of the !ata in fiel!s an! recor!s !uring a commit. Kali!ity check are uniqueness, consistency an! ! restrictions. (osting is an event that writes #nserts, >p!ates Q 7eletes in the forms to the !ataase ut not committing these transactions to the !ataase. Bollack causes work in the current transaction to e un!one. avepoint is a point within a particular transaction to which you may rollack without ro lling ack the entire transaction. et Transaction is to estalish properties for the current transaction. Iocking are mechanisms inten!e! to prevent !estructive interaction etween users accessing !ata. Iocks are use! to achieve 4onsistency $ :ssures users that the !ata they are changing or viewing is not change! until the are thro' with it. #ntegrity $ :ssures !ataase !ata an! structures reflects all changes ma!e to them in the correct sequence. Iocks ensure !ata integrity an! ma3imum concurrent access to !ata. 4ommit statement releases all locks. Types of locks are given elow. 7ata Iocks protects !ata i.e. Tale or Bow lock. 7ictionary Iocks protects the structure of !ataase oect i.e. ensures tale's structure !oes not change for the !uration of the transaction. #nternal Iocks Q Iatches protects the internal !ataase structures. They are automatic. +3clusive Iock allows queries on locke! tale ut no other activity is allowe!. hare Iock allows concurrent queries ut prohiits up!ates to the locke! tales. Bow hare allows concurrent access to the locke! tale ut prohiits for a e3clusive tale lock. Bow +3clusive same as Bow hare ut prohiits locking in share! mo!e. hare! Bow +3clusive locks the whole tale an! allows users to look at rows in the tale ut prohiit others from locking the tale in share or up!ating them. hare >p!ate are synonymous with Bow hare. 7ea!lock is a unique situation in a multi user system that causes two or more users to wait in!efinitely for a locke! resource. 8irst user nee!s a resource locke! y the secon! user an! the secon! user nee!s a resource locke! y the first user. To avoi! !ea! locks, avoi! using e3clusive tale lock an! if using, use it in the same sequence an! use 4ommit frequently to release locks. utating Tale is a tale that is currently eing mo!ifie! y an #nsert, >p!ate or 7elete statement. 4onstraining Tale is a tale that a triggering statement might nee! to rea! either !irectly for a I statement or in!irectly for a !eclarative Beferential #ntegrity constraints. (seu!o 4olumns ehaves like a column in a tale ut are not actually store! in the tale. +.g. 4urrval, Ne3tval, Bowi!, Bownum, Ievel etc. IIoa!er is a pro!uct for moving !ata in e3ternal files into tales in an Oracle !ataase. To loa! !ata from e3ternal files into an Oracle !ataase, two types of input must e provi!e! to IIoa!er $ the !ata itself an! the control file. The control file !escries the !ata to e loa!e!. #t !escries the Names an! format of the !ata files, pecifications for loa!ing !ata an! the 7ata to e loa!e! /optional0. #nvoking the loa!er sqlloa! username2passwor! controlfilename RoptionsS (I2I $ 7ata types are N>9+B, 4@:B2K:B4@:B1, 7:T+ Q 9OOI+:N. :rrays are not allowe! Q only one i!entifier per line is allowe!. :ttriutes of (I2I oects are UT&(+, UBOWT&(+. (I2I 9lock is a stan!ar! (I2I co!e segment. 9lock consists of three parts. 7eclarative ection for variales, constants Q e3ceptions. T his section is optional. +3ecutale ection which is man!atory. +3ception @an!lers which is optional. (I2I supports only 7I i.e. #N+BT, >(7:T+, 7+I+T+ Q +I+4T...#NTO. I 8unctions can e reference! within a I statement i.e. Numeric /BT,BO>N7,(OW+B0, 4haracter /I+N*T@,>((+B0, 7:T+ /:77LONT@,ONT@L9+TW++N0 Q Page 41 of 74
*roup /:K*,:J,4O>NT0. ost I functions are availale outsi!e I statement e3cept for group functions. 4o!e imple Ioops repeats a sequence of statements multiple times. ynta3 $ IOO( Requence of tatementsS +N7 IOO( 4o!e Numeric 8OB Ioops repeat a sequence of statements a fi3e! numer of times. ynta3 $ 8OB Rin!e3S #N __ B+K+B+ `` RintegerS..RintegerS IOO( Rsequence of statementsS +N7 IOO( Rin!e3S is implicitly of type numer. 7efine! only within the loop Q Kalue can e reference! in an e3pression, ut a new value cannot e assigne! to the in!e3 within the loop. 4o!e While Ioops repeats a sequence of statements until a specific con!ition is no longer TB>+. ynta3 $ W@#I+ Rcon!itionS IOO( Rsequence of statementsS +N7 IOO( Rcon!itionS can e any legal (I2I con!ition Q statements will e repeate! a s long as con!ition evaluates to TB>+. 4o!e *OTO tatements umps to a !ifferent place in the (I2I lock. ynta3 $ *OTO laelLname Iegally use a *OTO a statement that is in the same sequence of statements as the *OTO. #n the sequence of statements that encloses the *OTO statement /outer lock0. Iaels can lael any statement. >se! as targets for *OTO statements, use laels for locks an! loops, Iael a lock to allow referencing of 7+4I:B+! oects that woul! otherwise not e visile ecause of scoping rules, Iael a lock to allow a variale to e reference! that might e hi!!en y a column name, Iael a loop to allow an oect to e reference that woul! otherwise not e visile ecause of scoping rules Q Iael an +J#T as a convenient way to specify e3its from outer loops. 4ursors are associate! with every I 7I statement processe! y (I2I. Two types are +3plicit i.e. ultiple row +I+4T statements Q #mplicit i.e. #N+BT, >(7:T+, 7+I+T+ Q +I+4T...#NTO statements. #mplicit cursor is calle! the I cursor%it stores info concerning the processing of the last I statement not associate! with an e3plicit cursor. O(+N, 8+T4@ Q 4IO+ !o not apply. :ll cursor attriute s apply. 4ursor has to e e3plicitly !efine! when a query returns multiple rows to process eyon! the first row returne! y the query Q to keep track of which row is currently eing processe!. 7eclare the cursor to associate its name with a +I+4T statement. ynta3 $ 7+4I:B+ 4>BOB RcursorLnameS # RregularLselectLstatementS Open the cursor to process the +I+4T statement an! store the returne! rows in the cursor. ynta3 $ O(+N RcursorLnameS 8etch !ata from the cursor an! store it in specifie! variales. ynta3 $ 8+T4@ RcursorLnameS #NTO Rvar-, var1...S 4lose the cursor to free up resources. 4ursors must e close! efore they can e reopene!. ynta3 $ 4IO+ RcursorLnameS +3plicit 4ursor :ttriutes are UNOT8O>N7, U8O>N7, UBOW4O>NT Q U#O(+N. Beference the current cursor row with the W@+B+ 4>BB+NT O8 statement. The cursor must e !eclare! with a 8OB >(7:T+ O8 clause. ynta3 $ W@+B+ 4>BB+NT O8 RcursorLnameS Beference 4ursors 8OB Ioops to specify a sequence of statements to e repeate! once for each row that is returne! y the cursor with the 4ursor 8OB Ioop. ynta3 $ 8OB Rrecor!LnameS #N RcursorLnameS IOO( %%statements to e repeate! go here +N7 IOO( 4ursor 8OB loops /48I0 are similar to Numeric 8or Ioops/N8I0. 48I specify a set of rows from a tale using the cursor's name. N8I specify an integer range. 48I recor! takes on vales of each row. N8I in!e3 takes on each value in the range. Becor!Lname is implicitly !eclare! as recor!Lname cursorLnameUBOWT&(+ When a 48I is initiate!, an implicit O(+N cursorLname is initiate!. 8or each row that satisfies the query associate! with the cursor, an implicit 8+T4@ is e3ecute! into the components of recor!Lname. When there are no more rows left to 8+T4@, an implicit 4IO+ cursorLn ame is e3ecute! an! the loop is e3ite!. 7eclare cursors to use parameters ynta3 $ 7+4I:B+ 4>BOB RcursorLnameS __/paramLname paramLtype0`` # Rregular select statementS +3ception @an!lers $ #n (I2I, errors are calle! e3ceptions. When an e3ception is raise!, p rocessing umps to the e3ception han!lers. :n e3ception han!ler is a sequence of statements to e processe! when a certain e3ception occurs. When an e3ception han!ler is complete, processing of the lock terminates. Two types are (re!efine! #nternal Page 42 of 74
+3ceptions which correspon!s to appro3imately 1E common OB:4I+ errors Q Baise! automatically y (I2I in response to an OB:4I+ error. +g.tooLmanyLrows,noL!ataLfoun!,invali!Lcursor,valueLerrori.e. arithmetic,numeric,string,conversion or constraint error occurre!, )eroL!ivi!e, !upLvalLonLin!e3,cursorLalrea!yLopen etc. >ser%7efine! +3ceptions must e !eclare! Q m ust e B:#+! e3plicitly. Only one han!ler per lock may e active at a time Q #f an e3ception is raise! in a han!ler, the search for a han!ler for the new e3ception egins in the enclosing lock of the current lock. +3ception%#nit $ +3ceptions may only e han!le! y name not OB:4I+ error numer. o, name an OB:4I+ error so that a han!ler can e provi!e! specifically for that error. ynta3 $ (B:*: +J4+(T#ONL#N#T /RuserL!efine!Le3ceptionLnameS, ROB:4I+LerrorLnumerS0 I4O7+ Q I+BB provi!es info on the e3ception currently eing han!le! Q especially useful in the OT@+B han!ler. I4O7+ returns the OB:4I+ error numer of the e3ception, or - if it was a user%!efine! e3ception. I+BB returns the OB:4I+ error message associate! with the current value of I4O7+ Q can also use any OB:4I+ error numer as an argument. I4O7+ Q I+BB cannot e use! within a I statement. #f no e3ception is active I4O7+ E Q I+BB 'normal, successful completion'.
Oracle : -0 What are the 9ack groun! processes in Oracle an! what are they. This is one of the most frequently aske! question.There are asically D (rocesses ut in a general system we nee! to mention the first five ackgroun! processes.They !o the house keeping activities for the Oracle an! are common in any system. The various ackgroun! processes in oracle are a0 7ata 9ase Writer/79WB0 $ 7ata 9ase W riter Writes o!ifie! locks from 7ataase uffer cache to 7ata 8iles.This is require! since the !ata is not written whenever a transaction is commite!. 0 IogWriter/I*WB0 $ IogWriter writes the re!o log entries to !isk. Be!o Iog !ata is generate! in re!o log uffer of *:. :s transaction commits an! log uffer fills, I*WB writes log entries into a online re!o log file. c0 ystem onitor/ON0 $ The ystem onitor performs instance recovery at instance startup.This is useful for recovery from system failure !0 (rocess onitor/(ON0 $ The (rocess onitor peforms process recovery when user (rocess fails. (mon 4lears an! 8rees resources that process was using. e0 4heck(oint/4F(T0 $ :t pecifie! times, all mo!ifie! ! ataase uffers in *: are written to !ata files y 79WB at 4heckpoints an! >p!ating all !ata files an! control files of !ataase to in!icate the most recent checkpoint f0 :rchieves/:B4@0 $ The :rchiver copies online re!o log files to archival storal when they are usy. g0 Becoveror/B+4O0 $ The Becoveror is use! to resolve the !istriute! transaction in network h0 7ispatcher /7nnn0 $ The 7ispatcher is useful in ulti Threa!e! :rchitecture i0 Ickn $ We can have upto -E lock processes for inter instance locking in parallel sql. 10 @ow many types of ql tatements are there in Oracle There are asically types of sql statments.They are a0 7ata 7efination Ianguage/77I0 $ The 77I statments !efine an! maintain oects an! !rop oects. 0 7ata anipulation Ianguage/7I0 $ The 7I statments manipulate !ataase !ata. c0 Transaction 4ontrol tatements $ anage change y 7I !0 ession 4ontrol $ >se! to control the properties of current session enaling an! !isaling roles an! changing .e.g :lter tatements,et Bole e0 ystem 4ontrol tatements $ 4hange (roperties of Oracle #nstance .e.g$$ :lter ystem f0 +me!!e! ql $ #ncorporate 77I,7I an! T.4. in (rogramming Ianguage.e.g$$ >sing the ql tatements in languages such as '4', Open,8etch, e3ecute an! close 60 What is a Transaction in Oracle : transaction is a Iogical unit of work that compromises one or more I tatements e3ecute! y a single >ser. :ccor!ing to :N#, a transaction egins with first e3ecutale statment an! en!s when it is e3plicitly commite! or rolle! ack. ;0 Fey Wor!s >se! in Oracle The Fey wor!s that are use! in Oracle are a0 4ommiting $ : transaction is sai! to e commite! when the transaction makes permanent changes resulting from the I statements. 0 Bollack $ : transaction that retracts any of the changes resulting from I statements in Transaction. c0 ave(oint $ 8or long transactions that contain many I statements, interme!iate markers or savepoints are !eclare!. avepoints can e use! to !ivi!e a transactino into smaller points. !0 Bolling 8orwar! $ (rocess of applying re!o log !uring recovery is calle! rolling forwar!. Page 43 of 74
e0 4ursor $ : cursor is a han!le / name or a pointer0 for the memory associate! with a specific stament. : cursor is asically an area allocate! y Oracle for e3ecuting the ql tatement. Oracle uses an implicit cursor statement for ingle row query an! >ses +3plcit cursor for a multi row query. f0 ystem *loal :rea/*:0 $ The *: is a share! memory region allocate! y the Oracle that contains 7ata an! control information for one Oracle #nstance.#t consists of 7ataase 9uffer 4ache an! Be!o log 9uffer. g0 (rogram *loal :rea /(*:0 $ The (*: is a memory uffer that contains !ata an! control information for server process. h0 7ataase 9uffer 4ache $ 7ataese 9uffer of *: stores the most recently use! locks of !atatase !ata.The set of !ataase uffers in an instance is calle! 7ataase 9uffer 4ache. i0 Be!o log 9uffer $ Be!o log 9uffer of *: stores all the re!o log entries. 0 Be!o Iog 8iles $ Be!o log files are set of files that protect altere! !ataase !ata in memory that has not een written to 7ata 8iles. They are asically use! for ackup when a !ataase crashes. k0 (rocess $ : (rocess is a 'threa! of control' or mechansim in Operating ystem that e3ecutes series of steps. <0 What are (roce!ure,functions an! (ackages (roce!ures an! functions consist of set of (I2I statements that are groupe! together as a unit to solve a specific prolem or perform set of relate! tasks. (roce!ures !o not Beturn values while 8unctions return one One Kalue (ackages (rovi!e a metho! of encapsulating an! storing relate! proce!ures, functions, variales an! other (ackage 4ontents 0 What are 7ataase Triggers an! tore! (roce!ures 7ataase Triggers $$ 7ataase Triggers are (roce!ures that are automatically e3ecute! as a result of insert in, up!ate to, or !elete from tale. 7ataase triggers have the values ol! an! new to !enote the ol! value in the tale efore it is !elete! an! the new in!icate! the new value that will e use!. 7T are useful for implementing comple3 usiness rules which cannot e enforce! using the integrity rules.We can have the trigger as 9efore trigger or :fter Trigger an! at tatement or Bow level. eg. operations insert,up!ate ,!elete 6 efore ,after 61 : total of cominatons :t statment level/once for the trigger0 or row level/ for every e3ecution 0 1 : total of -1. Thus a total of -1 cominations are there an! the restriction of usage of -1 triggers has een lifte! from Oracle A.6 Onwar!s. tore! (roce!ures $ tore! (roce!ures are (roce!ures that are store! in 4ompile! form in the !ataase.The a!vantage of using the store! proce!ures is that many users can use the same proce!ure in compile! an! rea!y to use format. A0 @ow many #ntegrity Bules are there an! what are they There are Three #ntegrity Bules. They are as follows $$ a0 +ntity #ntegrity Bule $ The +ntity #ntegrity Bule enforces that the (rimary key cannot e Null 0 8oreign Fey #ntegrity Bule $ The 8F#B !enotes that the relationship etween the foreign key an! the primary key has to e enforce!.When there is !ata in 4hil! Tales the aster tales cannot e !elete!. c0 9usiness #ntegrity Bules $ The Thir! #ntigrity rule is aout the comple3 usiness processes which cannot e implemente! y the aove 1 rules. C0 What are the Karious aster an! 7etail Belation ships. The various aster an! 7etail Belationship are a0 Non#solate! $ The aster cannot e !elete! when a chil! is e3isiting 0 #solate! $ The aster can e !elete! when the chil! is e3isiting c0 4asca!ing $ The chil! gets !elete! when the aster is !elete!. D0 What are the Karious 9lock 4oor!ination (roperties The various 9lock 4oor!ination (roperties are a0 #mme!iate 7efault etting. The 7etail recor!s are shown when the aster Becor! are shown. 0 7effere! with :uto uery Oracle 8orms !efer fetching the !etail recor!s until the operator navigates to the !etail lock. c0 7effere! with No :uto uery The operator must navigate to the !etail lock an! e3plicitly e3ecute a query -E0 What are the 7ifferent Optimisation Techniques The Karious Optimisation techniques are a0 +3ecute (lan $ we can see the plan of the query an! change it accor!ingly ase! on the in!e3es 0Optimi)erLhint$ setLitemLproperty/'7ept9lock',O(T##P+BL@#NT,'8#BTLBOW'0 elect 25 8irstLBows 2 7eptno,7name,Ioc,Bowi! from !ept where /7eptno S 1<0 c0 Optimi)eLql $ 9y setting the Optimi)eLql No, Oracle 8orms assigns a single cursor for all I statements.This slow !owns the processing ecause for evertime the I must e parse! whenver they are e3ecute!. f;
!0 Optimi)eLTp $ 9y setting the Optimi)eLTp No, Oracle 8orms assigns seperate cursor only for each query +I+4T statement. :ll other I statements reuse the cursor. f;ser 7efine! +3ceptions e.g. yLe3ception e3ception When yLe3ception then -60 What are the inline an! the precompiler !irectives The inline an! precompiler !irectives !etect the values !irectly -;0 @ow !o you use the same lov for 1 columns We can use the same lov for 1 columns y passing the return values in gloal values an! using the gloal values in the co!e -<0 @ow many minimum groups are require! for a matri3 report The minimum numer of groups in matri3 report are ; -0 What is the !ifference etween static an! !ynamic lov The static lov contains the pre!etermine! values while the !ynamic lov contains values that come at run time -A0 What are snap shots an! views napshots are mirror or replicas of tales. Kiews are uilt using the columns from one or more tales. The ingle Tale Kiew can e up!ate! ut the view with multi tale cannot e up!ate! -C0 What are the OO( concepts in Oracle. Oracle !oes implement the OO( concepts. The est e3ample is the (roperty 4lasses. We can categorise the properties y setting the visual attriutes an! then attach the property classes for the oects. OO( supports the concepts of oects an! classes an! we can consi!er the peroperty classes as classes an! the items as oects -D0 What is the !ifference etween can!i!ate key, unique key an! primary key 4an!i!ate keys are the columns in the tale that coul! e the primary keys an! the primary key is the key that has een selecte! to i!entify the rows. >nique ke y is also useful for i!entifying the !istinct rows in the tale. 1E0 What is concurrency 4uncurrency is allowing simultaneous access of same !ata y !ifferent users. Iocks useful for accesing the !ataase are a0 +3clusive The e3clusive lock is useful for locking the row when an insert,up!ate or !elete is eing !one.This lock shoul! not e applie! when we !o only select from the row. 0 hare lock We can !o the tale as hareLIock as many shareLlocks can e put on the same resource. 1-0 (revileges an! *rants (revileges are the right to e3ecute a particulare type of I statements. eg. Bight to 4onnect, Bight to create, Bight to resource *rants are given to the oects so that the oect might e accesse! accor!ingly.The grant has to e given y the owner of the oect. 110 Tale pace,7ata 8iles,(arameter 8ile, 4ontrol 8iles Tale pace $ The tale space is useful for storing the !ata in the !ataase.When a !ataase is create! two tale spaces are create!. a0 ystem Tale space $ This !ata file stores all the tales relate! to the system an! !a tales 0 >ser Tale space $ This !ata file stores all the user relate! tales We shoul! have seperate tale spaces for storing the tales an! in!e3es so that the access is fast.
Page 45 of 74
7ata 8iles $ +very Oracle 7ata 9ase has one or more physical !ata files.They store the !ata for the !ataase.+very !atafile is associate! with only one !ataase.Once the 7ata file is create! the si)e cannot change.To increase the si)e of the !ataase to store more !ata we have to a!! !ata file. (arameter 8iles $ (arameter file is nee!e! to start an instance.: parameter file contains the list of instance configuration parameters e.g.$$ !LlockLuffers se! (ct 8ree is use! to !enote the percentage of the free space that is to e left when creating a tale. imilarly (ct >se! is use! to !enote the percentage of the use! space that is to e use! when creating a tale eg. (ctfree 1E, (ctuse! ;E 1<0 What is Bow 4haining The !ata of a row in a tale may not e ale to fit the same !ata lock.7ata for row is store! in a chain of !ata locks . 10 What is a 1 (hase 4ommit Two (hase commit is use! in !istriute! !ata ase systems. This is useful to maintain the integrity of the !ataase so that all the users see the same values. #t contains 7I statements or Bemote (roce!ural calls that reference a remote oect. There are asically 1 phases in a 1 phase commit. a0 (repare (hase $ *loal coor!inator asks participants to prepare 0 4ommit (hase $ 4ommit all participants to coor!inator to (repare!, Bea! only or aort Beply 1A0 What is the !ifference etween !eleting an! truncating of tales 7eleting a tale will not remove the rows from the tale ut entry is there in the !ataase !ictionary an! it can e retrieve! 9ut truncating a tale !eletes it completely an! it cannot e retrieve!. 1C0 What are mutating tales When a tale is in state of transition it is sai! to e mutating. eg $$ #f a row has een !elete! then the tale is sai! to e mutating an! no operations can e !one on the tale e3cept select. 1D0 What are 4o!! Bules 4o!! Bules !escrie the i!eal nature of a B79. No B79 satisfies all the -1 co!! rules an! Oracle atisfies -- of the -1 rules an! is the only B!ms to satisfy the ma3imum numer of rules. 6E0 What is Normalisation Normalisation is the process of organising the tales to remove the re!un!ancy.There are mainly < Normalisation rules. a0 - Normal 8orm $ : tale is sai! to e in -st Normal 8orm when the attriutes are atomic 0 1 Normal 8orm $ : tale is sai! to e in 1n! Normal 8orm when all the can!i!ate keys are !epen!ant on the primary key c0 6r! Normal 8orm $ : tale is sai! to e thir! Normal form when it is not !epen!ant transitively 6-0 What is the 7ifference etween a post query an! a pre query : post query will fire for every row that is fetche! ut the pre query will fire only once. 610 7eleting the 7uplicate rows in the tale We can !elete the !uplicate rows in the tale y using the Bowi! 660 4an > !isale !ataase trigger? @ow? &es. With respect to tale Page 46 of 74
:IT+B T:9I+ T:9I+ __ 7#:9I+ allLtrigger `` 6;0 What is pseu!o columns ? Name them? : pseu!ocolumn ehaves like a tale column, ut is not actually store! in the tale. &ou can select from pseu!ocolumns, ut you cannot insert, up!ate, or !elete their values. This section !escries these pseu!ocolumns$ 4>BBK:I N+JTK:I I+K+I BOW#7 BOWN> 6<0 @ow many columns can tale have? The numer of columns in a tale can range from - to 1<;. 60 #s space acquire! in locks or e3tents ? #n e3tents . 6A0 what is clustere! in!e3? #n an in!e3e! cluster, rows are store! together ase! on their cluster key values . 4an not applie! for @:@. 6C0 what are the !atatypes supporte! 9y oracle /#NT+BN:I0? Karchar1, Numer,4har , II:9+I. 6D 0 What are attriutes of cursor? U8O>N7 , UNOT8O>N7 , U#O(+N,UBOW4O>NT ;E0 4an you use select in 8BO clause of I select ? &es.
'(I -0 What is a visual attriute? Kisual attriutes are the font, color, an! pattern properties that you set for form an! menu oects that appear in your application's interface. 10 7iff. etween K:T an! (roperty 4lass? imp Name! visual attriutes !efine only font, color, an! pattern attriutes property classes can contain these an! any other properties.&ou can change the appearance of oects at runtime y changing the name! visual attriute programmatically property class assignment cannot e change! programmatically. When an oect is inheriting from oth a property class an! a name! visual attriute, the name! visual attriute settings take prece!ence, an! any visual attriute properties in the class are ignore!. 6 0 Which trigger relate! to mouse? When%ouse%4lick When%ouse%7oule4lick When%ouse%7own When%ouse%+nter When%ouse%Ieave When%ouse%ove When%ouse%>p ;0 What is 4urrent recor! attriute property? pecifies the name! visual attriute use! when an item is part of the current recor!. 4urrent Becor! :ttriute is frequently use! at the lock level to !isplay the current row in a multi%recor! #f you !efine an item%level 4urrent Becor! :ttriute, you can !isplay a pre%!etermine! item in a special color when it is part of the current recor!, ut you cannot !ynamically highlight the current item, as the input focus changes. <0 4an u change K:T at run time? &es. &ou can programmatically change an oect's name! visual attriute setting to change the font, color, an! pattern of the oect at runtime. 0 4an u set !efault font in forms? &es. 4hange win!ows registry/rege!it0. et form;
&es. C0 4an u have K9J an! O4J controls in forms ? &es. D0 What r the types of win!ows /Win!ow style0? pecifies whether the win!ow is a 7ocument win!ow or a 7ialog win!ow. -E0 What is OI+ :ctivation style property? pecifies the event that will activate the OI+ containing item. --0 4an u change the mouse pointer ? @ow? &es. pecifies the mouse cursor style. >se this property to !ynamically change the shape of the cursor. 6.E 7ata 9ase :!ministration 6.- #ntro!uction to 79: -. What is a !ataase instance ? +3plain : !ataase instance /server0 is a set of memory structures an! ackgroun! processes that access a set of !ataase files. The process can e share! y all users. The memory structures that are use! to store most querie! !ata from !ataase. This helps us to improve !ataase performance y !ecreasing the amount of #2O performe! against !ata file. 1. What is parallel server? ultiple instances accessing the same !ataase /Only in ulti%4(> environments0. 6. What is chema ? The set of oects owne! y user account is calle! the schema ;. What is an #n!e3 ? @ow it is implemente! in Oracle 7ataase ? :n in!e3 is a !ataase structure use! y the server to have !irect access of a row in a tale. :n in!e3 is automatically create! when a unique or primary key constraint clause is specifie! in create tale comman! /Ker A.E0 <. What is clustres ? *roup of tales physically store! together ecause they share common columns an! are often use! together is calle! 4lusters. . What is a cluster key ? The relate! columns of the tales are calle! the cluster key. The cluster key is in!e3e! using a cluster in!e3 an! its value is stores only once for multiple tales in the cluster. A. What are the asic element of 9ase configuration of an oracle 7ataase ? #t consists of one or more !ata files one or more control files two or more re!o log files The !ataase contains ultiple users2schemas one or more rollack segments one or more talespaces 7ata !ictionary tales Page 48 of 74
>ser oects /tales,in!e3es,views etc0 The server that access the !ataase consists of *: /7ataase uffer, 7ictionary 4ache 9uffers, re!o log uffers,hare! I pool0 ON (ON I*WB 79WB :B4@ 4F(T B+4O 7ispatcher >ser process with associate! (*: C. What is !ea!lock ? +3plain. Two processes waiting to up!ate the rows of a tale which are locke! y the other process then !ea!lock arises. #n a !ataase environment this will often happen ecause of not issuing proper row lock comman!s. (oor !esign of front%en! application may cause this situation an! the performance of server will re!uce !rastically. These locks will e release! automatically when a commit2rollack operation performe! or any one of this processes eing kille! e3ternally. 6.1 emory anagement D. What is *: ? @ow it is !ifferent from Ker an! Ker A ? The ystem *loal :rea in a Oracle !ataase is the area in memory to facilitates the transfer of information etween users. #t hol!s the most recently requeste! structural information aout the !ataase. The structure is 7ataase uffers, 7ictionary 4ache, Be!o Iog 9uffer an! hare! I pool /Ker A0 area. -E. What is hare! I pool ? The !ata !ictionary cache is store! in an area in *: calle! the hare! I (ool. This will allow sharing of parse! I statements among concurrent users. --. What is meant y (rogram *loal :rea /(*:0 ? #t is area in memory that is use! y a ingle Oracle >ser process. -1. What is a !ata segment ? 7ata segment are the physical areas within a !ataase lock in which the !ata associate! with tales an! clusters are store!. -6. What are the factors causing the reparsing of I statements in *: ? 7ue to insufficient hare! I pool si)e onitor the ratio of the reloa!s takes place while e3ecuting I statements. #f the ratio is greater that - then increase the @:B+7L(OOIL#P+. 6.6 Iogical Q (hysical :rchitecture of 7ataase -;. What is 7ataase 9uffers ? 7ataase uffers are cache in the *: use! to hol! the !ata locks that are rea! from the !ata segments in the !ataase such as tales, in!e3es an! clusters. 79L9IO4FL9>88+B parameter in #N#T.OB: !eci!es the si)e. -<. What is !ictionary cache ? 7ictionary cache is information aout the !ataase oects store! in a !ata !ictionary tale. -. What is meant y recursive hits ? Page 49 of 74
Numer of times processes repeate!ly query the !ictionary tale is calle! recursive hits. #t is !ue to the !ata !ictionary cache is too small. 9y increasing the @:B+7L(OOIL#P+ parameter we can optimi)e the si)e of 7ata 7ictionary 4ache. -A. What is meant y re!o log uffer ? 4hanges ma!e to entries are written to the on%line re!o log files so that they can e use! in roll forwar! operation !uring !ataase recoveries. 9efore writing them into the re!o log files, they will first rought to re!o log uffers in *: an! I*WB will write into files frequently. IO*L9>88+B parameter will !eci!e the si)e. -C. @ow will you swap oects into a !ifferent tale space for an e3isting !ataase ? +3port the user (erform import using the comman! imp system2manager filee3port.!p in!e3filenewfile.sql. This will create all !efinitions into newfile.sql. 7rop necessary oects. Bun the script newfile.sql after altering the talespaces. #mport from the ackup for the necessary oects. -D. Iist the Optimal 8le3ile :rchitecture /O8:0 of Oracle !ataase ? or @ow can we organise the talespaces in Oracle !ataase to have ma3imum performance ? &T+ % 7ata !ictionary tales 7:T: % tan!ar! operational tales 7:T:1 % tatic tales use! for stan!ar! operations #N7+J+ % #n!e3es for tan!ar! operational tales #N7+J+- % #n!e3es of static tales use! for stan!ar! operations TOOI % Tool tale TOOI- % #n!e3es for tools tale B9 % tan!ar! Operations Bollack egments B9-,B91 % :!!itional2pecial rollack segments T+( % Temporary purpose talespace T+(L>+B % Temporary talespace for users >+B % >ser talespaces. 1E. @ow will you force !ataase to use particular rollack segment ? +T TB:N:4T#ON >+ BOII9:4F +*+NT rsLname 1-. What is meant y free e3tent ? : free e3tent is a collection of continuous free locks in talespace. When a segment is !roppe! its e3tents are reallocate! an! are marke! as free. 11. @ow free e3tents are manage! in Ker an! Ker A. ? 8ree e3tents cannot e merge! together in Ker .E 8ree e3tents are perio!ically coalesces with the neighoring free e3tent Ker A.E. 16. Which parameter in torage clause will re!uce no of rows per lock ? (4T8B++ parameter Bow si)e also re!uces no of rows per lock. 1;. What is significance of having storage clause ? We can plan the storage for a tale as how much initial e3tents are require!, how much can e e3ten!e! ne3t, how much U shoul! leave free for managing row up!ations etc. 1<. @ow !oes space allocation take place within a lock ? +ach lock contains entries as follows $ 8i3e! lock hea!er Kariale lock hea!er Page 50 of 74
Bow hea!er, row !ate /ultiple rows may e3ists0 (4T8B++ /U of free space for row up!ation in future0 1. What is the role of (4T8B++ parameter is torage clause ? This is use! to reserve certain amount of space in a lock for e3pansion of rows. 1A. What is the O(T#:I parameter ? #t is use! to set the optimal length of rollack segment. 1C. What is the functionality of &T+ talespace ? To manage the !ataase level of transactions such as mo!ifications of the !ata !ictionary tale that recor! information aout the free space usage. 1D. @ow will you create multiple rollack segments in a !ataase ? 4reate a !ataase which implicitly creates a &T+ Bollack egment in a &T+ talespace. 4reate a econ! Bollack egment name BE in the &T+ talespace. ake new rollack segment availale /:fter shut!own, mo!ify init.ora file an! tart !ataase0 4reate other talespace /B90 for rollack segments. 4reate a!!itional Bollack segment in talespace /B90 7eactivate Bollack egment BE an! activate the newly create! rollack segments. 6E. @ow the space utilisation takes place within rollack segments ? #t will try to fit the transaction in a cyclic fashion to all e3isting e3tents. Once it foun! an e3tent is in use then it force! to acquire a new e3tent. /No of e3tents is ase! on the O(T#:I si)e0. 6-. Why query fails sometimes ? Bollack segment !ynamically e3tent to han!le larger transactions entry loa!s. : single transaction may wipeout all availale free space in the Bollack egment Talespace. This prevents other user using Bollack segment. 61. @ow will you monitor the space allocation ? 9y querying 79:L+*+NT tale2Kiew 66. @ow will you monitor rollack segment status ? uerying the 79:LBOII9:4FL+* view The status availale as follows $ #N >+ % Bollack egment is on%line :K:#I:9I+ % Bollack egment availale ur not on%line O88%I#N+ % Bollack egment us off%line #NK:I#7 % Bollack egment !roppe! N++7 B+4OK+B& % 4ontains !ata ut nee! recovery or corrupte! (:BTI& :K:#I:9I+ % 4ontains !ata from an unresolve! transaction involving a !istriute! !ataase 6;. Iist the sequence of events when a large transaction that e3cee!s eyon! its optimal value when an entry wraps an! causes the rollack segment to e3pan! into another e3ten!. Transaction 9egins :n entry is ma!e in the B9 hea!er for new transactions entry Transaction acquire! locks in an e3tent of B9 The entry attempts to wrap into secon! e3tent. None is availale. o that the B9 must e3tent. The B9 checks to see if it is ol!est inactive segment Ol!est inactive segment is eliminate! B9 e3ten!s The 7ata !ictionary tale for space management are up!ate! Transaction 4ompletes. Page 51 of 74
6<. @ow can we plan storage for very large tales ? Iimit the numer of e3tents in the tale eparate the Tale from its in!e3es :llocate sufficient temporary storage 6. @ow will you estimate the space require! y non%clustere! tales ? 4alculate the total lock hea!er si)e 4alculate the availale !ata space per lock 4alculate the comine! column length of the average row 4alculate the total average row si)e 4alculate the average numer rows that can fit in a lock 4alculate the numer of locks an! ytes require! for the tale :fter arriving the calculation a!! the a!!itional space to calculate the initial e3tent si)e for working area 6A. #s it possile to use raw !evices as !ata file an! what is the a!vantages over file system files ? &es. The a!vantages over file system files $ #2O will e improve! ecause Oracle is ye%passing the kernal while writing into !isk. 7isk 4orruption will e very less. 6C. What is a control file ? 7ataase's overall physical architecture is maintaine! in a file calle! control file. #t will e use! to maintain internal consistency an! gui!e recovery operations. ultiple copies of control files are a!visale. 6D. @ow to implement the multiple control files for an e3isting !ataase ? hut!own the !ataase 4opy one of the e3isting control file to new location' +!it config.ora file y a!!ing new control file name Bestart the !ataase ;E. What is meant y Be!o Iog file mirroring ? @ow it can e achieve! ? (rocess of having a copy of re!o log files is calle! mirroring. This can e achieve! y creating group of log files together, so that I*WB will automatically writes them to all the memers of the current on%line re!o log group. #f any one group fails then !ataase automatically switch over to ne3t group. ;-. What is a!vantage of having !isk sha!owing2irroring ? ha!ow set of !isks save as a ackup in the event of !isk failure. #n most Operating ystem if any !isk failure occurs it automatically switchover to place of faile! !isk. #mprove! performance ecause of most O support volume sha!owing can !irect file #2O request to use the sha!ow set of files instea! of the main set of files. This re!uces #2O loa! on the main set of !isks. ;1. What is use of rollack segment in 7ataase ? They allow the !ataase to maintain rea! consistency etween multiple transactions. ;6. What is a Bollack segment entry ? #t is the set of efore image !ata locks that contain rows that are mo!ifie! y a transaction. +ach Bollack egment entry must e complete! within one rollack segment. : single rollack segment can have multiple rollack segment entries. ;;. What a hit ratio ? #t is a measure of well the !ata cache uffer is han!ling requests for !ata. @it Batio /Iogical Bea!s % (hysical rea!s % @it isses0 2 Iogical rea!s. ;<. When will e a segment release! ? Page 52 of 74
When egment is !roppe!. When hrink /B9 only0 When truncate! /TB>N4:T+ use! with !rop storage option0 ;. What are !isa!vantages of having raw !evices ? We shoul! !epen! on e3port2import utility for ackup2recovery /fully reliale0 The tar comman! cannot e use! for physical file ackup, instea! we can use !! comman! which is less fle3ile an! has limite! recoveries. ;A. Iist the factors that can affect the accuracy of the estimations ? The space use! transaction entries an! !elete! recor!s !oes not ecome free imme!iately after completion !ue to !elaye! cleanout. Trailing nulls an! length ytes are not store!. #nserts of, up!ates to, an! !eletes of rows as well as columns larger than a single !ata lock, can cause fragmentation an! chaine! row pieces. 6.; 7ataase ecurity Q :!ministration ;C. What is user account in Oracle !ataase ? :n user account is not a physical structure in 7ataase ut it is having important relationship to the oects in the !ataase an! will e having certain privileges. ;D. @ow will you enforce security using stores proce!ures ? 7on't grant user access !irectly to tales within application #nstea! grant the aility to access the proce!ures that access the tales When proce!ure e3ecute! it will e3ecute the privilege of proce!ures owner. >sers cannot access tales e3cept via the proce!ure.
&T+ user account % #t has all the system privileges for the !ataase an! a!!itional tales an! views that !isplay a!ministrative information an! internal tales an! views use! y oracle tools are create! using the username. <;. What are the !ataase a!ministrators utilities availale ? I79: % This allows 79: to monitor an! control a n OB:4I+ !ataase. IIoa!er % #t loa!s !ata from stan!ar! operating system files /8lat files0 into OB:4I+ !ataase tales. +J(OBT/e3p0 an! #(O+B /imp0 utilities allow you to mo ve e3isting !ata in OB:4I+ format to an! from OB:4I+ !ataase. <<. What are the minimum parameters shoul! e3ist in the parameter file /init.ora0 ? 79LN:+ % ust set to a te3t string of not more that C characters an! it will e store! insi!e the !atafiles, re!o log files an! control file while !ataase creation. 79L7O:#N % #t is string that specifies the network !omain where the !ataase is create!. The gloal !ataase name is i!entifie! y setting these parameters /79LN:+ Q 79L7O:#N0 4ONTBOIL8#I+ % Iist of control filenames of the !ataase. #f name is not mentione! then !efault name will e use!. 79L9IO4FL#P+ % The !efault !ata lock si)e an! is operating system !epen!ent. #t cannot e change! after !ataase creation e3cept y re%creating the !ataase. 79L9IO4FL9>88+B % The ma3imum numer of operating system processes that can e connecte! to OB:4I+ concurrently. The value shoul! e < /ackgroun! process0 an! a!!itional - for each user. BOII9:4FL+*+NT % Iist of rollack segments an OB:4I+ instance acquires at !ataase startup. :lso optionally I#4+N+L:JL+#ON,I#4+N+L+#ONLW:BN#N* an! I#4+N+L:JL>+B. <. What is a trace file an! how it is create! ? +ach server an! ackgroun! process can write an associate! trace file. When an internal error is !etecte! y a process or user process, it !umps information aout the error to its trace. This can e use! for tuning the !ataase. + in init.ora file tart up the !ataase E. @ow can we specify the :rchive! log file name format an! !estination ? 9y setting the following values in init.ora file IO*L:B4@#K+L8OB:T archU2s2T2t.arc /U % Iog sequence numer an! is )ero left%pa!e!, Us % Iog sequence numer not pa!e!, UT % Threa! numer left%)ero%pa!e! an! Ut % Threa! numer not pa!e!0. The file name create! is archEEE-.arc U is use!. IO*L:B4@#+K+L7+T path Page 54 of 74
hut the !ataase an! change these parameters in init.ora files. -. What is the user of :N:I&P+ comman! ? To perform one of these function on an in!e3, tale, or cluster $ to collect statistics aout oect use! y the optimi)er an! store them in the !ata !ictionary. to !elete statistics aout the oect from the !ata !ictionary to vali!ate the structure of the oect to i!entify migrate! an! chaine! rows of the tale or cluster. 6.< anaging 7istriute! 7ataases 1. @ow can we re!uce the network traffic ? Beplication of !ata in !istriute! environment >sing snapshots to replicate !ata >sing remote proce!ure calls. 6. What is a snapshot ? napshot is an oect use! to !ynamically replicate !ata etween !istriute! !ataases at specifie! time intervals. #n ver A.E they are rea! only. ;. What are the various type of snapshots ? imple an! 4omple3. <. 7ifferentiative simple an! comple3, snapshots : simple snapshot is ase! on a query that !oes not contains *BO>( 9& clauses, 4ONN+4T y clauses, =O#Ns, uquery or a set of operations. : comple3 snapshots contain at least any one of the aove. . What is !ynamic !ata replication ? >p!ating or inserting recor!s in remote !ataase through !ataase triggers. #t may fail if remote !ataase is having any prolem. A. @ow can you enforce referential integrity in snapshots ? Time the references to occur when master tales are not in use. (erform the references manually imme!iately after locking the master tales. We can oin tales in snapshots y creating a comple3 snapshot that will e ase! on the master tales. C. What are the options availale to refresh snapshots ? 4O(I+T+ % Tales are completely regenerate! using the snapshot's query an! the master tales every time the snapshot reference!. 8:T % #f simple snapshot use! then a snapshot log can e use! to sen! only the changes to the snapshot tales. 8OB4+ % The !efault value. #f possile it performs a 8:T refresh Otherwise it will perform a 4O(I+T+ refresh. D. What is a snapshot tag ? #t is a tale that maintains a recor! of mo!ifications to the master tale in a snapshot. #t is store! in the same !ataase as master tale an! is only availale for simple snapshots. #t shoul! e create! efore creating snapshots. AE. When will the !ata in the snapshot log e use! ? The !ata in the snapshot log is use! !uring fast references of the tale's snapshots. A-. What are the pre%requisites to create a snapshot log ? We must e ale to create a after row trigger on tale /i.e. it shoul! not e alrea!y availale0 :fter giving tale previleges. We cannot specify snapshot log name ecause oracle uses the name of the master tale in the name of the !ataase oects that support its snapshot log. Page 55 of 74
The master tale name shoul! e less than or equal to 16 characters. /The tale name create! will e IO*MLtalename, an! trigger name will e TIO*MLtalename0 A1. What are the enefits of !istriute! options in !ataases ? 7ataase on other servers can e up!ate! an! those transactions can e groupe! together with others in a logical unit. 7ataase uses a two phase commit A6. What is a two%phase commit ? 7ataase on other servers can e up!ate! an! those transactions can e groupe! together with others in a logical unit is calle! two%phase commit. They are The (reparation (hase $ :n initiating no!e calle! the gloal coor!inator notifies all sites involve! in the transaction to e rea!y either commit or rollack the transaction. The 4ommit (hase $ #f there is no prolem with prepare phase, then all sites commit their transactions. #f a network or no!e failure occurs, then all sites rollack their transactions. 6. anaging 9ackup Q Becovery A;. What are the !ifferent metho!s of acking up oracle !ataase ? Iogical 9ackups 4ol! 9ackups @ot 9ackups /:rchive log0 A<. What is a logical ackup ? Iogical ackup involves rea!ing a set of !ataase recor!s an! writing them into a file. +3port utility is use! for taking ackup an! #mport utility is use! to recover from ackup. A. What is col! ackup ? What are the elements of it ? 4ol! ackup is taking ackup of all physical files after normal shut!own of !ataase. We nee! to take :ll 7ata files :ll 4ontrol files :ll on%line re!o log files Then init.ora file /optional0 AA. What are the !ifferent kin! of e3port ackups ? 8ull ackup % 4omplete !ataase #ncremental 9ackup % Only affecte! tales from last incremental !ate 2 8ull ackup !ate 4umulative ackup % Only affecte! tale from the last cumulative !ate 2 8ull ackup !ate AC. What is hot ackup an! how it can e taken ? Taking ackup of archive log files when !ataase is open. 8or this the :B4@#K+IO* mo!e shoul! e enale!. The following files nee! to e acke! up $ :ll !ata files :ll archive log, re!o log files On control file. AD. What is the use of 8#I+ option in +J( comman! ? To give the e3port file name. CE. What is the use of 4O(B+ option in +J( comman! ? 8lag to in!icate whether e3port shoul! compress fragmente! segments into single e3tents. C-. What is the use of *B:NT option in +J( comman! ? : flag to in!icate whether grants on !ataase oects will e e3porte! or not. Kalues is '&' or 'N'. Page 56 of 74
C1. What is the use of #N7+J+ option in +J( comman! ? : flag to in!icate whether in!e3es on tales will e e3porte!. C6. What is use of BOW option in +J( comman! ? 8lag to in!icate whether tale rows shoul! e e3porte!. #f 'N' only 77I statements for the !ataase oects will e create!. C;. What is the use of 4ONTB:#NT option in +J( comman! ? : flag to in!icate whether constraints on tale nee! to e e3porte!. C<. What is the use of 8>II option in +J( comman! ? : flag to in!icate whether full !ataase e3port shoul! e performe!. C. What is the use of OWN+B option in +J( comman! ? Iist of tale accounts shoul! e e3porte!. CA. What is the use of T:9I+ option in +J( comman! ? Iist of tales shoul! e e3porte!. CC. What is use of B+4OB7 I+N*T@ option in +J( comman! ? Becor! length in ytes. CD. What is use of #N4T&(+ option in +J( comman! ? Type e3port shoul! e performe!. 4O(I+T+, 4>>I:T#K+, #N4B++NT:I DE. What is use of B+4OB7 option in +J( comman! ? 8or incremental e3ports, the flag in!icates whether a recor! will e store! in !ata !ictionary tales recor!ing the e3port. D-. What is the use of (:B8#I+ option in +J( comman! ? Name of the parameter file to passe! for e3port. D1. What is the use of :N:I&+ /Ker A0 option in +J( comman! ? : flag to in!icate whether statistical information aout the e3porte! oects shoul! e written to e3port !ump file. D6. What is use of 4ON#T+NT /Ker A0 option in +J( comman! ? : flag to in!icate whether a rea! consistent version of all the e3porte! oects shoul! e maintaine!. D;. What is the use of Iog /Ker A0 option in +J( comman! ? The name of file to which log of the e3port will e written. D<. What is use of 8#I+ option in #( comman! ? The name of file from which import shoul! e performe!. D. What is the use of @OW option in #( comman! ? : flag to in!icate whether file content shoul! e !isplaye! or not. DA. What is the use of #*NOB+ option in #( comman! ? : flag to in!icate whether import shoul! ignore errors encounter when issuing 4B+:T+ comman!. DC. What is the use of *B:NT option in #( comman! ? Page 57 of 74
: flag to in!icate whether grants on !ataase oects will e importe!. DD. What is use of #N7+J+ option in #( comman! ? : flag to in!icate whether import shoul! import in!e3 on tales or not. -EE. What is use of BOW option in #( comman! ? : flag to in!icate whether rows shoul! e importe!. # f this is set to 'N' then only 77I for the !ataase oects will e e3ecute! ? -E-. What is the use of 8>II option in #( comman! ? : flag to in!icate whether full import shoul! e !one or not. -E1. What is the use of 8BO>+B option in #( comman! ? : list of !ataase accounts whose oects shoul! e rea! from the e3port !ump file. -E6. What is use of TO>+B option in #( comman! ? : list of !ataase accounts into which oects in the e3port !ump file will e importe! -E;. What is use of T:9I+ option in #( comman! ? : list of tales to e importe!. -E<. What is use of B+4OB7I+N*T@ option in #( comman! ? The length of the recor! in ytes of the e3port !ump file. -E. What is use of #N4T&(+ option in the #( comman! ? The type of import eing performe!. -EA. What is use of 4O#T option in #( comman! ? : flag to in!icate whether import shoul! commit after each array. #f 'N' then commit will take place at tale level -EC. What is use of (:B8#I+ option in #( comman! ? Name of the parameter file to passe! for import comman!. -ED. What is use of #N7+J8#I+ option in #( comman! ? #f filename is given then all the 77I will e create! in the given file. --E. What is use of 7+TBO& /Ker A0 option in #( comman! ? : flag to in!icate whether the create talespace comman! foun! in !ump files from full e3ports will e e3ecute!. ---. What is use of IO* option in #( comman! ? Name of the file to which the log of the import will e written. --1. 4onsi!er a case elow $ >ser is taking the ackup in the following fashion $ Type 8 # # # # 4 # # # # 4 # # 7ate - 1 6 ; < A C D -E -- -1 -6 8 % 8ull 9ackup # % #ncremental 9ackup 4 % 4umulative 9ackup uppose !ataase crash on -;th morning. @ow can we retrieve the !ataase ? 4reate the !ataase #mport from the 8ull ackup which was taken on -st Page 58 of 74
#mport from 4umulative ackups which was taken on th #mport from 4umulative ackups which was taken on -th #mport from the #ncremental ackups -1,-6 respectively. Now the !ataase will e availale to latest status provi!e! there is no transaction taken place after the -6th incremental ackup. --6. Iist the steps to restore the !ataase if !ata file lost. /:ssume we are taking hot ackups0 4opy the lost file from the ackup to the original location tart the instance ount the !ataase Becover the !ataase using recover !ataase comman! Open the !ataase --;. What are the points to e taken care when we are using IIoa!er for importing !ata from flat files ? Whether tale an! in!e3es are properly si)e!. 7irect option eing use! or not /Ker A0 #f one time loa! !o not create any in!e3 until !ata has een loa!e! an! tale si)e is verifie!. --<. What are the a!vantages of using !irect path option in IIoa!er ? #t ypasses the normal processing of insert statements an! instea! writes !irectly to tales !ata locks. When !irect option is use! in!e3 ecome invali! an! once the loa! complete the new key is merge! with all ol! one an! ring the status to vali!. 7ata shoul! e presorte! otherwise it nee!s the !oule the si)e in talespace. --. What are areas a 79: can monitor the !ataase using I79: comman!? 79: can monitor the following areas to !o fine tuning of the !ataase $ (rocesses essions Tales/Iocks etc0 I :rea Iirary 4ache Iatch Iocks 8ile #2O ystem #2O Bollack egments tatistics /ystem, essions0 :part from this all 79: activities can e performe! through I79: comman!. 77+ bK OI+ 77+ % 7ynamic 7ata +3change. 7II % 7ynamic Iink Iirary OI+ % Oect Iinking an! +me!!ing. :(# bK essaging :pplication (rogram #nterface What is 77+ ? 77+ is metho! for #nter (rocess 4ommunication. :n inter process communication is a metho! of passing !ata etween processes an! synchronising events. @ow !oes 77+ work ? 77+ uses share! memory to e3change !ata an! a protocol to synchroni)e passing of !ata. What !oes a 7II contain ? : 7II contains co!e, !ata an! win!ows resources. @ow !oes a 7II work ? Page 59 of 74
: 7II allocates a gloal memory lock to an application an! uses this to e3change !ata with application. What are the two types of 77+ application ? essage ase! 77+ applications an! 7ynamic 7ata +3change anagement Iirary application. What are the parts of a 77+ application ? 4lient application, erver application, 4lient2erver application an! onitor application. What is a monitor application in the conte3t of 77+ ? : monitor application can only intercept messages ut cannot act on it. What is the use of a monitor application ? : monitor application can e use! as a !eugging tool. What is the connection etween OI+ an! 77+ ? OI+ is a set of 77+ e3ecutale comman!s to which 77+ protocol is applicale. What is the !ifference etween an eme!!e! oect an! a linke! oect ? :n eme!!e! oect is store! in the !ocument itself while the !ocument ust stores a reference to the linke! oect. #f a link oect is change! in!epen!ently of the !ocument, wht happens the linke! oect in the !ocument ? -. The reference oect is automatically refreshe! 1. The reference oect is not refreshe! 6. The user !eci!es whether the oect is to refreshe! or if the ol!er version is retaine!. :nswer is 1 What are the types of OI+ applications ? 4lient, erver an! Oect han!lers. What is an oect han!ler ? :n Oect han!ler is a set of 7II that facilitate communication etween client application an! server application. What are the a!vantages of OI+ ? No nee! to switch etween applications. 8a cilitate the use of speciali)e! applications to create oects which can e eme!!e!. What is the !ifference etween a store! proce!ure an! a !ataase trigger ? : trigger is automatically e3ecute! when the firing event occurs while store! proce!ure has to e invoke!. Oracle )or*s:
-. @ow to use single !ata lock to query multiple tales 1. @ow to see the select statement when we issue e3ecuteLquery 6. What are the system variales can e change! ;. @ow !o you trap !efault forms processing / 7I0 <. What is the !ifference etween post%query an! post%select . What is purpose an! or!er of firing the following triggers -. on fetch 1. on select A. What is the numer of recor!s uffere! an! uery array si)e properties of !ata lock C. What is the !ifference etween oect liraries an! oect groups D. What is the !ifference etween pre%query an! pre%select triggers -E. What is the !ifference etween pre%te3t%item an! when%new%item%instance triggers --. What is the or!er of firing the following triggers -. when%new%form%instance Page 60 of 74
1. pre%te3t%item /9oth are in form%level0 -1. What is the vali!ation unit property of form mo!ule -6. What is the or!er of checking for a program unit from form mo!ule/local program unit, lirary, store! proce!ure0 -;. What is the !ifference etween (I2I lirary an! oect lirary -<. what is the use of pre te3t2pre recor!2pre form -. types of recor! groups an! usage -A. what is i!Lnull function -C. what is the return !ata types of i!Lnull, showLalert, showLlov -D. what is the !ifference etween callLform , openLform, newLform Which is restricte! uilt%in an! why? Which canbt issue savepoint What is session parameter of openLform? 1E. which are the triggers will fire in the following situation # have three te3t items -. Te3t%item-.key%ne3t%item *oLitem /bdte3tLitem1b0 *oLitem /bdte3tLitem6b0 1. Te3t%item1 -. (re%te3t%item 1. When%vali!ate%item 6. When%new%item%instance ;. Fey%ne3t%item <. (ost%te3t%item . (ost%change 6. Te3t%item6 -. (re%te3t%item 1. When%vali!ate%item 6. When%new%item%instance ;. Fey%ne3t%item <. (ost%te3t%item . (ost%change #f # press ta or enter key at te3t%item- what are the triggers will fire an! or!er of firing !uring the entire navigation. #f # change key%ne3t%item trigger of te3t%item*oLitem /bdte3tLitem1b0 $ Te3tLitem1$ bdNagen!rab *oLitem /bdte3tLitem6b0 Then what are the triggers will fire an! or!er of firing 1-. What is synchronous an! asynchronous parameters for runLpro!uct uilt%in 11. @ow !o you suppress the logon screen while running the form for the first time 16. What is primary canvas property of win!ow an! where it will e useful 1;. # have when%utton%presse! trigger at form , lock an! item level #f # want to e3ecute first lock, form then item level trigger what changes # have to make. 1<. what is !ata parameter an! te3t parameter 1. 4an we re%generate a lirary that is currently accessing y some other session 1A. 4an we re%generate an! save a lirary that has een attache! with some forms ut they are running currently. 1C. 4an we re%generate a lirary that has een attache! with some forms , will the changes will reflect in the reference! forms 1D. What is the use of transactional triggers 6E. 4an we mo!ify a su classe! oect / from oect group an! from oect liraries0 6-. @ow to set forms !efault !irectory 61. What is the return !ata type of populateLgroup uilt%in 66. What is the !ifference etween OI+ oect create! at !esign time an! runtime 6;. Will the timer will e3pire !uring large query e3ecuting 6<. What is the uilt%in package availale to manipulate te3t files/ forms0 6. 4an we !efine a relation etween two control locks Page 61 of 74
6A. #f we change relation property from non%isolate! to casca!ing what changes will occur 6C. What is the coor!ination property of a relation 6D. #f we !elete on%clear%!etails trigger in a relation what happens ;E. What is the first trigger fires when we run a form ;-. What is the use of enforce primary key property of !ata lock ;1. 4an we put items other than uttons in the toolars ;6. Which oect relates content an! stacke! canvases/win!ow0 ;;. @ow to navigate from one form to other form/uilt%in0 ;<. @ow to copy values from list item to recor! group ;. #n a non%isolate! relation what is the or!er of firing the following triggers -. on%populate%!etails 1. on%clear%!etails 6. pre%query ;. pre%select ;A. @ow to fin! out the previous form i! in multi form application/itbs system variale0 ;C. @ow to use single IOK for multiple items Oracle reports:
-. inimum requirement to make a matri3 report /ueries, *roups an! Bepeating frames0 1. @ow to change the font of an fiel! at runtime ase! on the value 6. What is the anchoring an! enclosing oect ;. What is anchor oect <. @ow to rotate a fiel!/ !ata ase fiel! in the layout0 . What is the !ifference etween le3ical an! in! parameters A. What is the place hol!er C. What is the use of frame/not repeating0 D. What is the use of format triggers -E. BW package --. What is fle3 mo!e an! confine mo!e -1. what !ifference etween the logical an! physical pages an! planes -6. what is the use of group filter SQL an+ PL/SQL
-. ueries for Nth ma3imum ,Nth row 1. what is use of the in!e3 / ma3imum try to cover0 6. elect the !epartments whose sum of the salary greater than the sum of salaries of any !epartment? ;. What is implicit cursors <. What is pulic synonyms an! uses . When in!e3 will e use! in the query A. What is the result of the following queries -. elect from emp where 4omm in /null0 1. elect from emp where 4omm null 6. elect from emp where 4omm bdb ;. elect from emp where 4omm is / select null from !ual0 C. uery to !isplay employee name an! his managers name D. uery to fin! the employees who is having more then one suor!inate -E. uery to fin! the employees whose salary is greater then his !epartment average salary --. uery to !isplay employees salary as 1EEE for !epartment 1E an! rest as their salaries -1. uery to !isplay no of employees in the !epartment -E, 1E,6E in a single row Output 7ept-E !ept1E !ept6E 1< -6. uery to fin! the no of suor!inate levels for given manager -;. uery to fin! the no of employees who is !rawing less than -
-. what are the physical !ataase components 1. what are the logical !ataase components 6. what is row chaining ;. what is the relation etween oracle !ata lock ,e3tents an! segments Page 62 of 74
<. how many types of segments are there . what is temporary segments A. what is re!o log C. what is the !ifference etween rollack segments an! re!o log files D. what is the !ifference etween !ataase uffers an! re!o log uffer of *: -E. -0 @ow !elete !uplicate recor!s in a tale !elete from emp where rowi! not in /select ma3/rowi!0 from emp group y empno0 10 @ow to make a column into not null column. :ns$ alter tale emp mo!ify /empno not null0 %Sthis can e !one only when all the values in empno are non null /i.e not empty0 ?h To make a not null column into null column alter tale emp mo!ify /empno null0 The fallowing are the rules for i. a!!ing null or not null property S&ou may change a columnbs null property to not null only when that fiel! !oes contain null values/i. #t canbt e empty0 S:t any time you may change a columnbs not null property to null ii. a!!ing a colum to a tale S&ou may a!! a column at any time if NOT N>II isnbt specifie! /i.e when new column can accept null values 0 S&ou may a!! a NOT N>II column in three steps. a. :!! the column without NOT N>II specifie!. . 8ill every row in that column with !ata. c. o!ify the column to e NOT N>II. iii. mo!ifying a column S&ou can increase a 4@:B columnbds wi!th at any time. S&ou can increase the numer of !igits an! the numer of !ecimal places in a N>9+B column at any time STo 4@:N*+ !ata types or to 7+4B+:+ columnbs wi!th the column shoul! e null for every row 60Write queries for the fallowing e3. select from empLself +(LNO +(NLN:+ :I *B 7+(T#7 %%%%%%%%% %%%%%%%%%%%%%%%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%%% ;EE ane 1EEEE --E 1E -E1 ary -DEEE --E 1E -E- charles CEEE -E<
select a.!epti!,min/a. sal0 from empLself a where - in /select count/0 from empLself where a.sal R .sal group y .!epti!0 group y a.!epti! 7+(T#7 #N/:.:I0 %%%%%%% %%%%%%%%%% -E DEEE 1E 1EEEE T parameter from a proce!ure ?. --07ifferences etween BOWN> an! BOW#7 . -10@ow !o you han!le e3ceptions ?. -10@ow many system !efine! e3ceptions are there ?. -60@ow !o you write user !efine! message for all the system !efine! e3ceptions. -;07ifference etween 4ommit an! @/?0ost . -<07ifferences etween !elete ,truncate an! !rop comman!s . -0 @ow !o you !isplay messages in the acken! proce!ure ?. -A0 why canbt you use create2!rop while !eclaring a trigger ?. -C0:!vantages of union over oins . Page 64 of 74
-D07efinitions of commit, rollack, save point 1E07ifference etween truncate an! !elete /truncate !elete 5 commit0 -0Name the five gloal report triggers i. efore report ii. after report iii. etween pages iv. efore parameter form v.after parameter form :s a general rule, any processing that will affect the !ata retrieve! y the report shoul! e performe! in the 9efore (arameter 8orm or :fter (arameter 8orm triggers. /These are the two report triggers that fire efore anything is parse! or fetche!.0 :ny processing that will not affect the !ata retrieve! y the report can e performe! in the other triggers. Beport 9uil!er has five gloal report triggers. &ou cannot create new gloal report triggers. The trigger names in!icate at what point the trigger fires$ 9efore Beport 8ires efore the report is e3ecute! ut after queries are parse!. :fter Beport 8ires after you e3it the (reviewer, or after report output is sent to a specifie! !estination, such as a file, a printer, or an Oracle Office useri!. This trigger can e use! to clean up any initial processing that was !one, such as !eleting tales. Note, however, that this trigger always fires, whether or not your report complete! successfully. 9etween (ages 8ires efore each page of the report is formatte!, e3cept the very first page. This trigger can e use! for customi)e! page formatting. #n the (reviewer, this trigger only fires the first time that you go to a page. #f you susequently return to the page, the trigger !oes not fire again. 9efore (arameter 8orm 8ires efore the Buntime (arameter 8orm is !isplaye!. 8rom this trigger, you can access an! change the values of parameters, (I2I gloal variales, an! report%level columns. #f the Buntime (arameter 8orm is suppresse!, this trigger still fires. 4onsequently, you can use this trigger for vali!ation of comman! line parameters. :fter (arameter 8orm 8ires after the Buntime (arameter 8orm is !isplaye!. 8rom this trigger, you can access parameters an! check their values. This trigger can also e use! to change parameter values or, if an error occurs, return to the Buntime (arameter 8orm. 4olumns from the !ata mo!el are not accessile from this trigger. #f the Buntime (arameter 8orm is suppresse!, the :fter (arameter 8orm trigger still fires. 4onsequently, you can use this trigger for vali!ation of comman! line parameters or other !ata. 10 Name the !ifferent types of alerts note , stop ,caution 60callLform / 0, newLform / 0 callLform / 0 $%Buns an in!icate! form while keeping the parent form active. 8orm 9uil!er runs the calle! form with the same Bunform preferences as the parent form. When the calle! form is e3ite! 8orm 9uil!er processing resumes in the calling form at the point from which you initiate! the call to 4:IIL8OB. (BO4+7>B+ 4:IIL8OB /formmo!uleLname K:B4@:B10 NewLform/ 0 $% +3its the current form an! enters the in!icate! form. The calling form is terminate! as the parent form. #f the calling form ha! een calle! y a higher form, 8orm 9uil!er keeps the higher call active an! treats it as a call to the new form. 8orm 9uil!er releases memory /such as !ataase cursors0 that the terminate! form was using. 8orm 9uil!er runs the new form with the same Bunform options as the parent form. #f the parent form was a calle! form, 8orm 9uil!er runs the new form with the same options as the parent form. (BO4+7>B+ N+WL8OB /formmo!uleLname K:B4@:B10 ;0 system.mo!e%S &T+.O7+ in!icates whether the form is in Normal, +nter uery, or 8etch (rocessing mo!e. The value is always a character string. NOB:I #n!icates that the form is currently in normal processing mo!e. +NT+B%>+B& #n!icates that the form is currently in +nter uery mo!e. >+B& #n!icates that the form is currently in fetch processing mo!e, meaning that a query is currently eing processe!. >sage Notes When using &T+.O7+ to check whether the current lock is in +nter uery mo!e, e aware that if testing from a When%9utton%(resse! trigger in a control lock, +nter uery mo!e will never e entere!, ecause the control lock is not the current lock. Page 65 of 74
;0What are important new/:!vance!0 features of 8orms .E. <07ifferent types of list o3es. 0What are recor! groups ?. A0#n case of a lock with multiple recor!s how to !isplay recor!s on the screen without using cursors ?. C04an we access a row in the first lock from secon! y referencing lock name along with the rowi! ?. D0#n case of a lock with multiple recor!s how !o check where a user entering a !uplicate recor! well efore saving it ?. -E0@ow to take care of concurrency ?. -. What is the si)e of Karchar in Oracle C.E ? a. 1EEE . ;EEE c. 1<; !. none of the aove 1. What is the si)e of Karchar in Oracle A.E ? a. 1EEE . ;EEE c. 1<; !. none of the aove 6. The !efault value the lpa! function takes is a. a space /b b0 . an asterisk c. The !efault value is not optional !. None of the aove ;. The no. of columns that may e use! as composite primary key in oracle C a. C . - c. 61 !. none of the aove <. which of the following is true aout a!!Lmonths a. we can pass a numerical value in first parameter . we can pass a negative value in secon! parameter c. 9oth a Q !. None of the aove . The latest !ate that can e store! in oracle C a. 6-st 7ec ;E-1 :.7 . 6-st 7ec ;E-- :.7 c. 7ec 6-st ,DDDD !. None of the aove. A. What happens when the first !ate is greater than the secon! !ate that is passe! to the monthsLetween function in oracle C. a. #t gives an error . #t gives a negative value c. None of the aove C. Begar!ing the ummary query which of the following is true a. The or!er of the ase column list in the select statement shoul! e same in the *roup y clause. . The or!er of the ase column list in the select statement nee! not e same in the *roup y clause. c. None of the aove D. Begar!ing the ummary query which of the following is true a. :ll the ase tale columns selecte! in the select list shoul! e specifie! in the *roup y clause. . :ll the ase tale columns selecte! in the select list nee! not e specifie! in the *roup y clause. c. None of the aove. -E. @ow !o u mask the user from entering irrelevant !ata ? a. ynonym . Kiew c. #n!e3 !. sequence --. What !oes the length function returns when applie! to column of char !atatype ? -1. Which of the following is true aout the packages ? a. (ackage specification shoul! contain return type of a function . (ackage specification nee! not contain return type of a function c. 9oth a Q !. None of the aove -6. #f the first parameter is negative, then secon! parameter a. nee! not e negative . there is no such restrictions c. shoul! e positive Page 66 of 74
!. None of the aove. -;. Which of the following is true aout proce!ures a. The si)e of the parameter shoul! e mentione! in a proce!ure. . The si)e of the parameter shoul! not e mentione! in a proce!ure c. 9oth a Q !. None of the aove. -<. bB+8+B+N4#N*b in oracle C a. use! to mention referential integrity . use! for creating views c. there is no such wor! in oracle C !. none of the aove -. #f you want to restrict the user, to enter the same values that has een store! in other tale then what constraint !o u use? a. +ntity integrity . Beferential #ntegrity c. 9oth a Q !. None of the aove -A. Which of the following is true aout N>II? a. when an arithmetic operation is performe! on N>II, u will get the result as N>II . N>II is same as E. c. N>II is same as lank !ate. !. None of the aove -C. 8or a 77I statement, which of the following is true a. : 77I statement is prece!e! an! followe! y commit. . :ll the 7I statements gets committe! even when u get an error after writing 77I statement. c. 9oth a Q !. None of the aove. -D. Which of the following is true for up!ate clause? a. We can up!ate two ase tales simultaneously . > can use a suquery in +T clause of the >(7:T+ statement. c. 9oth a Q !. None of the aove 1E. Which of the following is true for !elete? a. 7elete statement can e given without writing where clause. . We can !elete two tales simultaneously c. 9oth a Q !. None of the aove 1-. @ow !o u rename a tale ? a. >sing alter comman! . >sing B+N:+ c. 7ropping the tale an! creating once again !. None of the aove. 11. #n oracle A which of the following is true aout manipulating the view a. Kiew ase! on two ase tales can e manipulate! . Kiew having a column which contain operation can e manipulate! c. 9oth a Q !. None of the aove 16. #n oracle C which of the following is true aout manipulating the view a. Kiew ase! on two ase tales can e manipulate! . Kiew having a column which contain operation can e manipulate! c. 9oth a Q !. None of the aove 1;. Which of the following is true aout packages a. We can write a proce!ure in package o!y which has not een specifie! in package specification. . We cannot write a proce!ure in package o!y which has not een specifie! in package specification. c. 9oth a Q !. None of the aove. 1<. Which of the following is true aout outer oins a. The outer oin symol shoul! e present on any one si!e of the oin. . The outer oin symol may e present on oth the si!es of the oin c. The outer oin return the rows from the two tales that !onot have matching recor!s in other tale. !. None of the aove 1. Which of the following is true aout proce!ure an! a function a. (roce!ure shoul! return a value an! a function may not return a value . : function has to return a value an! a proce!ure !onbt have to c. 9oth a Q Page 67 of 74
!. None of the aove. 1A. What !oes O8: stan!s for ? a. Oracle 8le3ile :rchitecture . Oracle 8inancials :pplications c. Optimal 8le3ile :rchitecture !. None of the aove Oracle uestions ?h What is I(lus an! where !oes it come from? ?h @ow !oes one use the I(lus utility? ?h What comman!s can e e3ecute! from I(lus? ?h What are the asic I(lus comman!s? ?h What is :8#+7T.9>8? ?h @ow !oes one restore session state in I(lus? ?h What is the !ifference etween H an! HH? ?h What is the !ifference etween Q an! QQ? ?h What is the !ifference etween V an! @OT? ?h What is the !ifference etween ? an! @+I(? ?h @ow !oes one enale the I(lus @+I( facility? ?h @ow can one !isale I(lus prompting? ?h @ow can one trap errors in I(lus? ?h @ow !oes one trace I statement e3ecution? ?h @ow can one prevent I(lus connection warning messages? ?h @ow can uses e prevente! from e3ecuting !evious comman!s? ?h @ow can one !isale I(lus formatting? ?h 4an one sen! operating system parameters to I(lus? ?h 4an one copy tales with ION* columns from one !ataase to another? ?h Where can one get more info aout I(lus? What is I(lus an! where !oes it come from? I(lus is a comman! line I an! (I2I language interface an! reporting tool that ships with the Oracle 7ataase 4lient an! erver. #t can e use! interactively or !riven from scripts. I(lus is frequently use! y 79:s an! 7evelopers to interact with the Oracle !ataase. I(lus's pre!ecessor was calle! >8# />ser 8rien!ly #nterf ace0. >8# was inclu!e! in the first releases of Oracle, its interface was e3tremely primitive an! anything ut user frien!ly. @ow !oes one use the I(lus utility? tart using I(lus y e3ecuting the "sqlplus" comman!%line utility. Kali! options are$ useri!2passwor!H! %% 4onnection !etails 2nolog %% 7o not login to Oracle. &ou will nee! to !o it yourself. %s or %silent %% start sqlplus in silent mo!e. Not recommen!e! for eginnersV Hmyscript %% tart e3ecuting script calle! "myscript" Iook at this simple e3ample$ sqlplus 2nolog IS connect scott2tiger IS select from ta IS !isconnect IS e3it What comman!s can e e3ecute! from I(lus? One can enter three kin!s of comman!s from the I(lus comman! prompt$ -. I(lus comman!s % I(lus comman!s are use! to set options for I(lus, format reports, e!it files, e!it the comman! uffer, an! so on. I(lus comman!s !o not interact with the !ataase. These comman!s !o not have to e terminate! with a semicolon /0, as is the case with I comman!s. The rest of this page is !e!icate! to I(lus comman!s, eg. @OW >+B 1. I comman!s % for more information see the Oracle I 8:. +g$ +I+4T 8BO T:9 6. (I2I locks % for more information see the Oracle (II 8:. +g$ 9+*#N 79LO>T(>T.(>TLI#N+/'@ello Worl!V'0 +N7 2 What are the asic I(lus comman!s? The following I(lus comman!s are availale$ :44+(T *et input from the user 7+8#N+ 7eclare a variale /short$ 7+80 7+4B#9+ Iists the attriutes of tales an! other oects /short$ 7+40 Page 68 of 74
+7#T (laces you in an e!itor so you can e!it a I comman! /short$ +70 +J#T or >#T 7isconnect from the !ataase an! terminate I(lus *+T Betrieves a I file an! places it into the I uffer @OT #ssue an operating system comman! /short$ V0 I#T 7isplays the last comman! e3ecute!2 comman! in the I uffer /short$ I0 (BO(T 7isplay a te3t string on the screen. +g prompt @ello Worl!VVV B>N Iist an! Bun the comman! store! in the I uffer /short$ 20 :K+ aves comman! in the I uffer to a file. +g "save 3" will create a script file calle! 3.sql +T o!ify the I(lus environment eg. +T (:*+#P+ 16 @OW how environment settings /short$ @O0. +g @OW :II, @O (:*+#P+ etc. (OOI en! output to a file. +g "spool 3" will save T7O>T to a file calle! 3.lst T:BT Bun a I script file /short$ H0 @ow !oes one restore session state in I(lus? Iook at the following e3ample /OracleC0$ IS TOB+ +T filename B+(I:4+ IS /!o whatever you like0 IS Hfilename What is :8#+7T.9>8? :8#+7T.9>8 is the I(lus !efault e!it save file. When you issue the comman! "e!" or "e!it" without arguments, the last I or (I2I comman! will e save! to a file calle! :8#+7T.9>8 an! opene! in the !efault e!itor. #n the prehistoric !ays when I(lus was calle! >8#, the file name was "ufie!t.uf", short for >8# e!iting uffer. When new features were a!!e! to >8#, it was the initially name! :!vance! >8# an! the filename was change! to "aufie!t.uf" an! then to "afie!t.uf". They presumaly nee!e! to keep the name short for compatiility with some of the o!! operating systems that Oracle supporte! in those !ays. The name ":!vance! >8#" was never use! officially, as the name was change! to I(lus efore this version was release!. &ou can overwrite the !efault e!it save file name like this$ +T +7#T8#I+ "afie!t.uf" What is the !ifference etween H an! HH? The H /at symol0 is equivalent to the T:BT comman! an! is use! to run I(lus comman! scripts. : single H symol runs the script in your current !irectory, or one specifie! with a full or relative path, or one that is foun! in you I(:T@ or OB:4I+L(:T@. HH will start a sqlplus script that is in the same !irectory as the script that calle! it /relative to the !irectory of the current script0. This is normally use! for neste! comman! files. What is the !ifference etween Q an! QQ? "Q" is use! to create a temporary sustitution variale an! will prompt you for a value every time it is reference!. "QQ" is use! to create a permanent sustitution variale as with the 7+8#N+ comman! an! the OI7LK:I>+ or N+WLK:I>+ clauses of a 4OI>N statement. Once you have e ntere! a value it will use that value every time the variale is reference!. +g$ IS +I+4T 8BO T:9 W@+B+ TN:+ I#F+ 'UQT:9I+LN:+.U' What is the !ifference etween V an! @OT? 9oth "V" an! "@OT" will e3ecute operating system comman!s as chil! processes of I(lus. The !ifference is that "@OT" will perform variale sustitution /Q an! QQ symols0, whereas "V" will not. /Note$ use "M" un!er K, K, an! Win!ows environments, not "V"0 What is the !ifference etween ? an! @+I(? There is no !ifference. 9oth "?" an! @+I( will rea! the &T+.@+I( tale /if availale0 an! shows help te3t on the screen. To use the help facility, type @+I( followe! y the comman! you nee! to learn more aout. 8or e3ample, to get help on the +I+4T statement, type$ @+I( +I+4T @ow !oes one enale the I(lus @+I( facility? To enale @+I( for l(lus, run the supplie! I an! Ioa!er scritps to create the @elp tale an! to populate it. Iook at this >ni3 e3ample$ c! MOB:4I+L@O+2sqlplus2a!min2help sqlplus system2manager Hhelptl sqlplus system2manager Hhelpin!3 sqll!r system2manager controlplushelp.ctl sqll!r system2manager controlsqlhelp.ctl sqll!r system2manager controlplshelp.ctl #f the @+I( comman! is not supporte! on your operating system, you can access the help tale with a simple script like this$ @+I(.I$ select info from system.help Page 69 of 74
where upper/topic0upper/'Q-'0 2 @ow can one !isale I(lus prompting? #f you run a script that contains "Q" symols I(lus thinks that you want to prom pt the user for a value. To turn this off$ +T +4:(+ ON +T +4:(+ "" +I+4T '&ou Q me' 8BO 7>:I or +T 7+8#N+ ? +I+4T '&ou Q me' 8BO 7>:I Note$ &ou can !isale sustitution variale p rompting altogether y issuing the +T 7+8#N+ O88 commman!. @ow can one trap errors in I(lus? >se the "W@+N+K+B O+BBOB ..." to trap operating system errors an! the "W@+N+K+B I+BBOB ..." comman! to trap I an! (I2I errors. +g$ IS W@+N+K+B O+BBOB +J#T D IS W@+N+K+B I+BBOB +J#T I.I4O7+ @ow !oes one trace I statement e3ecution? -. Bun the (I>TB4+.I script from the & !ataase user. This script is locate! the in MOB:4I+L@O+2sqlplus2a!min. 1. 4reate a (I:NLT:9I+ using the >TIJ(I:N.I script. This script is in MOB:4I+L@O+2r!ms2a!min. 6. >se the "+T :>TOTB:4+ ON" comman! to trace I e3ecution. This will print the result of your query, an e3plain plan an! high level trace information. Iook at this e3ample$ IS set autotrace on IS select from !ual 7 % J +3ecution (lan %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% E +I+4T T:T++NT Optimi)er4@OO+ - E T:9I+ :44+ /8>II0 O8 '7>:I' tatistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% E recursive calls 1 ! lock gets - consistent gets E physical rea!s E re!o si)e -C- ytes sent via INet to client 1< ytes receive! via INet from client 6 INet roun!trips to2from client E sorts /memory0 E sorts /!isk0 - rows processe! @ow can one prevent I(lus connection warning messages? When # go to l(lus, # get the following errors$ +rror accessing (BO7>4TL>+BL(BO8#I+ Warning$ (ro!uct user profile information not loa!e!V &ou may nee! to run (>(9I7.I as &T+ This messages will stop appearing when you create the (BO7>4TL>+BL(BO8#I+ tale in the &T+ schema. This is performe! y the (>(9I7.I script. *o to the MOB:4I+L@O+2sqlplus2a!min !irectory, connect as &T+ an! ru n H(>(9I7 from the sqlprompt. @ow can users e prevente! from e3ecuting !evious comman!s? &es, comman! authori)ation is verifie! aga inst the &T+.(BO7>4TL>+BL(BO8#I+ tale. This tale is create! y the (>(9I7.I script. Note that this tale is not use! when someone signs on as user &T+. +g. to !isale all users whose names starts with O(M from e3ecuting the 4ONN+4T comman!$ IS #N+BT #NTO &T+.(BO7>4TL>+BL(BO8#I+ K:I>+ /'I(lus', 'O(MU', '4ONN+4T', N>II, N>II, '7#:9I+7', N>II, N>II0 @ow can one !isale I(lus formatting? Page 70 of 74
#ssue the following +T comman!s to !isale all I(lus formatting$ +T +4@O O88 +T N+W(:*+ E +T (:4+ E +T (:*+#P+ E +T 8++79:4F O88 +T @+:7#N* O88 +T TB#(OOI ON These settings can also e entere! on one line, eg.$ +T +4@O O88 N+W(:*+ E (:4+ E (:*+#P+ E 8++7 O88 @+:7 O88 TB#(OOI ON 4an one sen! operating system parameters to I(lus? One can pass operating system variales to sqlplus using this synta3$ sqlplus username2passwor! Hcm!file.sql var- var1 var6 (arameter var- will e mappe! to I(lus variale Q-, var1 to Q1, etc. Iook at this e3ample$ sqlplus scott2tiger H3.sql '"test parameter"' !ual Where 3.sql consists of$ select 'Q-' from Q1 e3it < 4an one copy tales with ION* columns from one !ataase to another? :out the fastest way of copying !ata etween !ataases an! schemas are y using the I(lus 4O(& statement. Iook at this e3ample$ 4O(& 8BO 4OTT2T#*+BHIO4:IL79 TO 4OTT2T#*+BHB+OT+L79 % 4B+:T+ #:*+LT:9I+ >#N* % +I+4T #:*+LNO, #:*+ % 8BO #:*+ #nterview questions$ -.query for self oin. 1.!eletion of !uplicate rows. 6.post query trigger ;.pre query trigger <.mastere bK!etail relation .report triggers A.report parameters. C.format triggers in report. D.or!er of triggering of when new item instance. -E.
Page 71 of 74
Set , : $- Tas.s" esponsi0ilities an+ S.ills equire+
7#I9+BT' I:W O8 WOBF$ 7on't e irreplaceale, if you can't e replace!, you can't e promote!. Topics 79: Besponsiilities Bequire! kills ualifications Typical #nterview uestions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 79: Besponsiilities$ The o of the 79: seems to e everything that everyone else either !oesn't want to !o, or !oesn't have the aility to !o. 79:s get the enviale task of figuring out all of the things no one else can figure out. ore seriously though, here is a list of typical 79: responsiilities$ #nstallation, configuration an! upgra!ing of Oracle server software an! relate! pro!ucts +valuate Oracle features an! Oracle relate! pro!ucts +stalish an! maintain soun! ackup an! recovery policies an! proce!ures Take care of the 7ataase !esign an! implementation #mplement an! maintain !ataase security /create an! maintain users an! roles, assign privileges0 (erform !ataase tuning an! performance monitoring (erform application tuning an! performance monitoring etup an! maintain !ocumentation an! stan!ar!s (lan growth an! changes /capacity planning0 Work as part of a team an! provi!e A31; support when require! (erform general technical troule shooting an! give consultation to !evelopment teams #nterface with Oracle 4orporation for technical support. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Bequire! kills$ *oo! un!erstan!ing of the Oracle !ataase, relate! utilities an! tools : goo! un!erstan!ing of the un!erlying operating system : goo! knowle!ge of the physical !ataase !esign :ility to perform oth Oracle an! operating system performance tuning an! monitoring Fnowle!ge of :II Oracle ackup an! recovery scenarios : goo! knowle!ge of Oracle security management : goo! knowle!ge of how Oracle acquires an! manages resources : goo! knowle!ge Oracle !ata integrity oun! knowle!ge of the implemente! application systems +3perience in co!e migration, !ataase change management an! !ata management through the various stages of the !evelopment life cycle Page 72 of 74
: soun! knowle!ge of oth !ataase an! system performance tuning : 79: shoul! have soun! communication skills with management, !evelopment teams, ven!ors an! systems a!ministrators (rovi!e a strategic !ataase !irection for the organisation : 79: shoul! have the aility to han!le multiple proects an! !ea!lines : 79: shoul! possess a soun! un!erstan!ing of the usiness %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ualifications$ ust e certifie! as an Oracle 79: (referaly a 9 in computer science or relate! engineering fiel! Iots an! lots of +J(+B#+N4+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Typical #nterview uestions *eneral uestions Tell us aout yourself2 your ackgroun!. What are the three maor characteristics that you ring to the o market? What motivates you to !o a goo! o? What two or three things are most important to you at work? What qualities !o you think are essential to e successful in this kin! of work? What courses !i! you atten!? What o certifications !o you hol!? What suects2courses !i! you e3cel in? Why? What suects2courses gave you troule? W hy? @ow !oes your previous work e3perience prepare you for this position? @ow !o you !efine 'success'? What has een your most significant accomplishment to !ate? 7escrie a challenge you encountere! an! how you !ealt with it. 7escrie a failure an! how you !ealt with it. 7escrie the 'i!eal' o... the 'i!eal' supervisor. What lea!ership roles have you hel!? What preu!ices !o you hol!? What !o you like to !o in your spare time? What are your career goals /a0 6 years from now /0 -E years from now? @ow !oes this position match your career goals? What have you !one in the past year to improve yourself? #n what areas !o you feel you nee! further e!ucation an! training to e successful? What !o you know aout our company? Why !o you want to work for this company. Why shoul! we hire you? Where !o you see yourself fitting in to this organi)ation . . .initially? . . .in < years? Why are you looking for a new o? @ow !o you feel aout re%locating? :re you willing to travel? What are your salary requirements? When woul! you e availale to start if you were selecte!? *eneral Oracle uestions 7i! you use online or off%line ackups? What version of Oracle were you running? @aw many !ataases an! what si)es? #f you have to a!vise a ackup strategy for a new application, how woul! you approach it an! what questions will you ask? #f a customer calls you aout a hanging !ataase session, what will you !o to resolve it? 4ompare Oracle to any other !ataase that you know. Why woul! you prefer to work on one an! not on the other?
Page 73 of 74