Вы находитесь на странице: 1из 225

ORACLE QUESTION BANK AND ANSWERS 1. What is RDBMS? What are different database models?

RDBMS: Relational Database Management System. In RDBMS the data are stored in the form of tables i.e. rows & col mns. !he different database models are 1. "DBMS # "ierarchical Database Management system. $. %DBMs # %etwor& Database Management System. '. RDBMS # Relational Database Management System. $. What is S()? S() stands for Str ct red ( ery )ang age. S() was deri*ed from the +ree& word called ,S-(.-),. S() is a non/ 0roced ral lang age that is written in sim0le -nglish. '. What is a transaction? !ransaction is a 0iece of logical nit of wor& done between two s ccessi*e commits or commit and rollbac&. 1. What is a commit? 2ommit is transaction statements that ma&e the changes 0ermanent into the database. 3. What is a Rollbac&? Rollbac& is a transaction statement that ndoes all changes to a sa*e0oint or since the beginning of the transaction. 4. What is DD)? DD) / Data Definition )ang age. It is a set of statements that is sed to define or alter the .ser5defined ob6ects li&e tables7 *iews7 0roced res7 f nctions etc.7 0resent in a tables0ace. 8. What is DM)? DM) / Data Mani0 lation )ang age. It is a set of statements that is sed for mani0 lation of data. -.g. inserting a row into a table7 delete a row from a table etc. 9. What is loc&ing? !he mechanism followed by the S() to control conc rrent o0erations :n a table is called loc&ing. ;. What is a Dead loc&? When two sers attem0t to 0erform actions that interfere with one another7this sit ation is defined as Deadloc&. -.g.: / If two sers try to change both a foreign and its 0arent &ey *al e at the same time. 1<. What is a Shared )oc&? !he ty0e of loc& that 0ermits other sers to 0erform a = ery7 b t

co ld not mani0 late it7 i.e. it cannot 0erform any modification or insert or delete a data. 11. What is ->cl si*e )oc&? !he ty0e of loc& that 0ermits sers to = ery data b t not change it and does not 0ermits another ser to any ty0e of loc& on the same data. !hey are in effect ntil the end of the transaction. 12. What is Share Row-Ex !"si#e !o $% Share Row ->cl si*e loc&s are sed to loo& at a whole table and to allow others to loo& at rows in the table b t to 0rohibit others from loc&ing the table in Share mode or 0dating rows. 1'. What is +ro 0 / ? nctions? !he ? nctions that are sed to get s mmary information@s abo t gro 0 :r set of rows in a table. !he gro 0 f nctions are also termed as aggregate f nctions. ?ollowing are the e>am0les of aggregate f nctions: 1. AB+ CD / !o find the a*erage *al e $. MI% CD / !o find the minim m *al e of the set of rows. '. MAE CD / !o find the ma>im m *al e of the set of rows. 1. 2:.%! CD / !o find the total no of rows that has *al es. 3. S.M CD / !o find the s mmation of the data of a gi*en col mn. 11. What is inde>ing? An inde> is an ordered list of the contents of a col mn or a gro 0 of col mns of a table. By inde>ing a table7 it red ces the time in 0erforming = eries7 es0ecially if the table is large. 1&. What are !"sters% A 2l ster is a schema ob6ect that contains one or more tables that ha*e one or more col mns in common. Rows of one or more tables that share the same *al e in these common col mns are 0hysically stored together within the database. 14. What is a Biew? Biew is li&e a window thro gh which yo can *iew or change the information in table. A *iew is also termed as a F*irt al tableF. 18. What is a Rowid? ?or each row in the database7 !he R:WID 0se do col mn ret rns a rowFs address. R:WID *al es contain information necessary to locate a row: G Which databloc& in the data file G Which row in the databloc& Cfirst row is <D G Which data file Cfirst file is 1D Bal es of the Rowid 0se docol m ha*e the dataty0e R:WID. 1'. What is a (RI)AR* KE*% HRIMARI J-I 2:%S!RAI%!: 1. Identified the col mns or set of col mns7 which ni= ely identify each row of a table and ens re that no d 0licate rows e>ist in the table. $. Im0licitly creates a ni= e inde> for the col mn CSD and s0ecifies the col mnCsD as being %:! %.)).

'. !he name of the inde> is the same as the constraint name. 1. )imited to one 0er table. ->am0le: 2R-A!- !AB)- loans Cacco nt %.MB-R C4D7 loan5n mber %.MB-RC4D7 ... 2:%S!RAI%! loan50& HRIMARI J-I Cacco nt7 loan5n mberDDK 1+. What is a U,i-"e o,strai,t% .%I(.- 2onstraint: 1. -ns res that no two rows of a table ha*e d 0licate *al es in the s0ecified col mnsCsD. $. Im0licitly creates a ni= e inde> on the s0ecified col mns. '. Inde> name is the gi*en constraint name. ->am0le: 2R-A!- !AB)- loans C )oan5n mber %.MB-R C4D %:! %.)) .%I(.-7 ... DK 2.. What is the /i00ere, e 1etwee, a ",i-"e a,/ 2ri3ar4 $e4% !he Hrimary&ey constraint is a constraint that ta&es care maintaining the ni= eness of the data7 enforcing the not n ll characteristic7 creates a self/inde>. !he .ni= e &ey constraint maintains only the ni= eness of the data and does not enforce the not n ll characteristic to the data col mn. $1. What is a foreign &ey? ?:R-I+% J-I 2onstraint: 1. -nforces referential integrity constraint7 which re= ires that for each row of a table7 the *al e in the foreign &ey matches a *al e in the 0rimary &ey or is n ll. $. %o limit to the n mber of foreign &eys. '. 2an be in the same table as referenced 0rimary &ey. 1. 2an not reference a remote table or synonym. ->am0les: 1. ->0licit reference to a HRIMARI J-I col mn 2R-A!- !AB)- acco nts C acco nt %.MB-RC1<D 7 2:%S!RAI%! borrower ?:R-I+% J-I Cacco ntD R-?-R-%2-S c stomer Cacco ntD7 ...DK $. Im0licit reference to a HRIMARI J-I col mn 2R-A!- !AB)- acco nts C acco nt %.MB-RC1<D7 2:%S!RAI%! borrower ?:R-I+% J-I Cacco ntD R-?-R-%2-S c stomer7 ...DK 22. What is /ata i,te5rit4% What are the t42es o0 i,te5rit4% 1. A mechanism sed by the RDBMS to 0re*ent in*alid data entry into the base tables of the database. $. Defined on tables so conditions remain tr e regardless of

method of data entry or ty0e of transactions. !he following are the ty0e of integrity G -ntity integrity G Referential Integrity G +eneral B siness r les $'. What is a Referential Integrity? 1. -nforces masterLdetail relationshi0 between tables based on &eys. G ?oreign &ey G .0date Delete restricts action G Delete 2ascade action

$1. What are different data ty0es? !he following are the different data ty0es a*ailable in :racle 1. Internal Data ty0es $. 2om0osite Data ty0es Internal Data ty0es 1. 2haracter Dataty0e $. Date Dataty0e '. Row and long row data ty0es 1. Rowid Dataty0e 2om0osite Data ty0es 1. !able Data ty0e $. Record Data ty0e 2&. What is 6ARC7AR2% 7ow is it /i00ere,t C7AR% !he Barchar$ dataty0e s0ecifies a *ariable length character string. When yo create a *archar$ col mn7 yo can s 00ly the ma>im m n mber of bytes of data that it can hold. :racle S bse= ently stores each *al e in the col mn e>actly as yo s0ecify. If yo try to insert a *al e that e>ceeds this length7 :racle ret rns an error. !he 2har dataty0e length is 1byte. !he ma>im m siMe of the 2har dataty0e is $33. :racle com0ares 2har *al es sing the blan&/0added com0arison semantics. If yo insert a *al e that is shorter than the col mn length7 :racle blan&/0ads the *al e to the col mn length. $4. What is dataty0e mi>ing? !here are two data ty0es N!IH- and NR:W!IH-. !he first one declares a *ariable to be of the data ty0e of the col mn of the table to which it is referring. ?or e>am0le7 if yo declare a *ariable li&e this: my5em0no em0.em0noN!IHthen7 my5em0no will ha*e the data ty0e of the em0no col mn of the table em0. Similarly if yo declare the *ariable li&e this: my5em0rec em0NR:W!IHthen7 my5em0rec will ha*e the data ty0e of all the fields of the em0 table. ?or e>am0le. S 00ose em0loyee table is li&e this: em0no n mberC$D7 em0name *archar$C1<D7

Sal n mber C1<7$D. !hen my5em0rec will be of a data ty0e whose first $ 0ositions will be of n mber data ty0e7 the ne>t 1< will be of *archar$ data ty0e while the last 1< will be of data ty0e n mber. :ne can refer to the indi*id al fields of this record *ariable as my5em0rec.em0no7 my5em0rec.em0name7 my5em0rec.sal.

$8. What is %.))? A data field witho t any *al e in it is called a n ll *al e. A % ll can arise in the following sit ation G Where a *al e is n&nown. G Where a *al e is not meaningf l Ci.e.D in col mn re0resenting commission for a row that does not re0resent salesman. $9. What is a se= ence? A se= ence is a database ob6ect from which m lti0le sers may generate ni= e integers. $;. What are 0se do/col mns in :RA2)-? !he col mns that are not 0art of the table are called as 0se do col mns. '<. What is li&e o0erator? "ow is it different from I% o0erator? !he ty0e of o0erator that is sed in character string com0arisons with 0attern matching. )i&e o0erator is sed to match a 0ortion of the one character string to another whereas I% o0erator 0erforms e= ality condition between two strings. '1. What is Single Row n mbers ? nctions? !he ty0e of f nction that will ret rn *al e after e*ery row is being 0rocessed. ?ollowing are some of the row n mber f nctions. ? nction %ame 1. ABS CnD $. ?loor CnD '. Mod Cm7 nD 1. Hower Cm7 nD 3. Ro nd CnD 4. S=rt C>D 8. !r n& Cn7 mD H r0ose ret rns the absol te *al e of a n mber ret rns the largest integer *al e e= al or less than n. ret rns the remainder of m di*ided by n. ret rns m raised to the n 0ower. ret rns n ro nded to m 0laces right of a decimal 0oint. ret rns the s=rt *al e of >. Ret rns n tr ncated to m decimal 0laces.

'$. What are single row character f nctions? !he f nction that 0rocesses at *al e of data7 which is of character dataty0e7 and ret rns a character dataty0e after e*ery row is being 0rocessed are termed as single row character f nctions.

? nction %ame 1. 2har CnD $. Initca0 CnD '. )ower CnD

H r0ose. ret rns the character ha*ing an AS2II *al e. ret rns character with first letter of each arg ment in .HH-R2AS-. ret rns characters with all the letters forced to lower case. Remo*es the s0aces towards the left of the string. Ret rns characters with all the letters forced to 00er case.

1. ltrimCnD 3. 00erCnD

88. What are Co,#ersio, 9", tio,s% !he f nctions sed to con*ert a *al e from one dataty0e to another are being termed as con*ersion f nctions. ? nction %ame !o5char Cn7 CfmtDD !o5n mber CnD Rowidtochar CnD H r0ose con*erts a *al e of n mber dataty0e to a *al e of character dataty0e. con*erts a character *al e into a n mber. con*erts rowid *al es to character dataty0e. the res lt of this con*ersion is always 19 character long.

8:. What are Date 0", tio,s% ? nctions that o0erate on :racle Dates are termed as Date f nctions. All date f nctions ret rn a *al e of date dataty0e e>ce0t the O f nction months5between ret rns a n meric *al e. ? nction ADD5M:%!"S Cd7 nD H r0ose ret rns the date FdF 0l s n months. n m st be an integer. n can be 0ositi*e or negati*e. ret rns the date of the last day of the month containing the date FdF. ret rns date of first day of wee& named after char that is later than d7 char m st be a *alid day of the wee&. ret rns no of months between dates d & e.

)AS!5DAI CdD %-E!5DAI Cd7 charD

M:%!"S5B-!W--% Cd7 eD 8&. What is NEW;TI)E 0", tio,% SI%!AE: %ew5time Cd7 a7 bD

%ew5time f nction ret rns date and time in a time Mone b and time in time Mone. a and b are character e>0ressions. ?ollowing are the some of the character e>0ressions: 2haracter e>0ression Descri0tion

AS! BS!7 BD! +M! HS!7 HD! IS!7 ID! 8<. What is Co,#ert 0", tio,%

Atlantic Stand or daylight time B rning stand or daylight time +reenwich Mean !ime. Hacific Standard !ime. I &on standard or daylight time.

2on*ert f nction con*erts two different im0lementations of the same character set . ?or instance: from D-2 9 bit m lti/ling al characters to "H 9 bit M lti/ling al character set. ?ollowing are the character sets .S8AS2II / .S8bit AS2II character set W-9D-2 / Western - ro0ean 9 bit AS2II set W-9"H / "HFs Western - ro0ean 9 bit AS2II set ?8D-2 / D-2Fs ?rench 8/bit AS2II set 2on*ert Cchar PdestinationQ7 Pso rceQD 8=. What is a tra,s!ate 0", tio,% !he f nction that ret rns a character after re0lacing all occ rrences of the character s0ecified with the corres0onding character is called as translate f nction. -.g. !RA%S)A!- CF"elloF7FlF7F)FD gi*es yo "e))o 8'. What is a so",/ex 0", tio,% So nde> is a f nction that ret rns a character string re0resenting the so nd of the words in char. !his f nction ret rns a 0honetic re0resentation of each word and allows yo to com0are words that are s0elled differently b t so nd ali&e. So nde> CcharDK 8+. What is a re2!a e 0", tio,% Re0lace f nction ret rns character with e*ery occ rrence of the search string re0laced with the re0lacement string. If the re0lacement string is not s 00lied7 all occ rrences of search5string are being remo*ed. Re0lace allows yo to s bstit te one string from another. :.. What is a 9!oor 0", tio,% ?loor ? nction ret rns the largest integer e= al to or than n Synta>: floor CnDK :1. What is INITCA( 9", tio,% !he initca0 f nction ret rns char7with first letter of each word in 00ercase7 all other letters in lowercase. A word is delimited by white s0ace :2. What is ASCII 9", tio,% !he AS2II f nction ret rns the collating se= ence of the first character of lchar. !here is no corres0onding -B2DI2 f nction. :n -B2DI2 systems7 the AS2II f nction will ret rn -B2DI2 collating se= ence *al es. :8. What is a De o/e 9", tio,%

!he Decode f nction is sed to com0are an e>0ression to each search *al e and ret rns the res lt if e>0r e= als the search *al e. -.g.: Decode Ce>0r7 search17 res lt17 Psearch$7 res lt$Q7 Pdefa ltQDK ::. What is >reatest 9", tio,% !he +reatest f nction ret rns the greatest of a list of *al es. All e>0r after the first are con*erted to the dataty0e of the first before com0arison is done. :&. What are 9or3at 3o/e!s% ?ormat models are sed to affect how col mn *al es are dis0layed when a format retrie*ed with a select command. ?ormat models do not affect the act al internal re0resentation of the col mn. :<. >i#e & exa32!es 0or DATE? N"31er 0", tio,% ->am0les for % mber ? nction: 1. Select abs C/13D ,Absol te:, from d al $. Select mod C873D ,Mod la, from d al '. Select ro nd C1$'3.9371D from d al 1. Select 0ower C$7'D from d al 3. Select floor C8.3D ,?loor, from d al ->am0les for Date ? nction 1. Select sysdate from d al $. Select sysdate/to5date C$'/Se0/;'D from d al '. Select sysdate R ;< from d al 1. Select sysdate /;< from d al 3. Select ne>t5day Csysdate7,?riday,D from d al :=. What is a, ex2ressio,% An e>0ression is a gro 0 of *al e and o0erators which may be e*al ated a single *al es. :'. What are the t42es o0 ex2ressio,% !he different ty0es of e>0ressions are 1. )ogical e>0ression $. 2om0o nd e>0ression '. Arithmetic e>0ression 1. %egating e>0ression. :+. What is a s4,o,43% !he synonym is a ser/defined ob6ect that is sed to define an alias name for the ser defined ob6ects li&e table *iew etc. &.. What is a o,/itio,% A 2ondition co ld be said to be of the logical dataty0e that e*al ates the e>0ression to a !r e or ?alse *al e. &1. What are the = 0or3s o0 o,/itio,% !here are totally 8 forms of condition 1. A com0arison with e>0ression or s b= ery res lts. $. A com0arison with any or all members in a list or a s b= ery '. A test for membershi0 in a list or a s b= ery 1. A test for incl sion in a range 3. A test for n lls. 4. A test for e>istence of rows in a s b= ery

8. A test in*ol*ing 0attern matching 9. A combination of other conditions &1. What are "rsors% :racle ses wor& areas called 0ri*ate S() areas to e>ec te S() statements and store 0rocessing information. !his 0ri*ate S() wor& area is &nown as c rsors. &2. What are ex2!i it "rsors% 2 rsors that are defined for 0erforming a m lti0le row select are &nown as e>0licit c rsors. Im0licit c rsors are the ty0e of c rsors that is im0licitly o0ened by the :racle itself whene*er yo 0erform any DM) statements li&e .0date7 delete7 insert or select into statements. &8. What is a (L@SQL% H)LS() is a transaction 0rocessing lang age that offers 0roced ral sol tions. &:.What is a, e31e//e/ SQL% All the S() statements written in a "ost lang age are &nown as -mbedded S() statements. &<. What are the /i00ere,t o,/itio,a! o,str" ts o0 (L@SQL% !he statements that are sef l to ha*e a control o*er the set of the statements being e>ec ted as a single nit are called as conditional constr cts. !he following are the different ty0e of conditional constr cts of H)LS() 1. if SconditionT then elsifSconditionT then end if $. While SconditionT loo0 end loo0 '. loo0 e>it whenSconditonT end loo0 1. for S*arT in range1..range$ loo0 end loo0 3. for i in S= eryLc rsor identifierT loo0 end loo0 &=. 7ow is a, arra4 /e0i,e/ i, (L@SQL% !y0edef SidentifierT table of Sdataty0eT Inde> by binary5integerK &'. 7ow to /e0i,e a #aria1!e i, (L@SQL% Bariablename dataty0eSsiMeT Snot n llT S: # *al eT &+. 7ow to /e0i,e a "rsor i, (L@SQL% 2 rsor *ariable is S= eryT

<.. What are ex e2tio,s% !he bloc& where the statements are being defined to handle internally and serdefined H)LS() errors. <1. What are the s4ste3s ex e2tio,s% When an :racle error is internally enco ntered H)LS() bloc& raises an error by itself. S ch errors are called as internal or system defined e>ce0tion. ?ollowing are some of the internal e>ce0tions: 1. Uero5di*ide7 $. %o5data5fo nd '. Bal e5error 1. !oo5many5rows <2. 7ow to /e0i,e o"r ow, ex e2tio,s i, (L@SQL% Define a H)LS() *ariable as an e>ce0tion in the *ariable declaration section. In order to in*o&e the *ariable that is an e>ce0tion ty0e se the raise statement. Declare a e>ce0tionK Begin statements.... ///// if > T y then raise aK end ifK e>ce0tion when a then statements7 rollbac&K when others then commitK endK <8. 7ow is the 2er0or3a, e o0 Ora !e i32ro#e/ 14 (L@SQL i, Ora !e% Witho t H)LS() the :RA2)- RDBMS m st 0rocess S() statements one at a time7 -ach S() statement res lts in another call to RDBMS and higher 0erformance o*erhead. !his o*erhead can be significant when yo are iss ing many statements in a networ& en*ironment. With the H)LS() all the S() statements can be sent to RDBMS at one time. !his red ces the IL: o0erations. With H)LS() a tool li&e ?orms can do all data calc lations = ic&ly and efficiently witho t calling on the RDBMS . <:. What is SC7E)A% A S2"-MA is a logical collection of related items of tables and Biews. <&. What are 2ro0i!es% A Hrofile is a file that contains information abo t the areas that a ser can access. <<. What are ro!es% A role is a collection of related 0ri*ileges that an administrator can grant collecti*ely to database sers. <=. 7ow a, we a!ter a "serAs 2asswor/ i, ORACLE% Inorder to Alter the 0assword of the ser we ha*e to se the following statement: A)!-R .S-R ser5name identified by 0asswd -.g.: Alter ser sam identified by Ha l <'. What is a ta1!es2a e i, Ora !e%

A tables0ace is a 0artition or logical area of storage in a database that directly corres0onds to one or more 0hysical data files. <+. What is a, exte,t% An e>tent is nothing more that a n mber of contig o s bloc&s that :RA2)-/8 allocates for an ob6ect when more s0ace is necessary for the ob6ect data. 8<. What are H2!?R-- and H2!.S-D 0arameters?

H2!?R--: / H2!?R-- controls how m ch of the s0ace in a bloc& is reser*ed for statements that 0date e>isting rows in the ob6ect. H2!.S-D: / H2!.S-D is a 0ercentage of sed s0ace in a bloc& that triggers the database to ret rn to the tableFs free s0ace list. =1. What is a 1!o $ i, Ora !e% !he Hlace where the data related to :racle are stored 0hysically in an :0erating System is &nown as bloc&. =2. What is C!ie,t-ser#er ar hite t"re% A clientLser*er system has three distinct com0onents ?oc sing on a s0ecific 6ob A database ser*er A client a00lication and a networ&. A ser*er Cor bac& endD foc ses on efficiently managing its reso rce S ch as database information. !he ser*erFs 0rimary 6ob is to manage its reso rce o0timally among m lti0le clients that conc rrently re= est the ser*er for the same reso rce. Database ser*ers concentrate on tas&s s ch as G Managing a single database of information among many conc rrent sers. G 2ontrolling database access and other sec rity re= irements. G Hrotecting database information with bac& 0 and reco*ery feat res. G 2entrally enforces global data integrity r les across all 2lient a00lications. A client a00lication C,the front end,D is the 0art of the system that a00lications in a clientLser*er database system foc s on 6obs s ch as sers em0loy to interact with data. !he client

G Hresenting an interface a ser can interact with to accom0lish wor&. G Managing 0resentation logic s ch as 0o0 0 lists on a data entry form or bar gra0hs in a gra0hical data 0resentation tool. G Herforming a00lication logic7 s ch as calc lating fields in a dataentry form. G Balidating data entry. G Re= esting and recei*ing information from a database ser*er. A networ& and comm nication software is the *ehicle that transmit data between the clients and the ser*er in a system. Both the clients and the ser*er r n comm nication software that allows them to tal& across a networ&. !y0es of 2lient Ser*er Architect re: 1. Dedicated 2lient Ser*er Architect re $. M lti/threaded 2lient Ser*er Architect re '. Single/ !as& 2lient Ser*er Architect re Dedicated Ser*er: 2onnects the 2lient Directly to the dedicated ser*er M lti/!hreaded Ser*er: It is a ty0e of architect re that is a combination of dis0atcher7 listener and front/end ser*er 0rocess to ser*e the re= ests of many clients with minimal 0rocess o*erhead on the database ser*er.

Single/!as& ser*er: In host/based database ser*er system a ser em0loys a d mb terminal or terminal em lator to establish a session on the host com0 ter and r n the client database a00lication. =8. What is a se53e,t i, Ora !e% Ex2!ai, the /i00ere,t t42es% !he 0laces where the data are stored in the allotted tables0ace are called as segments. !he data may be a table or inde> data re= ired by DBMS to o0erate. Segments are the ne>t logical le*el of a storage tables0ace. !here are basically 3 ty0es of segments G Data segment: 2ontains all the data of each table G Inde> segment: 2ontains all the inde> data for one or more inde>es 2reated for a table. G Rollbac& segment: 2ontains the recorded actions7 which sho ld be ndone nder certain circ mstances li&e G !ransaction rollbac& G Read consistency G !em0orary segment: Whene*er a 0rocessing occ rs :racle often re= ires tem0orary wor&s0ace for intermediate stages of statement 0rocessing. !hese areas are &nown as tem0orary segments. G Bootstra0 segment: 2ontains information of the data dictionary definition a database is o0ened. for the tables to be loaded whene*er

=:. What is the "se o0 Ro!!1a $ se53e,t% It is a 0ortion of a database that records the information abo t the actions that sho ld be ndone nder certain circ mstances li&e G !ransaction Rollbac& G Read consistency =&. What is rea/- o,siste, 4 i, Ora !e% Read consistency in :racle is a 0rocess that ignores the changes by others in a table whene*er a table is = eried. Read consistency in :racle is achie*ed by a statement S-! !RA%SA2!I:% R-AD :%)I =<. What is S>A% S+A is System +lobal Area. !he library cache and dictionary cache ma&es 0 the shared 0ool. !he shared 0ool combined with b ffer/cache ma&e 0 the System +lobal Area. )ibrary 2ache: / It stores the S() Statements and H)LS() Hroced res. Dictionary 2ache: / "olds dictionary information in memory. B ffer and 2ache: / the 0lace where the data related to recently re= ested transaction is stored. ==. What is Ba $ >ro",/ (ro ess% !he Hrocess of ser*er is being classified into two 0rocesses namely ?oregro nd and Bac&gro nd. ?oregro nd handles the re= est from client 0rocesses while bac&gro nd handle other s0ecific row of the database ser*er li&e writing data to data and transaction )og ?iles. ='. S4ste3 Useri/% Whene*er yo create a database an .serid is a tomatically created related with database administration connections. !his acco ntL serid is called System .serid. =+. S*S Useri/%

It is a s0ecial acco nt thro gh which DBA can e>ec te s0ecial database administration connections. the owner of databaseFs data dictionary table. '.. Data Di tio,ar4%

SIS

is

It 0ro*ides the details on the database ob6ects s ch as col mns7 *iews -tc.7 the oracle sers7 the 0ri*ileges and the rights of sers o*er different ob6ects. '1. SQLBDBA% S()GDBA is a tility thro gh which yo can manage a database system effecti*ely. '2. ORACLE AD)INISTRATOR% !he 0erson who ta&es care of monitoring the entering 0erformances of the database system is called7 as an :racle Administrator.:racle Administrator is the main 0erson who ta&es care of assigning the set of to act as DBA for monitoring certain 6obs li&e 1. 2reating 0rimary database storage str ct re. $. Monitoring database 0erformance and efficiency. '. Bac&ing 0 and restoring. 1. Mani0 lating the 0hysical location of the database. !: 2R-A!- DA!ABAS-: 1. Determining a00ro0riate *al es for the file limit 0arameters of the create database command. Harameters Ma> data files: Determines the ma>im m n mber of data files that can e*er be allocated for the database Ma> )og ?iles: Determines the ma>im m n mber of log gro 0s for the database. Ma> )og Members: Ma>im m n mber of members for each log gro 0. ':. What are /ata1ase 0i!es% !he 0hysical files of :racle are &nown as database files. '&. What is a Lo5 9i!e% !he files that contains information abo t the information of 2RAS" or a M-DIA ?ail re. '<. What is a, I,it 0i!e% Init files are &nown as InitialiMation Harameter files. Init files are sed for setting the 0arameters G ?or an :racle instance G ?or )og files reco*ery of oracle database at the e*ent of a SIS!-M

'=. What is a o,tro! 0i!e% What is its si5,i0i a, e% A control is a small binary file. It contains the entire system e>ec table code named as :RA2)-.D2?. A control file always consists of the following 1: %ame of the database $: )og files ': Database creation ''. What /oes a, U(DATE state3e,t /oes% !o 0date rows in a table. '+. What /oes a De!ete state3e,t /oes% !o remo*e the rows from the table. +.. What /oes a, i,sert state3e,t /o% !o insert new rows into a database.

+1. What /oes a Se!e t state3e,t /o% !o = ery data from tables in a database +2. 7ow to reate a ta1!e "si,5 se!e ts a,/ i,serts state3e,ts% .sing Select statement: 2reate table tablename as S( ery T .sing insert statement we cannot create a table b t can only a00end the data into the table .sing Insert statement: Insert into tablename S( eryT +8. 7ow to /e!ete /"2!i ate rows i, a ta1!e% Delete from tablename where rowid not in CSelect min CrowidD from tablename gro 0 by col mn17 col mn$...D +:. What is a, i,sta, e% An :racle instance is a mechanism that 0ro*ides the mechanism for 0rocessing and controlling the database. +&. What is start"2 a,/ sh"t/ow,% Start 0 is a 0rocess ma&ing the :racle Database to be accessed by all the sers !here are three 0hases to database start 0 1. Start a new instance for the database $. Mo nt the database to the instance '. :0ening the mo nted database Sh tdown is a 0rocess ma&ing the :racle Database na*ailable for all the sers. !here are three 0hases to database sh tdown 1. 2lose database $. Dismo nt the database from the instance '. !erminate the instance. +<. What is 3o",ti,5 o0 /ata1ase% +=. What is a two-2hase o33it% +'. What are s,a2-shots% A Sna0shot is a stable that contains the res lts of = ery :f one or more tables or *iews7 often located on a remote database. ++. What are tri55ers a,/ store/ (ro e/"res% A 0roced re is a gro 0 of H)LS() statement that yo call by a name. 2om0iled *ersion of 0roced re that is stored in a database are &nown as Stored Hroced res. A database trigger is a stored 0roced re that is associated with a table. :racle a tomatically fires or e>ec tes when a triggering statement is iss ed. 1... What are (a $a5es%

A 0ac&age is an enca0s lated collection of related 0rogram ob6ects stored together in the database. 1.1. What is SQLB9or3s8..% Is it a C!ie,t or a ser#er% S=lG?orms is a general/0 r0ose tool for de*elo0ing and e>ec ting forms based interacti*e a00lications. !he com0onent of this tool is s0ecially designed for a00lication de*elo0ers and 0rogrammers and it is sed for the following tas&s : G Define transactions that combine data from m lti0le tables into a single form. G 2 stomiMe all as0ects of an a00lication definition sing std/fill/in/ interface to enhance the 0rod cti*ity and red ce learning time. S=lG?orms'.< is a 2lient. 1.2. What are (a $a5e/ (ro e/"res% A 0ac&aged 0roced re is a b ilt in H)LS() 0roced re that is a*ailable in all forms. .sing 0ac&aged 0roced re we can b ild triggers to 0erform the following !as&s to G Red ce the amo nt of re0etiti*e data entry. G 2ontrol the flow of a00lication G -ns ring the o0erators always follow se= ence of actions when they se a form. 1.8. What are /i00ere,t t42es o0 tri55ers% !he following are the different ty0e of triggers they are 1. Jey/triggers $. %a*igational !riggers. '. !ransactional !riggers. 1. ( ery/based !riggers 3. Balidation !riggers 4. Message / -rror handling !riggers. 1.:. What is the /i00ere, e 1etwee, the restri te/ a,/ U,-Restri te/ (a $a5e/ (ro e/"re% Any 0ac&aged 0roced re that does not interfere with the basic f nction of S()G?orms is an nrestricted 0ac&aged 0roced re. !he .n/restricted Hac&aged 0roced re can be sed in all ty0es of triggers. Any 0ac&aged 0roced re that affects basic S()G?:RMS f nction is a restricted 0ac&aged 0roced re. Restricted 0ac&aged 0roced re can be sed only in &ey/triggers and ser/named triggers. 1.&. What is a s4ste3 #aria1!e% A System *ariable is a S()G?orms *ariable that &ee0s trac& of some internal 0rocess of S()G?orms in state. !he system *ariable hel0s s to control the way an a00lication beha*es. S()G?orms maintains the *al e of a system on a 0erformance basis. !hat is the *al es of all the system *ariables corres0ond only to the c rrent form. 1.<. What are >!o1a! 6aria1!es% A +lobal *ariable is a S()G?orm *ariable that is acti*e in any trigger within a form and is acti*e thro gho t S()G?orm CR n/?ormD session. !he *ariable stores string *al e 0to $33 characters. 1.=. What are the /i00ere,t t42es o0 o1Ce ts i, SQLB9or3s% A S()G?orm a00lication is made 0 of ob6ects. !hese ob6ects contain all the information that is needed and 0rod ce the S()G?orms a00lication. ?ollowing are the ob6ects of the S()G?orms: 1. ?orm $. Bloc& '. ?ields

1. Hages 3. !riggers 4. ?orm/)e*el/Hroced res. 1.'. What are (a5es% Hages are collection of dis0lay information s ch as constant te>t and gra0hics. All fields are dis0layed in a 0age. 1.+. What are a B!o $ a,/ its t42es% Ex2!ai, the /i00ere,t t42es o0 1!o $s% Bloc& is an ob6ect of ?orms that describes section of a form or a s bsection of a ?orm and ser*e as the basis of defa lt database interface. !y0es of Bloc&s: 1. 2ontrol Bloc&: 2ontrol bloc& is not associated with any table in the database. It is made 0 of fields that are base table fields7 s ch as tem0orary data fields. $. Detail Bloc&: Detail Bloc& is associated with a master bloc& in Master/detail relationshi0. !he detail bloc& dis0lays detail records associated with master records in a bloc&. '. Master/Bloc&: A master bloc& is associated with a master/detail relationshi0. !he master bloc& dis0lay master records associated with detail records in the detail bloc&. 1. M lti/record Bloc&: A m lti/record bloc& can dis0lay more than one record at a time. 3. %on/enterable Bloc&: A non/enterable bloc& consists of all non/enterable fields. 4. Single/record Bloc&: A single record bloc& can dis0lay only one record at a time. 11.. What is a S ree, (ai,ter% !his is a S() ?orms ,wor& area, where yo can modify the layo t of forms. !he screen 0ainter dis0lays one 0age area at a time. 111. What are the /i00ere,t 0ie!/ t42es% !he different ty0es of fields in S()G?orms are 1. Base / table field $. 2ontrol/field '. -nterable/field 1. "idden/field 3. )oo&/ 0 field 4. %on/enterable field 8. Scrolled / field 112.What is 2a5e Dero% !he 0lace where the hidden fields are being 0laced in an a00lication 118. What /oes )essa5e 2ro e/"re /o% !he Message 0roced re dis0lays s0ecified te>t on the message line. 11:. What /oes Na3e;i, 0", tio, /o% !he %ame5in 0ac&aged f nction ret rns the contents of the *ariable to which yo a00ly it. !he ret rned *al e is in form of a string. 11&. What /oes CLEAR;EOL 2ro e/"re /o% 2lear5-ol clears the c rrent fieldFs *al e from the c rrent c rsor 0osition to the end of the line or field. 11<. What /oes O,-Error tri55er /o% !he :n/error trigger fires whene*er S()G?orms wo ld normally ca se an error message to dis0lay. !he actions of an :n/-rror triggers is sed for the following 0 r0oses:

G !ra0 and reco*er an error. G Re0lace a standard error message with a c stomiMed message. 11=. What /oes o24 2ro e/"re /o% !he 2o0y 0roced re writes a *al e into a field. 2o0y e>ists s0ecifically to write a *al e into that is referenced thro gh %AM-5I% 0ac&aged f nction. 11'. What is the Arra4siEe 2ara3eter% !he Array/SiMe 0arameter is a bloc&/characteristic that s0ecifies the Ma>im m n mber of records that S() ?orms CR n/?ormD can fetch from the database at one time. 11+. What /oes >o;B!o $ 2a $a5e/ 2ro e/"res /o% !he +o5Bloc& 0ac&aged 0roced re na*igates to the indicated Bloc&.If the target is non/enterable an error occ rs. 12.. What /oes ANC7OR;6IEW 2ro e/"re /o% Anchor5*iew mo*es a *iew of a 0age to a new location on the screen. !his 0roced re effecti*ely changes where on the screen the o0erator sees the *iew. 121. 7ow to a!! a 0or3 0ro3 i,si/e a 0or3% Inorder to call a form from inside a form we ha*e to se the 2A)) 0ac&aged/0roced re. Inorder to call a form from inside a form the 0ac&aged 0roced re 2all is sed. Synta>: 2A)) C?ormnameD. When call r ns an indicated form while &ee0ing the 0arent form acti*e. S()G?orms r ns the called form with the same S()G?orms o0tions as the 0arent form. 122. 7ow to se,/ 2ara3eters to a,other 0or3% Inorder to send 0arameters across the forms we se the global *ariables. 128. 7ow to 5i#e a"to3ati hi,t text 0or 0ie!/s% Inorder to gi*e a tomatic hint te>t for fields7 In the field definition screen of the fields we are ha*ing an o0tion called "int *al e. Inorder to acti*ate this o0tion in the Select attrib te section in*o&e the o0tion called A tomatic "int. 12:. 7ow to see $e4 3a2 se-"e, es% Inorder to see &ey ma0 se= ences we ha*e to 0ress the S":W J-I screen &ey f nction. 12&. What is S*NC7RONIDE 2ro e/"re /oes% !he synchroniMe 0roced re synchroniMes the terminal screen with the internal state of form7 that is synchroniMe 0dates the screen dis0lay to reflect the information that S()G?orms has in its internal re0resentation of the screen. 12<. What is EFECUTE;QUER* 2ro e/"re% !he ->ec te5= ery 0roced re fl shes the c rrent bloc&7 o0ens a = ery and fetches a n mber of selected records. If there are changes to commit7 S()G?orms 0rom0ts the o0erator to commit them d ring the e>ec te5= ry e*ent. 12=. 7ow to "sto3iEe s4ste3 3essa5e i, SQLB9or3s% Inorder to c stomiMe the system messages the :n/Message trigger is sed. 12'. 7ow to /e0i,e the 0ie!/s i, W*SIW*> 9or3at% 1$;. What is an :n/Insert trigger? "ow is it different from Hre/insert trigger?

An :n/insert trigger re0laces the defa lt S()G?orms 0rocessing for handling inserted records d ring transaction 0osting. It fires once for each rows that is mar&ed for insertion into the database. An :n/insert !rigger fires d ring the Host and 2ommit !ransactions e*ent. S0ecifically it fires after the Hre/insert trigger and before the Host/insert trigger. 18.. What is the /i00ere, e 1etwee, a Tri55er a,/ a (ro e/"re% Hroced res can ta&e in arg ments where as !riggers cannot ta&e in arg ments. 181. 7ow to a!! a store/ 2ro e/"re 0ro3 i,si/e a 0or3% !o call a Stored Hroced re inside a form !rigger !e>t: Hrocd renameS0aramatersT 182. What are 62 Tri55ers% B$ !riggers are the ty0es of !riggers in which we can 0erform only a sim0le = ery. And we cannot write a H)LS() bloc&. 188. 7ow to re,a3e a 9or3% !o rename a form select the rename o0tion in the Action Men . !hen gi*e the form name. Hress Acce0t. In the ne>t field gi*e the new name. Hress Acce0t to ->ec te. 18:. What is a (o2 -"2 2a5e% 7ow to /e0i,e o,e% Ho0/.0 Hages: / Ho0/.0 0age is a S()G?orms ob6ect which o*erlays on an area of the c rrent dis0layed 0age in res0onse to some e*ent or for ser call. !o define a Ho0/.0 0age se the 0age definition form which is in the Image/Modify o0tion. In that form 0 t an E in the Ho0/.0 field to ma&e the c rrent 0age as Ho0/.0. 18&. What is a >ro"2 i, SQL B RE(ORTWRITER% +ro 0 in Re0ortWriter: / +ro 0 is a collection of fields7 or single field. .s ally by defa lt a gro 0 will bare the field7 which are references by a single = ery. B t we can change from single = ery gro 0 /m lti gro 0s. 18<. 7ow /o 4o" /e0i,e a (are,t- hi!/ re!atio,shi2 i, Re2ortWriter% Harent / 2hild Relation: / !o define a Harent/2hild relationshi0 first we need more that one ( ery. We sho ld first enter the Harent ( ery and then the 2hild ( ery. In the 2hild ( ery ?orm we sho ld gi*e the Harent ( ery %ame in the desired 0osition and the common col mns in both = eries. 18=. What is a Row o",t 0", tio, i, Re2ortWriter% It is a field le*el f nction that is sed for generation of a tomatic row n mbers related to database col mn that does not ha*e n ll *al es. 18'. 7ow /o 4o" /e0i,e a 3atrix re2ort% Matri> Re0ort: / Matri> Re0ort is a Re0ort that consists of !wo Harent ( eries and one 2hild ( ery. Hroced re for Defining a Matri> Re0ort: 1. Define !wo Harent ( eries. $. Define a 2hild ( ery. In the Definition screen s0ecific which col mn of the child is to be related to the ( ery1 and to ( ery$. '. After defining the = eries in the ( ery o0tion7 In the

+ro 0 o0tion Hlace All the +ro 0s in the o0tion called Matri>+ro 0 Define the Hrint Direction for ( ery1 as down Define the Hrint Direction for ( ery$ as across Define the Hrint Direction for 2hild ( ery as cross tab 18+. 7ow /o 4o" exe "te a re2ort 0ro3 withi, a 0or3% .se the following command to r n a re0ort from the ?:RM. "ost CFr nre0 Sre05nameT termSterminal5ty0eT serid#S seridL0asswdTDK 1:.. What are ex2 a,/ i32 "ti!ities% ->0ort & Im0ort: / ->0ort tility is to write data from database to o0erating system files called ->0ort ?iles. An e>0ort does this by changing the data and table str ct res in to AS2II or -B2DI2 codes. Im0ort is a tility with which we can write the data from ->0ort file to database. ->0ort ?iles can be only read by Im0ort. RI+"!S R-S-RB-D BI D--HAJ SAM.-) J V ( estions and Answers ///////////////////////////////// ?:RMS 1.3 GGGGGGGGGGGGGGGGGGGGGGGGG 1. What are the /i00ere,t 3o/"!es o0 0or3s :.&% ?orms7 men s7 library. 2. What are the /i00ere, es 1etwee, 0or3s :.& a,/ 0or3s 8% ?orm 1.3: +.I ?orms '.<: 2 i database ob6ects7forms5ddl. 8. What is the 3axi3"3 !i3it 0or reati,5 1!o $s a,/ a,#as i, 0or3s :.&% .nlimited ?orms '.<: triggers C83D ?orms 1.3: triggers C1$1D :. I, a 3"!ti re or/ 1!o $ a, we ha#e a, ite3 /is2!a4e/ o, e% &. A0ter reatio, o0 1!o $ a, we ha#e reate a 1"tto, 2a!ette% %o <. What are the /i00ere, es 1etwee, 0or3:.& a,/ 0or3s 8.. with re5ar/s to 3aster /etai! re!atio,shi2 ex2!ai, a!! the 2ro2erties o0 3aster /etai! i, /etai!% :n clear details7 :n 0o0 late details in forms '.< for 1 child only one 0arent b t not so in forms1.3 =. What are the /i00ere, e t42es o0 tri55ers that wi!! 1e reate/ 0or 3aster /e!etes 2ro2erties s" h as iso!ate/? ,o, iso!ate/? as a/i,5% ?or non/isolated 1D :n/clear/details $D :n/0o0 late/details 'D :n/chec&/delete/master Cchec&s for e>istence for child recordD ?or isolated 1D :n/clear/details $D :n/0o0 late/details

?or cascading 1D :n/clear/details $D :n/0o0 late/details 'D Hre/delete 2oordination 0ro0erties aD Deferred by defa lt false A to= ery by defa lt false If deferred tr e7 a to= ery tr e/Tdefered with a to= ery "ere the child bloc& waits for na*igation once na*igated to7 A tomatically corres0onding child rows will be dis0layed. bD Deferred tr e7 a to= ery false/Tchild bloc& needs na*igation as well as e>0licit e>ec te = ery. cD Deferred false7 a to= ery tr e /Tin*alid as it has the same effect as that of first Cdeferred false7 a to= ery falseD Hre*ent masterless o0eration /Tif tr e witho t going to the master7 child rows canFt be mani0 lated.0re*ents any mani0 lation witho t master record. '. What is the /i00ere, e 1etwee, reati,5 a 3aster /etai! ,ew 1!o $ wi,/ow a,/ reati,5 re!atio,s a0ter reatio, o0 the 1!o $s% +. 7ow to set re!atio, 2ro2erties /4,a3i a!!4% Set5relation50ro0erty 1..7ow 3a,4 t42es o0 ite3s are there i, 0or3 :.&% ; 11.What are the different ty0es of list items and the triggers asso iate/ with the3% Ho05list7 2ombo bo>7 ! list When list changed7 When list acti*ated 12.Ca, we ha,5e a o!or o0 2"sh 1"tto,% %o 18.What is the si5,i0i a, e o0 other #a!"es i, 2ro2ert4 o0 he $ 1ox% .ser can gi*e a *al e7 which is not in chec&ed or nchec&ed %ot allowed Centry of other *al esD 18 what are the /i00ere,t t42es "sto3s ite3s a,/ the tri55ers asso iate/ with the3% :)-7 BBE.!rigger: When c stom item e*ent 1: What is the ra/io 5ro"2% Is a /"334 ra/io 1"tto, ,e essar4% What is the asso iate/ tri55er% 7ow to /isa1!e a ra/io 1"tto, /4,a3i a!!4% Set radio b tton 0ro0erty Cbloc& name.radio gro 0 name7 b tton name 7 enabled70ro0erty falseD When radio changed 1&.9or? whi h t42e o0 ite3s 3o"se ,a#i5a1!e 2ro2ert4? is a22!i a1!e% 2hec& bo>7 list bo>7 image item7 0 sh b tton7 radio b ttons 1< What is the /i00ere, e 1etwee, text ite3s a,/ /is2!a4 ite3% !e>t item can be na*igable7 dis0lay item can not be na*igated. 18.What is difference between single line te>t items and m lti line te>t items? 1'.What are the t42es o0 ite3s that are a!wa4s o,tro! ite3s% 0 sh b ttonCnot a*ailable in the base table items."ence they are control itemsD 1+.7ow to i,#o$e !o# /4,a3i a!!4% Show lo*7 list *al es 2..What /o !o# 0or #a!i/atio, /o whe, it is set tr"e% If other *al es other than c rrent listed *al es are entered7 it will not be acce0ted till a correct *al e is entered the list will be in*o&ed.

21.What are the #a!"es that a where !a"se a, re0ere, e i, !o#% Bloc&.item name7 0arameter7 global *ariable 22 What is the /i00ere, e 1etwee, !ist #a!"es a,/ show !o#% ?or list *al es we ha*e to attach the lo* to item ?or show lo* it is not needed Show lo* ret rn a Boolean *al e de0ending 0on that an o0eration can be ta&en 28.What is a re or/ 5ro"2% Di00ere,t t42es re or/ 5ro"2% 7ow to reate -"er4 re or/ 5ro"2 /4,a3i a!!4% Static7 = ery7 non = ery Design time/Tstatic7 = ery only ?or r n time yo can ha*e all the three 2: 7ow 3a,4 ,o. o0 o!"3,s that a re or/ 5ro"2 a, ha#e% Memory sho ld not e>ceed 41& 2& >i#e a, !i#e exa32!e where 4o" a, "se ,o, -"er4 re or/ 5ro"2% M lti record *alidation 2< what /oes 2o2"!ate 5ro"2 ret"r, whe, a -"er4 s" ee/s% Arg will be created dynamically it ret rns a n mber which m st stored in the *ariable of data ty0e n mber. 2=.7ow to ha,5e a !o# 0ro3 o,e re or/ 5ro"2 to a,other% Set lo* 0ro0erty7 get lo* 0ro0erty. 2'.What are the /i00ere,t t42es o0 a,#ases% Stac&ed7 content7 htb7 Btb 2+ Ex2!ai, raise o, e,tr4 2ro2ert4% In a content can*as a stac&ed can*as. 2ontent 0ro0erty: raise on entry / Ttr e when na*igation from the 0o0 0 bloc& is ret rned bac& to content bloc&70o0 sho ld be disa00ear and this content bloc& sho ld a00ear . 8..What are the o,te,t #iew% Base table *iew 81.What are /i00ere, es 1etwee, show;#iew a,/ re2!a e; o,te,t;#iew% 82.What are the /i00ere,t t42es o0 wi,/ow% A00lication window7 secondary window Styles/Tdialog7 doc ment De0ending 0on modal 0ro0erty if modal # tr e modal window if modal 0ro0erty false modal less window 2onsole window/T stat s7 message window a00ears at the bottom of the screen. 88. 7ow to /is2!a4 wi,/ow 2ro5ra33ati a!!4% Set5window50ro0erty Cwindow name7 *isible7 0ro0erty5tr eD Show5window Cwindow nameD 8:. To whi h t42es o0 wi,/ow re3o#e a, exit 2ro2ert4 is 3ea,i,50"!% ?or modal less window 8&.To? whi h t42e o0 wi,/ow the s ro!! 1ar? /o ,ot a22!4% Modal window 8< 7ow to s ro!! a wi,/ow /4,a3i a!!4% Set5window50ro0erty Cwindow name7 >7 yD 8= 7ow to resiEe a wi,/ow% ResiMe5window Cwindow name7 width7 heightD 8' 7ow to i, rease the siEe the wi,/ow /4,a3i a!!4% Set5window50ro0erty Cforms5mdi5window7 window5stat s7 ma>imiMeD 8+ What are the wi,/ow e#e,t tri55ers% When window acti*ated7 when/window/resiMed When/window/deacti*ated7 when/window/closed

:. What is the o,so!e wi,/ow% o, what wi,/ow it wi!! 1e /is2!a4e/% Ca, we ha,5e the o,so!e wi,/ow at r", ti3e% 2onsole window is the root window. %o dynamic assignment to root Window.where message line7 stat s line a00earing :1 De0i,e aG 2ro2ert4 !ass 1G 6is"a! attri1"tes what are the /i00ere, es 1etwee, 2ro2ert4 !ass a,/ #is"a! attri1"tes% 1.if 0ro0erty class7 *is al attrib tes are attached to a 0artic lar item or ob6ects7 *is al attrib tes ta&e 0recedence o*er 0ro0erty 2lass set5bloc&50ro0ertyCbloc& name7c rrent5record5attrib te7F*a nameFD !rigger can be written on 0ro0erty class dynamically BA can be attached to an ob6ect b t H2 can not be attached :2. 7ow to ha,5e a 6A /4,a3i a!!4% set5bloc&50ro0erty7set5item50ro0erty :8. I0 i ha,5e a 2ro2ert4 i, the 0ie!/? whi h is? atta he/ to a 6A what wi!! ha22e,% 2hanges from ser5defined to c stoms ::. What is !i1rar4% H) S() codes can be 0 t and hence can be attached to men s forms library itself. :&. What is /i00ere, e 1etwee, 2ro5ra3 ",its a,/ atta h !i1rar4% It is read only CA)D as it de0ends on the library all mani0 lations 2an be done :<.What t42es o0 re0ere, e a, i "se i, !i1rar4% name inCindirect referenceD :=. What are the /i00ere,t t42es o0 3e,"s% 0 ll down7bar men 7f ll screen :' 7ow to atta h 3e," i, the 0or3% ?orm 0ro0erties :+. 7ow to re2!a e 3e,"s /4,a3i a!!4% re0lace men Cmen nameD &..What are a!! the /i00ere,t t42es o0 3e," ite3s% Hlain7 radio7 chec&7 magic7 se0arator &1.I, whi h 2!at0or3 1a $5ro",/ 3e," are s"22orte/% ? ll screen &2 what are the /i00ere,t t42es o0 o/es we write i, 3e,"s% men 5start 0 code7men item code &8 what are the wa4s o0 re0ere, es 4o" wi!! 1e "si,5 i, writi,5 a 3e," o/e% &: What is a, a!ert% 7ow to ha,5e a, a!ert 3essa5e /4,a3i a!!4% What t42es o0 wi,/ow is a, a!ert% What is the 3ax ,o o0 har% Res0onse window7 modal window7 $<<7set5alert50ro0erty Can7 alert5message5 te>t7FmessageFDK 33 how many triggers are a*ailable in forms 1.3/T1$1 &< what is 0reeEe a,/ ", 0reeEe% !o see 0ro0erty of more than one ob6ect at a time &= what are the /i00 1et 5!o1a! #ars a,/ 2ara% +lobal /T$33& 0ara/T$ +lobal/T char 0ara/Tchar7 n m7 data7 rg7 date &' what are the o1Ce ts that i a,At reate i, the o1C,a#% Boiler 0late te>t7 bitma07 image7 and timer. &+ what /o 4o" 3ea, 14 o24i,5 a,/ re0ere, i,5% 2o0ying /Tno 0dating in the main Refer/T 0dating ta&es

<. whe, 4o" o24 a re0ere, e/ o1Ce t what wi!! 1e a res"!ta,t o1Ce t% Referenced ob6ect <1 how to re"se 2!s-! o/es% By either 0 t it in lib or 0ro0erty class triggers <2 how to "se //! st3ts. i, 0or3s :.&% ?orms5ddl CDK <8 /is "ss 1rie0!4 a1o"t 3"!ti 0or3s 0", tio,a!it4% Restricted 0roced res/To0en form7 new .nrestricted 0roced res/Tcall form <: how 3a,4 s4ste3 #ars are there i, 0or3s :.&% 1$ <& what /oes the s4s;3o"se;1"tto,;2resse/ s4s #ar /o% Will ret rn the b tton *al e Cleft or rightD << what is s4s #aria1!e that is "se/ to /eter3i,e the "rre,t 3o/e% System.mode ty0es: normal7 = ery7 enter = ery Calways within = otes and ca0sD <= what are the #ario"s ate5ories o0 tri55ers ex2!ai,% <' what are the /i00 t42e o0 e/itors% Systemdefined Cnote0adD7 serdefined7 defa lt. <+ what is /i00 1etwee, e/it;text;ite3 a,/ show;e/itor% ?irst one m st be attachedK second there is no need =. how 3a,4 1"i!t-i, 0", tio,s a,/ 2ro e/"res a#ai!a1!e i, 0or3s :.&% 13<. =1 what are the tri55ers that are #a!i/ i, e,ter -"er4 3o/e% Jey/triggers7 on/error7 on/message7 in when triggers e>ce0t When/database/record7 when/*al/item7 when/*al/rec =2 what /oes the 2ro2ert4 a!!e/ se "re% What wi!! ha22e, whe, it is set tr"e% ?or 0asswords settings at item le*el =8 what /o 4o" 3ea, 14 ow,ershi2? #is"a! #iews% =: how to ha,5e /e0a"!t where a,/ or/er 14 !a"se /4,a3i a!!4% 1.set5bloc&50ro0erty Cblname7 defa lt5where7Fem0no T1<<<FDK $.set5bloc&50ro0erty Cblname7 order5by7Fitemorcol mnFDK =& how to 3o/i04 /e0a"!t ,a#i5atio, se-"e, e% In 0ro0erty of any item7 na*igation@s 0ro0ertyFs. If at bloc& ne>tna*igation bloc& 0ro0erty. 84 what is all the 0ro0erty of items that yo can *alidate witho t Writi,5 tri55ers% defa lt *al e7range7data ty00e7re= ired70rimary &ey etc.7 == ex2!ai, /etai! a1o"t /e1"55er% 89 if yo are sing 0roced res created in libs7 database7 formle*el whi h wi!! a/#a,ta5eo"s% )ibs 8; com0are 0ost/fetch trigger 0ost/= ery trigger7 0ost/forms/commit7 Host/database/commit7 0re/= ery 0re/select 9< aD if I ha*e a 0& in the table and while creating a bloc& and if I :n constraint o0tion what trigger will be created? When/*alidate/item

1G I0 itHs a o32osite 2$ what tri55er is 5e,erate/% When/*alidate/record cD If I ha*e 0&7 f& in table and if I on the constraint o0tion What trigger will be created? When/remo*e/record

R-H:R!S $.3 GGGGGGGGGGGGGGGGGGGGGGGGGGGGG '1 what are the /i00ere,t t42es st4!es o0 re2orts% Matri>7 tab lar7 forms7 form letter7 mast/debt7 and mail. '2 how 3a,4 5ro"2s are re-"ire/ 0or a 3atrix re2ort% ' '8 what are the ste2s i,#o!#e/ i, reati,5 a 2a5ewise s"33ar4 o!"3,% 91 e>0lain defa lt layo t7 layo teditor '& what is a, exter,a! -"er4% '< thro"5h whi h o1Ce t 4o" are esta1!ishi,5 !i,$ 1etwee, 5ro"2s% Datalin& '= what is 0or3"!a o!"3,? 2!a eho!/er o!"3,% '' what is a, hor% '+ what is a 2ara3eter% Di00ere,t t42es o0 2ara3eters% Tri55er asso iate/ with the3% )e>ical7 bind7 system +. a, we "se //! state3e,ts i, re2orts 2.&% +1 what is a /ri!! /ow, re2ort% +2 tri55er asso iate/ with 2"sh 1"tto,% When/b tton/0ressed +8 what are the /i00 t42es o0 re2ort tri55ers% List the se-"e, e i, whi h the4 0ire% ;1 can I se dml stmts. in format triggers? ;3 what is the significance of gro 0 filter trigger? ;4 how to control the n mber of records retrie*ed? ;8 can we refer to col mn *al es in re0orts? +' i, the ta1!e I ha#e a #a!"e 0or e,a3e as A!!e, 1"t I wa,t to (ri,t it as BBBB i, the 2re#iew s ree, 2ri,ter is it 2ossi1!e i0 so how% Set5item50ro0erty CFitnaF7 sec re7 0ro0erty5tr eDK ;; I want three records to dis0layed in a 0age? 1.. how to i,te5rate re2orts 2.& with 0or3s :.& how to 2ass 2ara3eters 0ro3 0or3s to re2orts% R n50rod ct CDK GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG ORACLE NON-DBA 9AQ I9re-"e,t!4 As$e/ Q"estio,sG /////////////////////////////////////////////// !AB)- :? 2:%!-%!S #################

1. +-%-RA) (.-S!I:%S 1.1. What is :racle? 1.$. What are the ad*antages of :racle? 1.'. What are 0otential disad*antages of :racle? 1.1. What is S()? 1.3. What is H)LS()? 1.4. What is Hroced ral :0tion? 1.8. What 0rod cts are a*ailable from :racle? 1.9. What H blic Domain interfaces are there? 1.;. What third 0arty interfaces are a*ailable? 1.1<. "ow 0ortable is :racle a00lications to other RDBMS? 1.11. What ( ery :0timiMers are there? 1.1$. Is there an anonymo s ?!H site for :racle st ff? 1.1'. What mail lists are there? 1.11. What b lletin boards are there? 1.1&. What ,ews 5ro"2s are there% 1.14. "ow does :racle com0are to...? $. S() (.-S!I:%S $.1. "ow can I a*oid a di*ide by Mero error? $.$. 2an I 0date tables from other tables? $.'. 2an I remo*e d 0licate rows? $.1. 2an I 0date sing a *iew? $.3. Are *iews a tomatically 0dated when I 0date base tables? $.4. Sho ld we se com0le> *iews that cr el 0erformance? $.8. 2an I im0lement tree/str ct red = eries? $.9. "ow can I get information on the row based on gro 0 information? $.;. "ow can I get a name for a tem0orary table that will not clash? $.1<. "ow can I find o t abo t what tables7 col mns and indices there are ? $.11. Is there a formatter for S() statements? $.1$. What is the D.A) table? $.1'. What is the difference between 2"AR and BAR2"AR? $.11. What is R:W%.M good for? $.13. "ow do I get a to0 ten? $.14. "ow can I control the rollbac& segment I se? $.18. "ow can I order a nion? $.19. "ow can I rename a col mn? $.1;. Who are S2:!!L!I+-R7 SIS!-M and SIS? $.$<. Who do *ario s access methods com0are? $.$1. What are cl sters? $.$$. "ow can I 0date a big table witho t blowing rollbac& segments? $.$'. Why donFt I get records for the date I want? '. S()GH).S (.-S!I:%S '.1. "ow can I control the start 0 config ration of S()GHl s? '.$. 2an I get a col mn *al e into a s bstit tion *ariable? '.'. "ow can I change the Chated defa ltD editor to my fa*orite? '.1. What is the difference between & and &&? '.3. What is the difference between ,host, and ,WX? '.4. Why canFt I se a table name in a s bstit tion *ariable? '.8. "ow can I see all of a ):%+? '.9. "ow can I force a col mn to begin on the left of the 0age? '.;. 2an I alias S() commands? '.1<. 2an I esca0e significant 0 nct ation mar&s? 1. S()G?:RMS ' (.-S!I:%S 1.1. "ow can I get a list of *al es from a hard coded list? 1.$. "ow can I get find to loo& at descri0tion with list of *al es? 1.'. 2an I edit S()G?orms code with my te>t editor? 1.1. 2an I edit S()G?orms code by 0dating the database? 1.3. Why canFt I see data in a control field? 1.4. Why is my terminal scrambled in a ser e>it? 1.8. What ha00ens to ):%+s? 1.9. What are ser/written form le*el f nctions? 1.;. "ow can I se reg lar e>0ressions for field *alidation? 1.1<. What is a ser/e>it? 1.11. "ow can I call a 0o0 0 window for field *alidation?

3. S()G?:RMS 1 (.-S!I:%S 3.1. What new feat res can be e>0ected in forms 1 generator from 2AS- ? 3.$. What new feat res can be e>0ected in forms 1? 4. HR:G2 (.-S!I:%S 4.1. Why are my 2 *ariables o*erwritten? 4.$. 2an I se 2 0re0rocessor definitions for BAR2"AR siMe? 4.'. What can I do abo t ,line too long, errors with *ersion control? 4.1. Why do my com0iles crash or weird things ha00en? 4.4. "ow do I se :HSYlogin? 8. 2AS- (.-S!I:%S 8.1. 2an 2AS- generate forms with owner 0ro0o nded to table names? 8.$. 2an 2AS- generate B8 databases? 9. .%IE (.-S!I:%S 9.1. 2an I create a com0ressed e>0ort on the fly witho t needing to ha*e the s0ace for both the e>0ort file and the com0ressed file? 9.$. "ow can I 0re*ent trailing s0aces in a s0ooled re0ort? 9.'. "ow can I get an en*ironmental *ariable into S()GHl s *ariables? 9.1. 2an I 0i0e st ff thro gh S()GHl s? 9.3. Why does HroG2 com0iles or 0rograms crash on my S n? '.<. 7ow a, I 0i,/ a !ost Ora !e ex2ort 0i!e% 9.8 "ow can I tell ma&e abo t S()G?orms? ;. MIS2 (.-S!I:%S ;.1. "ow can I alter table storage 0arameters from an e>0ort file? ;.$. What ma&es the best :racle ser*er for a networ&? ;.'. "ow can I im0lement *ersion control? ;.1. What boo&s are a*ailable abo t :racle? 1. +-%-RA) (.-S!I:%S 1.1. What is :racle? :racle is a trademar& of :racle 2or0oration and in common sage refers to the database engine Cwhich act ally loo&s after the dataD and a range of front/end 0rod cts. :racle is the largest selling S() based RDBMS and on the whole7 is in my o0inion7 the most commercially sef l. Ma6or com0etitors to :racle incl de: DB$ CIBM 0latforms onlyD Informi> Ingress Sybase :thers worth noting incl de Interbase from Borland C.ni>LMS/D:SD sh=l Cfree .%IE tool wor&s li&e ingress is=lD *ario s >base 0rod cts Hostgres CStonebra&erFs other wor& / free b t ns 00orted e>ce0t for the %et / which is abo t the same as commercial s 00ort anywayD. It is GnotG to be conf sed with the :racle of Del0hi7 which led the mar&et in e>ec ti*e information systems in the ancient world .ntil abo t 8 B2. !he chief data analyst Cthe HythiaD wo ld get off her s& ll on steam and )a rel lea*es and m tter gibberish CSaid ( i>otically on )a rel7 S() for shortD which was then translated by 0riests in an ambig o s manner in order to 0lease the end/ ser and th s e>tract a hefty donation. Hrobably the most famo s bit of management information was to 2roes s7 CJing of )ydia and &nown in the 0hrase ,as rich as 2roes s,D7 when he recei*ed the ad*ice ,If yo attac& the Hersians7 yo will destroy a great em0ire,. Well7 he did attac&7 and lost his own em0ire. !hereFs a moral to this story I thin&... 1.2. What are the a/#a,ta5es o0 Ora !e% a. Hortability :racle is 0orted to more 0latforms than any of its com0etition7 r nning on more than 1<< hardware 0latforms and $< networ&ing

Hrotocols. !his ma&es writing an :racle a00lication fairly safe from changes of direction in hardware and o0erating system7 and therefore a safe bet. :ne ca*eat7 howe*er7 is that a00lication sing some constr cts Cs ch as field le*el triggersD may ha*e to be rewor&ed when 0orting them to a bloc& mode en*ironment. Io can also de*elo0 a fairly f lly feat red a00lication with little &nowledge of the nderlying :S. Hersonally7 I ha*e de*elo0ed a00lications on :S systems barely &nowing how to co0y and edit te>t files. b. Mar&et Hresence :racle is by far the largest RDBMS Bendor7 and s0ends more on R&D than most of its com0etitors earn in total re*en e. :racle has the largest inde0endent RDBMS mar&et share in BMS7 .%IE and :SL$ Ser*er fields. !his mar&et clo t means that yo are nli&ely to be left in the l rch by :racle and there are always lots of third 0arty interfaces s 00orted and also7 0roficient staff are relati*ely easy to get. c. Bersion 2hanges :racle seem *ery good at informing yo in detail as to what is not going to be s 00orted in the ne>t ma6or release and s ally ha*e some &nob yo can twiddle for good bac&ward com0atibility7 or sim0ly lea*e it wor&ing7 b t with ,donFt se this7 se >>>> instead, warnings in the man al. Bac&ward com0atibility is *ery good meaning yo will not be in for an a00lication re/write when Io 0grade the DBMS. P2om0are this with the Ingress *3/4 :S() 0grade from hell.Q IF*e wor&ed with :racle since B1 Beta and ha*e ne*er been in for nasty s r0rises as far as synta> goes. "owe*er7 see ,Bersion 2hanges, nder disad*antages. d. Bac& 0 and Reco*ery :racle 0ro*ides ind strial strength s 00ort for on/line bac& 0 and reco*ery and good software fa lt tolerance to dis& fail re. Io can also do 0oint/in/time reco*ery. :f co rse7 yo need the archi*e mechanisms and storage s0ace to do this7 b t :racle s 00orts contin o s archi*ing to ta0e de*ices s0anning m lti0le *ol mes. e. Herformance S0eed of a Gt nedG :racle database and a00lication is = ite good7 e*en with large databases. :racle refer to 1<< +B databases and I ha*e 0ersonal e>0erience administering 1< +B databases. !he 0erformance is not only ,raw,7 b t incl des consideration of 0erformance with loc&ing and transaction control. f. 2 rsor S 00ort :racle7 li&e Ingress7 b t nli&e Sybase C ntil Release 1< I thin&D7 s 00orts c rsors7 which ease 0rogramming when 0erformance is needed. A c rsor basically lets yo do row/by/row 0rocessing. :racle s 00orts m lti0le c rsors 0er :racle connection in line with A%SI standards. g. S() Dialect !he dialect of S() offered by :racle is in my o0inion s 0erior to the others in the e>tensions it offers o*er A%SI/$7 which is *ery m ch a lowest common denominator. 2onstr cts s ch as the absol te f nction and decode &eyword are *ery 0owerf l :racle additions to the standard S(). h. M lti0le Database S 00ort :racle has a s 0erior ability to manage m lti0le databases within the same transaction sing a two/0hase commit 0rotocol. !his is best im0lemented in B8. Io can fairly easily mo*e where data is act ally stored from node to node in a networ& and ha*e data mirroring7 ma&ing it easy to o0timiMe the location of the data from time to time. !his is not so easily done with offerings from other *endors or earlier *ersions of :racle7 where yo were not able to 0date more than one database in the

one transaction with any reliability. !his meant that yo co ld not mo*e data aro nd witho t recoding yo r 0rograms. With B87 yo r DBA can o0timiMe the location witho t 0re/0lanning by Hrogrammers or re/e>amination of the code 0rior to the mo*e. i. H)LS() H)LS()7 the 0roced ral e>tensions7 is a draft A%SI standard for 0roced ral DBMS lang ages. See main disc ssion on H)LS(). 6. Declarati*e Integrity :racle B8 s 00orts declarati*e database integrity Cthe c rrent A%SI standardD and B4 0ermit yo to enter the declarations. With B47 yo can get the toolset Cs ch as S()G?orms 'D to read the declarations and a tomatically generate the re= ired code. With B87 not e*en this is re= ired7 as the database engine a tomatically enforces the integrity. !his means that yo can o0en 0 yo r database to end/ sers thro gh sim0le third 0arty interfaces as they sim0ly cannot brea& yo r b siness r les e*en e*en if they try. It ma&es it easy to administer changes in b siness and data r les as there is only one s0ot where the change needs to be made. !his lowers the cost of re= ired modification to the system beca se yo do not ha*e to edit all a00lications code that wor&s with the table. It is reasonable to e>0ect :racle to release the first S()/;' im0lementation at near/f ll com0liance. As one DBA noted on the net recently ,With :racle B9 IFll be o t of a 6ob beca se e*erything will be in the file,. 1.8. What are 2ote,tia! /isa/#a,ta5es o0 Ora !e% 2ost. :racle isn@t chea0. At least before yo consider costs of 0orting7 0rogrammer a*ailability7 etc7 etc. Remember7 yo will almost certainly need a f ll/time DBA. +ood DBAFs are not chea07 b t are worth their weight in gold. Io will also need training for 0rogrammers and DBAFs. Again7 not chea07 b t sho0 aro nd / both for the cost of the co rses and for the content. :racle are not the only 0eo0le who gi*e :racle training7 and often a smaller cons ltancy can tailor a co rse for yo r needs and still be chea0er 0er training ho r 0er 0erson. If yo are getting an a00lication from a BAR7 the :racle com0onents can often be obtained at a good 0rice. :racle is not Cc rrentlyD as ob6ect/oriented as some of the com0etition. Im0lementation on some systems betrays the heritage of the system it was de*elo0ed on Ce.g. Mail R--JS of BMSD and can be 2o nter/int iti*e to 0rogrammers sed to their Cnon BMS or non .%IED :S. :n some systems7 0erformance is not what yo wo ld Cor were led toD e>0ect7 so yo may need to 0grade yo r system. C!he moral of this story is se systems that are ine>0ensi*ely scalableD. Voel notes 0artic larly that IBM ;'8< im0lementation is slow. C"ey7 so is that news to s .%IE ty0es?D While = ite a few 0eo0le ha*e commented on b ggy code7 0oor im0lementation7 different &eystro&es for different hardware7 etc CAll of which ha*e some 6 stificationD7 this is in my o0inion generally a bit harsh. S re7 when com0aring :racle to more single/minded systems s ch as a com0iler or 0rogrammer tool7 :racle comes of 0oorly in = ality. B t7 remember yo are tal&ing abo t a large system and com0are :racle to other RDBMS systems and yo Fll find it act ally isnFt too bad. V st ma&e s re the DBA r ns each new release in a s0are area for a while... Bersion control of ,so rce, for yo r a00lications in some editable AS2II files. See the section on *ersion control. 0rod cts is 0ainf l where yo do not ha*e

Bersion changes can gi*e yo nasty s r0rises. :J7 so this affects e*eryone7 b t there ha*e been a few ,0atches from hell,.

CAs& any BMS DBA who a00lied B45'4 or thereabo tsD. Hersonally I generally start feeling comfortable aro nd B>.<.13 b t m ch 0refer B>.1D. "istorically7 sales staffs were more 0rone to hy0erbolae than yo r garden *ariety mar&etroid and technical s 00ort was 0oor. !his has im0ro*ed. Still7 installation and 0grade scri0ts ha*e co00ed a GlotG of flac& in the newsgro 0 and I m st admit to re= iring a second 0ass at this sort of st ff7 with a decent browse Cand hac&D thro gh the install scri0ts in the meantime. V st as well I had dis& and time to s0are that wee&end... Also7 there has been = ite a bit of criticism7 at least here in :M7 of the way :racle do not inform yo abo t im0ortant 0atches to the RDBMS ntil yo ring s 00ort with a 0roblem...meanwhile yo r data 6 st got corr 0ted. A00ly 0ress re to yo r s 00ort re0resentati*e to im0ro*e the sit ation. 1.:. What is SQL% S() Coften 0rono nced S-(.-)D formally stands for Str ct red Cor StandardD ( ery )ang age. In common sage7 howe*er7 it also encom0asses the DM) CData Mani0 lation )ang age / for inserts7 0dates and deletesD and DD) CData Definition )ang age / for str ct ring tablesD. !he basic idea of S() is to acce0t and 0rocess re= ests for the information yo want witho t yo &nowing how to e>tract it Cli&e yo do for networ& databasesD. S() is %:! the only lang age a*ailable for = erying relational databases / the first *ersions of Ingress sed ,( el,7 which had some ad*antages o*er S(). Still7 S() came from IBM7 im0lemented nicely by :racle and became the de facto standard. S() is the s b6ect of international standards. S()/98 is c rrently the lowest common denominator for most DB engines7 b t li&e any lang age7 each *endor 0ro*ides e>tensions to Cand occasionally changes and omissions fromD the standard ... S()/;'7 still draft7 handles 0roced ral e>tensions. 1.&. What is (L@SQL% H)LS() is a gro 0 of 0roced ral e>tensions to the S() lang age and is a*ailable to S()G?orms C'.< and abo*eD7 S()GRe0ortWriter C$.< and abo*eD and S()GHl s C'.< and abo*eD. Hroced res written in this lang age are a*ailable to be stored in the database from *ersion 8 of the core 0rod ct. 2 rrently7 an A%SI committee is s0ecifying 0roced ral e>tensions to S()7 and incl ding these in S()/;'. :racle H)LS() was acce0ted as the first draft. S()/;' is still at wor&ing draft stage7 b t the = ic& read I ha*e had of it loo&s li&e fairly standard H)LS() with a few e>tra statements thrown in. B!W7 the s0ec is c rrently o*er 1J 0ages and GnotG bedtime reading nless yo li&e browsing a cross between legalese and B%?W 2ome to thin& of it7 e>cellent bedtime reading if yo are an insomniacW -arly *ersion of H)LS() co ld ha*e no direct IL: with the 0rocess sending it to the ser*er. ?orthcoming *ersions do. 1.<. What is (ro e/"ra! O2tio,% !he 0roced ral o0tion to :racle B8 0ermits yo to define database triggers Ce.g. a 0roced re to carry o t when a record is 0dated7 for e>am0leD and se DBMS HIH-S7 where an e>ternal 0roced re can effecti*ely be called from one of these triggers. !hese triggers are written in H)LS(). An e>am0le is as follows: create or re0lace trigger MI5!RI++-R after 0date on MI5!AB)?or each row begin If 0dating CFMI5S2A)ARFD then

Insert into MI5A.DI!5!B) C A.DI!5J-I7 BA)5%:W7 BA)5HR-B7 DI??7 D!7 W":D Bal es C MI5J-I7 : new. MI5S2A)AR7 : old. MI5S2A)AR7 : new. MI5S2A)AR /: old. MI5S2A)AR7 Sysdate7 .serDK -nd ifK -ndK %ote the new &eywords ,new, and ,old,. !his is similar to B4 and ,!ransaction Hrocessing :0tion,. Basically it contained most of the ,goodies, of the new *ersion and was licensed Yerately. !he !H: incl ded se= ences and the ability to r n H)LS() at the bac& end. 1.=. What 2ro/" ts are a#ai!a1!e 0ro3 Ora !e% A0art from the core engine and cons ltingLed cation ser*ices... !his list is %:! e>ha sti*e. If I ha*e missed anything7 let me &now7 0referably with a = ic& re*iew. 1. S()GHl s Jnown in days of yore as .?I C.ser ?riendly InterfaceD7 this is the basic ,shell, for = eries7 basic re0orts and database mani0 lation. It can be sed interacti*ely or dri*en from scri0ts. It is a m st/ha*e7 as installation re= ires scri0ts to be r n thro gh this interface and most general administration by 0rogrammers will be carried o t thro gh it. A0art from the basic ability to iss e S() and H)LS() commands7 it has a n mber of e>tensions to 0ermit 0rogramming C0arameter 0assing7 *ariables7 0rom0ting for ser in0 t7 etcD and re0ort formatting. It o0erates identically across all 0latforms. $. S()GDBA A ser/ nfriendly *ersion of S()GHl s with e>tra 0ower for DBAFs. !he history editing facilities of S()GHl s ha*e been remo*ed so that yo do not s0end all yo r time in a 0rod ct that has e>tra Cneeded b t dangero sD ca0abilities to do things li&e start 0 and sh t down yo r database. It also has general 0erformance monitoring facilities. :racle 4 S()GDBA is mainly line oriented b t has a screen oriented 0erformance monitor. :racle 8 S()GDBA is entirely screen based by defa lt Caltho gh yo can in*o&e it as follows to get line modeD s=ldba lmode#y '. S()G%et %eeds to r n on H2Fs and MacFs before yo can access :racle on other machines. Most mid/range and larger machines ha*e it as 0art of the core 0rod ct. %eeds to be sed on A)) machines to comm nicate across 0latforms or *ia a networ&. It is a se0arately licensed 0rod ct for .ni>7 MS/D:S and Macintosh *ersions and yo need both com0liant *ersions to comm nicate between a client Cwhich can be an RDBMSD and a ser*er

Cwhich m st be an RDBMSD. %ote that if yo are r nning mess/Windows7 yo can get into real diffic lty as the S()G%et dri*er cannot handle two c rsors ret rning data the same instant / mainly beca se windows is not tr e m lti/tas&ing. CBro&en As Designed?D. Mind yo 7 S()G%et *$ is o t soon and e*en gets o*er the 0roblem of :HSYlogins when yo do not act ally log in to the :racle ser*er. 1. S()GAsync +i*es f nctionality of S()G%et b t o*er a dial 0/ty0e line. 3. S()G2onnect S() Based DBMS +ateways 4. :0en +ateway S() based and Hroced ral based DBMS +ateways 8. %et Interchange Software Hrotocol 2on*erter 9. S()G?orms A de*elo0ment tool for screen based a00lications that allows code to be stored in database tables. Bersion '.< and abo*e se H)LS() for 0roced ral 0arts of the code. Bersion 1 is coming o t and has S()GMen facilities b ilt/in. ;. S()GRe0ortWriter "el0s write re0orts and li&e ?orms7 0ermits so rce code to be stored in the database. Bersion $7 soon to be released7 incl des triggered e*ents7 the ability to 0date the database and ses H)LS(). Bersion 17 on the other hand7 is 0erha0s the one :racle 0rod ct tried and discarded by most sites. Des0ite im0ro*ements7 Bersion $ loo&s to be getting the same re0 tation. 11. :racleG2ASA nifty set of data dictionary Conce &nown as SDDD and design tools that let yo model yo r database and 0rocesses and then generate reasonable first c t forms7 etc from the definitions. !he design sides need a +.I for model dis0lay. !his 0rod ct is good7 li&e anything o t of the :racle .J gro 0 that sed to be an inde0endent com0any that :racle 0 rchased. Bario s re*iewers ha*e commented that while there are ,me too, modeling and design tools7 Cand of co rse7 no others ta&e ad*antage of :racle/s0ecific enhancementsD7 :racleG2AS- has the best ca0ability to re*erse engineer e>isting :racle a00lications bac& into the modeling dictionary. R mor has it that :racle .J are c rrently wor&ing on e>tending this 0rod ct to incl de 2AS- for lang ages li&e 2 et al. 11. S()GMen A s ite of tools that allows the de*elo0er to enter men details into a database and generate a men from it. It integrates well with the other :racle tools and has the ca0acity to 0rod ce = ite sef l end/ ser doc mentation. :ne nice feat re is that a n mber of different men a00earances Cf ll screen7 0 ll down7 lot s ring/li&eD can be generated from the same in0 t s0ecifications. :bsolete with S()G?orms 1.

%early e*ery DBA who has had to install S()GMen Con .%IE 0latforms at leastD that I ha*e s0o&en to had a hard time. :nce that is done7 howe*er7 it is easy to loo& after. 1$. :racleG2ard "el0s de*elo0 "y0er2ard li&e a00lications in Windows and Mac en*ironments. 1'. :racle +l e "el0s de*elo0 a00lications nder MS/Windows that se things li&e ->cel and Bis al Basic7 i.e. an AHI for DD- a00lications. It th s com0etes against the forthcoming Microsoft :BD2 AHI. S n and Mac *ersions of +l e are forthcoming. 11. S()G+ra0h Hre0ares gra0hs from :racle data. 13. S()G)oader )oads data from flat files into :racle. Data can be loaded into more than one table at a time Ce.g. if yo r incoming data is in the format of a master record followed by a n mber of detail recordsD. 14. RH!LRH? An ancient re0orting tool with a synta> li&e r noff that beca se of its ability to 0erform 0dates7 is still sed by some batch 0rocesses where its 0roced ral ca0abilities are sef l7 es0ecially where H)LS() is not necessarily a*ailable and the de*elo0er does not want to 0 t S() in a com0iled lang age li&e 2. Io need this for some as0ects of :racleG2AS-. !he RH! 0art is the 0rogram which goes thro gh the tables and feeds data to the RH? Cformatting 0artD. If yo are sing this for re0orts yo need more than a fair share of dis& for tem0orary files7 es0ecially if the RH! 0art m st finish before RH? can start the formatting and there is a lot of data to 0rocess. It has ad*antages o*er S()GRe0ortWriter in that the code is AS2II and ".MA% R-ADAB)-7 and can th s be 0 t nder *ersion control tools. Also7 it is a lot faster than S()GRe0ortWriter and can be altered m ch = ic&er than wading thro gh a mPaeQss of men s. Act ally7 my earliest comments abo t RH!LRH? were 0ercei*ed as somewhat dismissi*e7 and generated = ite a lot of ,fan/mail, for this 0rod ct. 18. HroG27 HroG2:B:)7 HroG?ortran... Hrecom0ilers that let yo embed S() statements into a standard lang age witho t GtooG m ch tro ble. While there are other means of accessing :racle from lang ages s ch as 2 Cthe :2I for e>am0leD7 these interfaces are fairly low le*el and sho ld 0robably only be sed when yo are being fairly so0histicated. While I cannot comment abo t lang ages other than 27 the 2 code that comes o t of the HroG2 0recom0iler is %:! really editable. Anyway7 some of the f nction calls generated are s0ecific to libraries that are 0art of the HroG2 0rod ct. !h s ta&ing the generated 2 code to a site witho t a HroG2 license is 0robably not a good thing to do. 19. DataG( ery A fairly new 0rod ct that 0ermits yo to generate re0orts fairly easily. !he nice thing abo t this Cagain from :racle .JD is that if yo ha*e 0 t constraints into the dictionary7 then this will 0ic& 0 those relationshi0s7 so yo do not ha*e to constantly s0ecify the lin&ing field between the -MH and D-H! tables7 for e>am0le. It will also do brea& 0rocessing and allow yo to define calc lated fields easily so yo do not ha*e to rety0e them all the time. A s ite of tables are &e0t internally7 0ermitting sers to ha*e easy access to their own = eries and with the ability to share = eries among sers.

:ne nice feat re for administrators is the ability to set a timed brea& on ser = eries to 0re*ent ,r n/away, = eries being generated. !here are still some limitations 0on the n mber of tables that can be 6oined together7 b t DBA management of some a00ro0riate *iews wo ld sol*e this 0roblem. 1;. DataGBrowser R nning nder a window this gi*es gra0hical and analysis ca0abilities according to one re*iewer and is 0retty good. $<. Boo& Biewer "y0ermedia a00lication creating and *iewing $1. co/a thor A grammar chec&ing .tility $$. :racleGMail and 2alendarLSched ler -/mail sing :racle to gl e systems together across architect res. Betrays a BAE BMS heritage. Hrobably not a bad idea7 sing :racle to gl e together a mess of different architect res for mail7 b t why wo ld yo want to do that when there are other common standards for mail messages that will still wor& witho t needing :racle 0 and r nning? ?or many common networ&s7 s ch as those made of D:S7 :SL$7 Mac7 .%IE and BMS bo>es7 if all yo want is a common mail facility7 there are 0robably better alternati*es. A similar a00lication 0ro*ides office calendar information and is 0ac&ages with :racleGMail as :racle :ffice. $'. :racleG?inancials A BI+ 0rod ct with mod les for acco nting7 h man reso rces7 etc. If yo are a large com0any7 worth considering if yo ha*e lots of dis& and cash to s0are. -*en :racle admit that if yo are not a large com0any7 it is not worth 0 tting on yo r short list. It is re0orted to cost abo t Y$<J 0er ser. $1. :racleG!e>tRetrie*al )ets yo access te>t doc ments sing = eries. %e>t release C$D will s 00ort storage of common H2 and Mac formats Ce.g.MesS/Word and WordHerfectD. 2an do &eyword searches. $3. ->0ort and Im0ort !hese 0rod ce files that can be migrated across architect res and can 0rod ce archi*es of a selection of tables7 sers and or indices. $4. :racleG!erminal !erminal s0ecification tility7 that re0laced the 2R! s ite sed by ?orms $.'. )ets yo ma0 logical &ey names7 &ey hel0 and dis0lay attrib tes to c stom esca0e se= ences. :ffers m ch more 0ower than 2R!7 b t most of s DBAFs co ld dri*e 2R!. If Re0ortWriter is the least sed beca se of its limitations7 !erminal is the second least sed7 beca se the doc mentation is limited and it is hard to see how it all hangs together. Hlease someone7 send in some hints. $8. :racleGAlert )ets yo define certain conditions that when met trigger an e*ent7 s ally an :racleGMail message7 to someone. ?or e>am0le7 if monthly sales go to low7 fire off a message to the sales manager. $9. S() Mod les 2 rrently in beta is the B1.< s 00ort for :racle in host lang ages not incl ding -mbedded S() b t according to A%SI Standards. B1.< re= ires :racle B8.1 and is sched led for 0rod ction with 8.1 0rod ction *ersion.

)ang ages s 00orted will be Ada7 27 2:B:) and ?:R!RA% and follows the 1;9; A%SI standards with some of the low/le*el 1;;$ standard. Also lets yo call stored 0roced res. )imitations are one S() statement 0er 0roced re7 no DD)7 no dynamic S()7 no m lti0le conc rrent connections. ? ll CishD S();$ e>0ected with B$.<. .... It sho ld 0robably be noted that :racleG?orms C1.<D7 :racleGRe0ortWriter C$.<D7 :racleG+ra0hics C$.<D7 and :racleGMen will be all integrated together into one large :racleG!ools 0ac&age7 the 2D- CI thin& it stands for 2ommon De*elo0ment -n*ironmentD. :racle B8 needs a ,0roced ral o0tion, for database triggers7 etc. :racle 8.1 has been anno nced and will incl de Harallel ( ery and M lti/Media e>tensions. Al0ha %ow7 Beta mid year7 Hrod ction end of year. :racle 9 is slowly being re*ealed and will incl de :b6ect :riented e>tensions7 and s0ecialiMed ser*ers for images7 *ideo7 so nd7 te>t7 and S() RDBMS. )oo&ing at the S()/;' s0ec will gi*e yo a glim0se at the way this will mo*e // abstract data ty0es are defined7 etc. 1.'. What ("1!i Do3ai, i,ter0a es are there% %ot H blic Domain b t free incl de *ario s tools that :racle will distrib te GwhenG yo as& for them. !hese are tility scri0ts written by the :racle Herformance +ro 0 .J. I was gi*en them and told that they were co0yright by :racle b t freely distrib table. !hey do things li&e ta&e sna0shots of internal SIS.BYG tables Cone set for B47 one for B8D7 analyMe forms $7 libraries of mathematical f nctions for forms '. It incl des a *ersion 4 database defragmenter in HroG2K CB8 a tomatically defragsD. It is s ally distrib ted as a .%IE tar file on a D:S flo00y names dostools.tar. !hird Harty ?reebie !ools a*ailable incl de... 1. :ra0erl !he :ra0erl 0atches to 0erl are a*ailable from com0.so rces.misc archi*es and were written by Je*in Stoc&. !hese 0atch 0erl from )arry Wall Csee +%. or com0.so rces. ni> archi*es and 2om0.lang.0erl newsgro 0D to gi*e it access to :racle at a fairly basic le*el7 0ermitting yo to e*en ha*e sim ltaneo s connections to one or more databases Ce.g. nder different :racle loginsD. !he 0erl lang age is a*ailable Cas far as I &nowD for .%IE7 BMS7 D:S7 :SL$ and Macintoshes and is a cross between the .%IE shell and 27 and gaining ra0idly in 0o0 larity. :ne ma6or ad*antage is that it ma&es many 2 libraries a*ailable for se in an inter0reti*e scri0t lang age7 and is th s more 0owerf l than the shell. :ne of the sef l things that comes with :ra0erl is a scri0t that ta&es an S() statement from a command line and e>ec tes it. Another sef l scri0t ta&es a table and t rns it into a series of I%S-R! statements. !he c rrent *ersion of :ra0erl is $.<<1 C*ersion $7 0atchle*el 1D. Io can get it by ?!H or a mailser*er from any com0.so rces.misc archi*e site7 for e>am0le: .SA: w archi*e.w stl.ed P1$9.$3$.1'3.1Q A stralia: archie.a P1';.1'<.1.4Q !he directory sho ld be something li&e:

senetLcom0.so rces.miscL*ol me'P</;QLora0erl/*$LG !here are fi*e 0arts and fo r 0atches. %ote that yo need to get 0erl Cand chec& it com0iles as isD7 from any +%. archi*e site Ce.g. archie.a in Zft0Lgn D. I am sing 0erl *1 0atch '4 at the moment with ora0erl *$ 0atch '. I will 0 t in 0atch 1 soon. Bersion 3 of 0erl is c rrently in al0ha release on ft0[netlabs.com. !he a*ailability of other 0atches to 0erl s ch as c rses lets yo se screen/handling f nctions. !here is also a +.I de*elo0ment en*ironment that sits on to0 of !clL0erl that co ld se ora0erl instead and th s create an E/windowsL:racle de*elo0ment 0latform. !his is called WA?-. PAlso a*ailable are 0erl 0atches to Sybase7 Ingress and RDB. Io co ld 0ossibly lin& them all together7 altho gh the S() f nctions ha*e different names and synta> de0ending on which interface yo are sing.Q I ha*e 0osted a se0arate ?A( for ora0erl that I obtained from Je*in. $. DB0erl Soon to be a*ailable is DB0erl7 which nifies the synta> of the Sybase and :racle 0atches to 0erl. It will also 0ermit access to Ingress and Interbase7 with consideration now being gi*en to >Base re= irements. !here is a mailing list7 S0erldb/interest[*i>.com. Io can mail SHerldb/interest/re= est[*i>.com to recei*e it. !his contains st ff similar to the files that flow thro gh this newsgro 07 so a fair bit of it is technical disc ssion on the innards of DB0erl which may not be to yo r interest. As soon as I find abo t releases7 I will anno nce it in this ?A(. %e*ertheless7 now is yo r chance to 0 t in yo r wish list and comment on the design of the AHI. Io can get 0erl/related st ff Cincl ding indi*id al 0erl interfaces to Sybase7 ingress7 Informi>7 etcD from ?t0.demon.co. & '. .nload Another tility is nload Cwhich a lot of 0eo0le rename to s=l nloadD. It ta&es a S() statement and creates two files7 a data loader control file and the data file. I thin& this was in com0.so rces.misc. IFll 0ost it 0 to com0.databases.oracle if need be CI forget where it came from originallyD. If anyone Jnows where it comes from and where it is archi*ed7 let me &now. I ha*e tried to contact the a thor7 b t mail bo nces. 1. !2) e>tensions !2) is a +.I oriented lang age. !om Hoinde>ter has e>tended it CHretty m ch li&e 0erl is e>tendedD to 0ermit access to Sybase and :racle. !om can be reached by t0oinde>[ny>.cs.d .ed and the e>tensions sho ld be a*ailable from the !2l archi*es at harbor.ecn.0 rd e.ed . ? rther information wo ld be a*ailable *ia the com0.lang.tcl newsgro 0. !2lL!& is also a*ailable from S0rite.ber&ely.ed 3. ES() V st written by Veff Stander7 this ta&es an S() statement and sends the res lts to an E/window. See credits for his address. 4. :ther +.I interface a00lication b ilders %ow7 I do not &now too m ch abo t the following7 b t they co ld be sef l for yo :

EBiew from >*iew.ecda*is.ed Et0anel C sed by ES()D from lth.se 8. Doc mentation While they are still in draft mode7 S();' standards are a*ailable *ia gate&ee0er.dec.com:Zft0L0 bLstandardsLs=l A descri0tion of :DB2 is a*ailable on Windows archi*es cica and Mirrored mon 4.cc.monash.ed .a : Zft0L0 bLwin'L0rogramrLodbc.lMh. !hese are WinWord doc ments and are written sing strange styles7 fonts and with missing gra0hics. If yo r des0erate for doco7 ha*e a loo& and see if yo feel li&e s0ending the time to ma&e them readable. 1.+. What thir/ 2art4 i,ter0a es are a#ai!a1!e% "ea0s. :racle interfaces are s ally the first RDBMS interface a third 0arty tool *endor will s 00ort. If yo are on a H27 loo& at (R- that comes with ->cel 1 for Windows7 0ro*iding yo ha*e S()G%et. CMind yo 7 this is an old7 c t down co0y of (R-D. Some interfaces written mainly for the .%IE world s 00ort a n mber of databases. !wo e>am0les I ha*e sed and fo nd :J were VAM Cfrom VIA22D / good for 2 0rogrammers who wanted to write forms = ic&ly7 and .%I?I / which also s 00orts its own bac&end if yo do not ha*e :racle Cor Ingress or ...D :ther front/end tools incl de + 0ta S()Windows7 Cwhich can also be sed for its own databaseD. MS/Access and :DB2 is fairly new. :ne criticism is that yo are 0re*ented from sing the nati*e S() Cwhich remo*es the ability to se :racle e>tensionsD beca se the front/end 0rod ct is too ,smart, and b ilds the S() for yo . "owe*er7 if yo as& Microsoft GnicelyG they will gi*e yo access to a ro tine that yo can send a straight S() statement to that is 0assed to the bac&ed RDBMS witho t modification7 th s by0assing this 0roblem. CDonFt yo hate m shroom treatment?D Some more detailed 0rod ct notes follow. (R- Range of Hrod cts ///////////////////// Hlatforms: MS/Windows7 :SL$ Re= ires: S()G%et if connecting to :racle Hrod ct Range: Broad range of 0rod cts: :DB2 de*elo0ment &it If yo want to write yo r own :DB2 dri*er :DB2 1$/0ac& :DB2 dri*ers for common databases Database library ,)arge, model for Microsoft 2. Many databases s 00orted. incl de >base and AS2II files S() sed is nati*e to the host DBMS. >Base incl des many f nctions AS2II files are RL: either delimited or fi>ed Most f nctions also s 00orted in MS BisBasic. C!hose fiddling with 0ointers are notD Royalties on r n/time. D))s re= ired. Database -ditor Bersion $ comes b ndled with ->cel1 for Win. Bersion 3 can be bo ght as an 0grade7 and is well worth loo&ing at. Hermits easy generation of = eries from *ario s so rces and generation of s mmary information.

-nd sers can b ild a 0arameteriMed = ery and then sa*e it. "as forms and re0ort 0ainter. 2an edit S() te>t directly. "as scri0t ability for tal&ing *ia :)- and DDand 0ermitting m lti0le commands. C%o I?7 W"I)- ty0e constr cts thoD. 2omes with connect library for dri*ing (Rfrom 27 Bis al basic7 etc. 2omes with demo tem0lates for WinWord7 add/ins for ->cel7 Ami/Hro7 Actor7 2 and BisBasic. )ess common :DB2 dri*ers are also a*ailable. 2ontact: Hioneer Software C.SD de*elo0ed it. In A stralia7 contact AMonic in Sydney. C<$D 989/44<< :ther %otes: Most comments abo t these 0rod cts are *ery fa*orable and generally incl de the terms ,r gged, and ,well/designed,. R mor has it there are = ite a few e>/:racle g ys at Hioneer. IDAHI will be s 00orted7 b t :DB2 is 0referred. A00arently someone in ?inland mar&ets an :: 2RR e>tension to the database library. Do not &now if yo can o0en two different ty0es of DB at once / that wo ld be really sef l. 2lear Access //////////// Hlatforms: Macintosh and MS/Windows Re= ires: S()G%et ?eat res: 1. Hoint and clic& S() data retrie*al to a00lications s ch as MS/->cel or flat files. $. Scri0t manager '. 2an lin& a00lications directly to S() ser*ers7 e.g. An ->cel macro b tton can 0o0 late a wor&sheet. 1. S 00orts DA). Hricing: Y13< C.S?D lists 0er station7 b t there are *ol me disco nts. 2ontact: 2lear Access 2or07 $<< West )owe ?airfield7 and Iowa 3$334 C313D 18$/8<88 ?AE C313D 18$/81;9 :ther %otes: +ot this info from the *endor. "a*e heard no re*iews. VAM from VIA22 ////////////// Hlatforms: MS/Windows7 Motif7 :0en )oo&7 and 2haracter Based D:S7 .%IE Re= ires: S()G%et ?eat res: 1. 2an se *ario s other formats $. More fle>ible *alidation than forms triggers '. 2an be real/time 1. -asy 2 interface Hricing: ? 2ontact: .S: 9<</139/''1' International: $1$.$48.88$$ ?a>: $1$/4<9/483' :ther %otes: :nce wor&ed in an R&D sho0 we others in the team were sing this. !hey were *ery ha00y with it. Will a00eal to 2 and .%IE 0rogrammers 0artic larly beca se it integrates so well with 2. It seemed to be designed with ncom0romising 2ode/c tters in mind. %ot for cowboys and no*ices. :ne of the c te things was the ability to se .%IE reg lar

e>0ression matching on fields as 0art of standard *alidation. S(R /// Hlatforms: Bario s :S and databases ?eat res: 1. Re0ort generation lang age $. 2an 0date the database '. %ormal :S file interface ca0ability 2ontact: .S: A stralia: Se= el HL)7 Melbo rne :ther %otes: +ood if yo ha*e different database and :S 0latforms and want to se similar code. I sed it for a short time a few years ago7 b t others I tr st who sed it more lo*ed it. ( ite 0o0 lar. HowerB ilder //////////// De*elo0er tool for management of databases and generation of front/end forms and re0orts. Hlatform: MS/Windows ?eat res: Some 2AS- and :: constr cts for front/end A few internal 2AS- tables for bac&/ends 2an generate AS2II files of DD) C%o triggers or 0roced resD )oo&s sef l as a wor&ing DBA tool as well. Interfaces to most common RDBMSs. 2ontact: Howersoft7 the de*elo0er. :ther %otes: Smells of original design for Sybase. S 0er%:BA ///////// Hlatforms: MS/Windows7 Motif7 :0en)oo& .%IE7 MS/D:S7 BMS :racle7 Sybase7 Ingress7 Informi>7 2/ISAM7 !eradata 2ontact: ?o r Seasons Software7 Biltho*en7 "olland. ?a>: R11 91 114 ;11'? Hhone: R11 91 114 4191? S()G-!:% //////// Meant to be li&e ,s&eleton, for :racle ?orms de*elo0ment. ?eat res: A00lication de*elo0ment s&eletons and tilities .ses standard :racle tools -.g. Straight formsK no ser/e>its 2an retrofit e>isting forms. 2ontact: )ogical !echnologies H*t. )td. $nd ?loor7 3'3 ?linders )ane7 Melbo rne7 Bic7 '<<<7 A stralia Hh: R41 ' 4$; 3$<<7 ?a>: 4$; 9'9' %otes: )ogical also ma&es ?orms $.' to '.< con*erters / more on this soon. !hey also ha*e ,Definition,7 an alternati*e to S()G2ase. If anybody reading this is a ser or *endor of a 0artic lar third 0arty interface that yo thin& sho ld be mentioned7 mail me

direct rather than *ia the newsgro 0 together with a = ic& s mmary.!his section needs e>0anding and correction. 1.1<. "ow 0ortable is :racle a00lications to other RDBMS? While the core S() is 0ortable7 each *endor has their own e>tensions and ways in which yo need to str ct re the data model to ta&e ad*antage of the way each RDBMS does things. !o get any real 0erformance7 yo need to ta&e ad*antage of the e>tensions7 or be st c& with a lowest common denominator. ->am0les of e>tensions incl de f nctions a*ailable to S() Cs ch as decodeD7 = ery constr cts Cs ch as the hierarchical 2:%%-2! BI HRI:R and o ter 6oin constr ctsD and 0hysical storage 0arameters. %ot only this7 b t the lang ages sed to im0lement non/S() o0erations and the *ario s tools are not com0atible across different RDBMS systems Cagain7 nless yo se a third 0arty tool s ch as .nifyD. 1.11. What Q"er4 O2ti3iEers are there% :racle S# 4 has r le based o0timiMation that de0ends on two things7 the 0resence of indices and the way yo constr ct yo r where cla se. :racle 8 has the o0tion of sing a statistical o0timiMer. !his re= ires yo to r n 6obs that get a statistical 0ict re of the s0read of data *al es in col mns across yo r database. !his information is sed to hel0 decide how to 0erform the = ery. !he data collection can be *ery intensi*e and ta&e ages C nless yo se the -S!IMA!- o0tion which hel0s a lotD and r n reg larly as the 0o0 lation of yo r database changes lest yo r = eries s ffer from being o0timiMed sing misleading data. %ote that the -S!IMA!- f nction only scans the first 0art of the table7 which may not be re0resentati*e of the whole table. In !he ? t re: I@ll be bringing in edited highlights of !ina 2. )ondonFs disc ssion on how to o0timiMe = eries sing the B4 r le/based o0timiMer and how to se -EH)AI% H)A%. 1.12. Is there a, a,o,43o"s 9T( site 0or Ora !e st"00% In +ermany7 one has been started 0 by Andreas Bartlett. ?t0..ni/:ldenb rg.D-: L0 bL.ni>Loracle It is mostly em0ty now7 b t he says to feel free to 0load. In the .SA7 Andy ?in&enstadt7 is starting one 0 soonish ?t0.*istachrome.com A more general site7 best &nown for storing DB0erl st ff is ft0.demon.co. &: L0 bL0erlLDB0erlLora0erl Which is growing a s ite of ora0erl 0rograms. What 3ai! !ists are there% A0art from those that :racle r n if yo ha*e :racle S 00ort.... I heard r mors abo t an ,orawiM, mailing list that had 0ossibly sh t down7 b t here are notes on what I do &now. %ame: :RA2)-/) C:RA2)- database mailing list.D Mail Address: :RA2)-/)[SB22BM.BI!%-! )ist Ser*er Address: )IS!S-RB[SB22BM.BI!%-! )IS!S-RB[22BM.S.%ISB.-D. !o S bscribe: Send ,S bscribe :RA2)-/) ?red V. %er&, command to list Ser*er address !o .ns bscribe: Send ,SI+%:?? :RA2)-/), commands to list ser*er address G%:!G to mail address Archi*es:

1.18.

Send ,I%D-E :RA2)-/), to list ser*er address for info ->tra %otes Send ,I%?: R-?2ARD, to list ser*er address to get reference Send ,I%?: DA!ABAS-, to list ser*er address to get search notes "as 6 st started acti*ity again after a = iet 0eriod. 1.1:. What 1"!!eti, 1oar/s are there% I do not ha*e the details7 b t I heard of a BBS called S()ware or Something that only charges an ann al fee. Does not s0ecialiMe in :racle. "a*e no f rther details. Wo ld lo*e them and a list of the sort of st ff they carry ChintD. .nfort nately7 it is not a local call to the States from hereW :racle themsel*es set 0 a b lletin board for c stomers with S 00ort. Some local ser gro 0s are setting 0 there own b lletin boards. :ne is the Bictorian :racle .sers +ro 0 here in A stralia. Are there any others? 1.1&. What ,ews 5ro"2s are there% Io 0robably already &now of com0.databases.oracle Cwhere yo Hic&ed this 0D. 2om0.databases is not bad for general = estions not related s0ecifically to :racle 0roblems or techni= es. !here are other com0.database s b/gro 0s s ch as theory7 ingress7 Sybase7 Informi> and >base. B!W: :n all these information access media7 GH)-AS-G &ee0 traffic down by editing se*erely when yo are = oting another mail. Also7 if yo 0ost an = estion7 it is sef l and 0olite to 0ost a s mmary of re0lies and sol tions bac&. ?or these7 0refi> the s b6ect with ,S.MMARI:,. !his enables = ic& selection of Im0ortant information from the gro 0 or yo r mail and allows sites to &ee0 only s mmaries. I am not trying to dictate7 only s0ea& from the 0oint of *iew of someone snowed nder who wants to be able to *gre0 mail and news easily. 1.1<. 7ow /oes Ora !e o32are to...% :J7 IFll admit this section is 0 rely 0ersonal. My asbestos S it is on. Mail comments if yo feel strongly. Sybase: I wo ld be most li&ely to choose Sybase if Mainly :SL$ site Ingress: :racle has better S() :racle has more rob st bac&end :racle is more 0ortable :racle has more fle>ible sec rity. Ingress front/end tools are niftier I wo ld be most li&ely to choose Ingress if Most sing E/terminals on .%IE host "ad DBA with good .%IE SysAdmin s&ills Informi>: S() interfaces can ,0i0e, o t0 t of S() S-)-2!S thro gh a host .%IE command. %iftyW "as S() dialect li&e cross of Ingress and :racle. I wo ld be most li&ely to choose Informi> if "osted nder .%IE on small systems Dollars were scarce DB$: I wo ld be most li&ely to choose DB$ if What? Me? In an IBM sho00e? $. S() (.-S!I:%S ///////////////// $.1. "ow can I a*oid a di*ide by Mero error? .se the D-2:D- f nction. !his f nction is absol tely brilliant and f nctions li&e a 2AS- statement7 and can be sed to ret rn

different col mns based on the *al es of others. ?or e>am0le7 ass me we sell 0rod cts at *ariable cost7 de0ending on the ability of the 0 rchaser to 0ay Ce.g. academic disco ntD. : r table incl des the following col mns7 HR:D.2!7 Cthe &eyD %.M5S:)D7 !:!A)5R-B-%.-. A*erage sell 0rice sho ld be !:!A)5R-B-%.- L %.M5S:)D7 b t if we ha*e not sold any7 we are in tro ble. We can a*oid this by ret rning %.)) as the res lt if %.M5S:)D is Mero as follows: select HR:D.2!7 Decode C%.M5S:)D7 <7 %.))7 !:!A)5R-B-%.-L%.M5S:)DD AB+5S-))5HRI2from my5tableK :J7 so that is one 0roblem sol*ed7 b t D-2:D-S is m ch more .sef l and it is worth gi*ing a co 0le of more e>am0les: Select decode CS-E52:D-7 FMF7 FmanF7 FmF7 FboyF7 F?F7 FwomanF7 FfF7 FgirlF7 F.n&nown@D ... In the abo*e e>am0le7 S-E52:D- wo ld be a single character code7 and the statement wo ld ret rn a descri0tion based on that code or , n&nown, if there was no match. Decode is es0ecially sef l if yo e*en want to choose different information from two tables: Select decode C-EHR517 -EHR5$7 !B)51.2:)517 -EHR5'7 !B)5$.2:)517 !B)51.2:)5$D from ... !he D-2:D- f nction is always worth &ee0ing in mind. Many times7 it will be yo r only way to do what yo want in a tric&y bit of S(). 2.2. Ca, I "2/ate ta1!es 0ro3 other ta1!es% Ies. ?or e>am0le7 if we had a table D-H!5S.MMARI7 we co ld 0date the n mber of em0loyees field as follows .0date de0t5s mmary s Set n m5em0s # Cselect co nt CGD from em0 e Where e.de0tno # s.de0tnoDK 2.8. Ca, I re3o#e /"2!i ate rows% Ies7 sing the R:WID field7 which GwillG be ni= e. !here are many *ariations on this statement7 b t the logic will wor&. !his ass mes an -MH table &eyed on -MH5ID7 which is %:! %.)). Delete from -MH e Where not e. R:WID # C Select min Cf. R:WIDD from -MH f Where f. -MH5ID # e. -MH5IDDK IFll get the :??I2IA) statement according to :racle sometime.

!he other good thing abo t R:WID is that it is the = ic&est way to reference a 0artic lar row in a table7 0ro*iding that no table reorganiMation ha00ens in the meantime. A 0ossible se is to select information from a table incl ding the row n mber into a bloc& in S()G?orms7 and 0ass the R:WID to a ser/e>it that goes and 0ic&s 0 the ):%+ RAW in that table and dis0lays it as a 0ict re. 2.:. Ca, I "2/ate "si,5 a #iew% :nly if the *iew is a sim0le horiMontal slice thro gh a single table. 2ol mns from the base table can be omitted from the *iew if they are %:! %.)). %ote that *iews can be created with a chec& o0tion that 0re*ents yo sing the *iew to insert records 2ontra*ening selection criteria for that *iew. Are #iews a"to3ati a!!4 "2/ate/ whe, I "2/ate 1ase ta1!es% Ies7 that is the whole idea of *iews. !he only thing :racle stores for a *iew is the te>t of the definition. When yo select from a *iew7 :racle loo&s 0 the te>t sed to define the *iew and then e>ec tes that = ery. Sho"!/ we "se o32!ex #iews that r"e! 2er0or3a, e% Beca se *iew = eries that in*ol*e sorting7 gro 0ing7 etc can lead to a high 0erformance o*erhead7 it might be better to write some re0orts with a 0roced ral com0onent that fills 0 a tem0orary table and then does a n mber of = eries from it. While this is non/relational7 it can be 6 stified for some cases. %e*ertheless7 it is sef l to ha*e the *iew definition in the database. Io can then test the o t0 t from the *iew against the o t0 t from yo r 0roced ral mani0 lations. !he *iew definition can also be sed as the nambig o s gos0el. Ca, I i32!e3e,t tree-str" t"re/ -"eries% IesW !hose migrating from non/RDBMS commonly as& this A00s. !his is definitely non/relational Ceno gh to &ill 2odd and then ma&e him roll in his gra*eD and is a feat re I ha*e not seen in the com0etition. !he definiti*e e>am0le is in the e>am0le S2:!!L!I+-R database7 when loo&ing at the -MH table C-MH%: and M+R col mnsD. !he M+R col mn contains the em0loyee n mber of the ,c rrent, -m0loyee@s boss. Io ha*e a*ailable an e>tra 0se do/col mn7 )-B-)7 that says how dee0 in the tree yo are. :racle can handle = eries with a de0th 0 to $33. Select )-B-)7 -MH%:7 -%AM-7 M+R from -MH connect by 0rior -MH%: # M+R start with M+R is %.))K Io can get an ,indented, re0ort by sing the le*el n mber to S bstring or l0ad a series of s0aces and concatenate that to the string. Select l0ad CF@7 )-B-) G $D \\ -%AM-... Io se the start with cla se to s0ecify the start of the !reeCsD. More than one record can match the starting condition. :ne disad*antage of a 2:%%-2! BI HRI:R is that yo cannot Herform a 6oin to other tables. Still7 I ha*e not managed to see anything else li&e the 2:%%-2! BI HRI:R in the other *endor :fferings and I li&e trees. -*en trying to doing this Hrogrammatically in embedded S()L2 is diffic lt as yo ha*e to do the to0 le*el = ery7 for each of them o0en a c rsor to loo& for child nodes7 for each of these o0en a c rsor .... Hretty

2.&.

2.<.

2.=.

soon yo blow the c rsor limit for yo r installation. !he way aro nd this is to se H)LS()7 o0en the dri*ing c rsor with statement7 and ,6oin, 0rogrammatically for each row ret rned. 2.'. 7ow a, I 5et i,0or3atio, o, the row 1ase/ o, 5ro"2 i,0or3atio,% Imagine we ha*e the -MH table and want details on the em0loyee Who has the highest salary. Io need to se a s b= ery. Select e.ename7 e.em0no7 e.sal from em0 e where e.sal in C select ma> Ce$.salD from em0 e$ DK Io co ld get similar info on em0loyees with the highest salary in their de0artments as follows Select e.ename7 e.de0tno7 e.sal ?rom -MH e where e.sal # C Select ma> Ce$.salD ?rom -MH e$ Where e$.de0tno # e.de0tno DK 2.+. 7ow a, I 5et a ,a3e 0or a te32orar4 ta1!e that wi!! ,ot !ash% .se a se= ence7 and se the n mber to hel0 yo b ild the !em0orary table name. %ote that S()/;' is de*elo0ing s0ecific 2onstr cts for sing tem0orary tables. 7ow a, I 0i,/ o"t a1o"t what ta1!es? o!"3,s a,/ i,/i es there are% :racle maintains a li*e set of *iews that yo can = ery to tell Io what yo ha*e a*ailable. In B47 the first two to loo& at are DI2! and DI2!52:).M%S which act as a directory of the other dictionary *iews. It is a good idea to be familiar with these. %ot all of these *iews are accessible by all sers. If yo are a DBA yo sho ld also create 0ri*ate DBA synonyms by r nning Y:RA2)-5":M-LrdbmsLadminLdba5syn.s=l in yo r acco nt. Is there a 0or3atter 0or SQL state3e,ts% !here are a n mber of ,bea tifiers, for *ario s 0rograms lang ages. !he cb and indent 0rograms for the 2 lang age s0ring to mind Caltho gh they ha*e slightly different con*entionsD. As far as I &now there is no formatter for S() a*ailable. +i*en that a 0 blic domain S() 0arser is a*ailable7 maybe someone co ld base a reformatted based on the grammar definitions therein. %ote that yo 2A%%:! se cb and indent with HroG2 as both these Hrograms will screw 0 the embedded S() code. 2.12. What is the DUAL ta1!e% !he D.A) table is a table with a single row and a single col mn sed where a table is syntactically re= ired7 for e>am0le in S()G?orms $.' where yo want to se a f nction a*ailable to S(). -.g. If we ha*e two fields7 > and y and we want y to be set to a s bstring of > Select s bstr C>7 $7 1D into y from d alK If D.A) has %: rows or more than one7 many forms nder $.' synta> Cor $.' triggers in forms 'D will not wor& 0ro0erly. At worst7 the logic of some of the triggers in yo r form will be re*ersed7 witho t any message to the ser and data co ld be destroyed. When I was writing ?orms $.' code7 the GfirstG thing I did was to chec& that there was one row Cand only one rowD in the D.A) table7 otherwise I dis0layed a message to contact the the 2:%%-2! BI HRI:R

2.1..

2.11.

DBA and then = it the form. !his was done in J-I/S!AR!.H. 2.18. What is the /i00ere, e 1etwee, C7AR a,/ 6ARC7AR% :racle ha*e stated that 2"AR will become fi>ed length character ty0e at storage le*el7 and that BAR2"AR will be *ariable length. 2 rrently they are synonymo s. !his will 0robably mean that 2"AR ty0es will not be able to be %:! %.))7 and will ta&e 0 all the storage re= ired when the record is first inserted. 2 rrently7 the only 0hysical storage re= ired is the act al data and a length s0ecifier. It may also mean that restrictions s ch as where R-SH:%S- in CFI-SF7 F%:FD may ha*e to be rewritten for 2"AR ty0es as where R-SH:%S- in CFI-SF7 F%: FD At the le*el of HroG27 of co rse7 they are mar&edly different. B!W7 the beha*ior of 2"AR will be able to be altered by a H?I)Setting affecting B4 com0atibility. With B4 com0atibility :%7 the 2"AR will be the same as B4. With com0atibility :??7 2"AR will be 0added and BAR2"AR will be a tr e *archar. !here are some 0erformance gains that MI+"! be 0ossible with 0added Strings: if the initial strings or &eys are 0added7 then the bac&/end -ngine can = ic&ly s&i0 to the field rather than scanning for field delimiters. 2.1:. What is ROWNU) 5oo/ 0or% R:W%.M is a 0se do/col mn ret rned as rows are selected and gi*es yo a n mber for the row. ,?ine,7 say a lot of 0eo0le7 ,I will se it to 0eel off the first few rows by sing CR:W%.M S nD in a W"-R- cla se,. !he 0roblem with this is that R:W%.M is e*al ated B-?:R- the sorting Ctho gh after the W"-R-D. !ry the following to see my 0oint. select R:W%.M7 D-H!%: from -MH where R:W%.M S 1< :rder by D-H!%:7 R:W%.M When yo thin& abo t it for a min te or two7 it cannot be any other wayW "owe*er7 R:W%.M is good when yo want to get a .%I(.- reference for each row ret rned7 as long as yo do not mind the orderW 2.1&. 7ow /o I 5et a to2 te,% !his = estion gets bandied aro nd from time to time and the answer is often gi*en 6 st to se R:W%.M Csee abo*eD. "owe*er7 what yo ha*e to do is order them first7 then get the first ten. Some answers incl ded creating a tem0orary table created by a select with an order by and then select from the tem0 table where R:W%.MS1<. !his will not always wor&. I do not belie*e that straight S() is the way to go for s ch 0roblems when yo ha*e H)LS() a*ailable. My a00roach wo ld be to se a H)LS() c rsor to select the ordered data and abort the loo0 after 1< records. If sing HroG27 yo do not e*en need a tem0orary table. If yo are sing a tem0orary table then yo will not need it to be as big as the original7 which straight S() will do. 2.1<. 7ow a, I o,tro! the ro!!1a $ se53e,t I "se% In S()7 yo may need to control the rollbac& segment sed as the defa lt rollbac& segment may be too small for the re= ired transaction7 or yo may want to ens re that yo r transaction r ns in a s0ecial rollbac& segment7 naffected by others. !he statement is as follows: S-! !RA%SA2!I:% .S- R:))BA2J S-+M-%! segment5nameK :n a related note7 if all yo are doing are S-)-2!S7 it is worth telling the database of this sing the following: S-! !RA%SA2!I:% R-AD :%)IK

Both these statements m st be the first statement of the transaction. 2.1=. 7ow a, I or/er a ",io,% .se the col mn n mber. Say we are getting a list of names and codes and want it ordered by the name7 sing both -MH and D-H! tables: select D-H!%:7 D%AM- from D-H! nion select -MH%:7 -%AM- from -MH order by $K 2.1'. 7ow a, I re,a3e a o!"3,% !here is no way a col mn can be renamed sing normal S(). It can be done caref lly by the DBA 0laying aro nd with internal SIS dictionary tables and bo ncing the database7 b t this is not s 00orted. CI ha*e s ccessf lly done it in B1 thr B4. "a*e not tried it with B8.D Who are SCOTT@TI>ER? S*STE) a,/ S*S% !hese three sers are common in many databases. S2:!! is the standard demo ser7 with !I+-R as the 0assword. SIS!-MLMA%A+-R is a DBA acco nt that r ns the internals as far as s 00orted se goes and SISL2"A%+-5:%5I%S!A)) act ally owns the internals. It is dangero s to fiddle with ob6ects owned by SIS. Another common serL0assword is H)S()LS.H-RS-2R-! sed for H)LS() demo st ff. :h7 and donFt com0lain abo t the 0asswords being told here. !hese are defa lt 0asswords. ?or SIS!-M and SIS they GGGM.S!GGG be altered for sec rity reasons. After all7 e*erybody &nows them. 2.2.. Who /o #ario"s a ess 3etho/s o32are% "ow yo organiMe yo r S() and indices controls what access methods will be sed. !he following ran&ing is *alid for B4. I do not &now abo t B8. (.-RI HA!" RA%JI%+ Clowest ran& is the bestD Ran& Hath 1 R:WID # constant $ .ni= e inde>es col mn # constant ' -ntire ni= e concatenated inde> # constant 1 -ntire cl ster &ey # corres0onding &ey in another table in same cl ster 3 -ntire cl ster &ey # constant 4 -ntire non/ ni= e concatenated inde> # constant 8 %on/ ni= e single col mn inde> merge 9 Most leading concatenated inde> # constant ; Inde> col mn B-!W--% low A%D hi or )IJ- F2NF 1< SortLmerge C6oins onlyD 11 MAELMI% of single inde>ed col mn 1$ :RD-R BI entire inde> 1' ? ll table scans 11 .ninde>ed col mn # constant or col mn IS %.)) or col mn )IJ- FN2NF 2.21. What are !"sters% 2l stering data is a techni= e where the storage of records of related tables is intermi>ed7 with the de0endent records of one table in the same bloc& as those of the master record. !he logic behind this is that yo 0robably most se the de0endent records after yo ha*e accessed the master table. !hat@s all fine7 b t ha*ing a table in a cl ster 0re*ents yo from dro00ing one and not the other.

2.1+.

Also7 the master and de0endent records of other tables m st fit into an :racle bloc&7 ty0ically $& Ctho gh ad6 stable at install time by a bra*e DBAD. %ow7 if yo are thin&ing of cl ster transactions with an acco nt master record7 how long before yo ha*e blown $& ? %o :racle DBA I e*er &new7 a0art from :racle staff7 tho ght that sing cl sters was worth the hassle. 2.22.7ow a, I "2/ate a 1i5 ta1!e witho"t 1!owi,5 ro!!1a $ se53e,ts% Imagine yo ha*e a ".+- table and need to 0date it7 0ossibly 0dating the &ey. Io cannot 0date it in one go beca se yo r rollbac& segments are too small. Io cannot o0en a c rsor and commit e*ery n records7 beca se the c rsor will close. Io cannot ha*e a n mber of 0dates of a few records each beca se the &eys may change / ca sing yo to *isit records more than once. !he sol tion I ha*e sed was to ha*e one 0rocess Cwith S-! !RA%SA2!I:% R-AD :%)ID select R:WID from the a00ro0riate rows and 0 m0 these C*ia standard IL:D to another 0rocess that loo0ed aro nd reading R:WIDs from standard in0 t7 0dating the a00ro0riate record and committing e*ery 1< records or so. !his was *ery easy to 0rogram and also was = ite fast in e>ec tion. !he n mber of loc&s and siMe of rollbac& segments re= ired was minimal. 2.28. Wh4 /o,At I 5et re or/s 0or the /ate I wa,t% Io are trying to retrie*e data based on something li&e: S-)-2! fld17 fld$ ?R:M table W"-R- date5field # F19/6 n/4<F Io G&nowG there are records for that day / b t none of them are coming bac& to yo . What has ha00ened is that yo r records are not set to midnight? CWhich is the defa lt *al e if time of day not s0ecifiedD. Io can either se to5char and to5date f nctions7 which can be a bad mo*e regarding S() 0erformance7 or yo can say W"-R- date5field # F19/6 n/4<F A%D date5field S F1;/6 n/4<F An alternati*e co ld be something li&e W"-R- date5field between F19/6 n/1;4<F and to5dateCF$':3;:3; 19/6 n/4<F7 F""$1:......IIFD '. S()GH).S (.-S!I:%S ////////////////////// 8.1. 7ow a, I o,tro! the start"2 o,0i5"ratio, o0 SQLB(!"s% S()GHl s first loo&s at a login.s=l Cglobal loginD in a Directory nderneath the main :racle installation directory CY:RA2)-5":M-LdbsLglogin.s=l for .%IED and then in login.s=l in yo r 2.RR-%! directory. I thin& the BMS login file is in SISY:RA2)-7 b t I am not s re abo t that. )ate item: someone re0orted glogin.s=l in another directory: Y:RA2)-5":M-Ls=l0l sLadmin7 b t I am not s re of which *ersion and 0latform. I only R-HR-S-%! the directory as a .%IE 0ath7 I do not &now whether it was .%IE or not. Act ally7 I thin& Y:RA2)-5":M-Ls=l0l sLadmin is a m ch better 0lace for it. It is a 0ity that :racle does not se a file in yo r Y":MDirectory7 b t I ha*e hac&ed glogin.s=l to se a file in the Y":M- if it e>ists. Another alternati*e is to set an en*ironment *ariable S()HA!" CI.e. YS()HA!" in .%IE7 NS()HA!"N in MS/D:S7 and 0robably a

logical in BMSD that 0oints to the directory where the login.s=l file is to be read7 rather than the c rrent directory. !his can incl de more than one directory7 se0arated by colons Cin .%IE7 that is ... MS/D:S 0robably ses semi/colons as delimitersD with the first login.s=l fo nd being the one that is sed. 8.2. Ca, I 5et a o!"3, #a!"e i,to a s"1stit"tio, #aria1!e% .se the :)D5BA).- s0ec with the 2:).M% command. Imagine we want the s rname of an em0loyee to go into a 2:).M% > :)D5BA).- y S-)-2! s rname > ?R:M em0loyee W"-R- em05id # 1$'1K HR:MH! I fo nd em0loyee with s rname &&y :f co rse7 this was more often sed as a &l dge before H)LS() became a*ailable in S()GHl s Cor if yo had *4 witho t !H:D7 b t it is still sef l for a n mber of things. %ote that some 0eo0le 0refer to se the %-W5BA).- directi*e rather than the :)D5BA).- directi*e. ?or this e>am0le where only one row is ret rned7 it does not ma&e m ch difference. 8.8. 7ow a, I ha,5e the Ihate/ /e0a"!tG e/itor to 34 0a#orite% When yo ty0e ,edit, to S()GHl s7 it in*o&es a defa lt editor for yo r system. :n D:S this is often -D)I%7 on .%IE ed and on BMS7 it is s ally -D!. In yo r login.s=l file Cor 0referably the glogin.s=l file set 0 by yo r DBAD7 yo sho ld set the *ariable that changes this to yo r fa*orite editor. A 0ossibility for .%IE: define 5editor#, L srL cbL*i, A 0ossibility for BMS: define 5editor#,-B-, 8.:. What is the /i00ere, e 1etwee, J a,/ JJ% Io can create a ,0ermanent, definition of a s bstit tion *ariable sing D-?I%-7 the :)D5BA).- or %-W5BA).- cla ses of a 2:).M% statement Cwhen the S() statement ses themD or by referencing the *ariable with &&. .se of a & does not create a 0ermanent *ersion and will 0rom0t yo for a *al e if the *ariable does not e>ist Cas will &&D. "owe*er7 ne>t time yo reference the *ariable with & or &&7 it will as& yo for the *al e again. !ry the following to fig re it o t Cdo not enter the ,S(), and remember to ty0e something in when as&ed7 ma&e it different each timeD. S() ndefine try51 S() 0rom0t &try51 S() 0rom0t &try51 S() 0rom0t &&try51 S() 0rom0t &&try51 S() 0rom0t &try51 S() 0rom0t &&try51 %ote that se of 0ositional 0arameters C&17 &$7 &'....D are slightly different7 they are gi*en a ,0ermanent, definition. H.S. When I say ,0ermanent, I mean 0ermanent for the c rrent 0rocess. 8.&. What is the /i00ere, e 1etwee, KhostK a,/ KLM% *ariable7 getting it *ia the em0loyee id.

!he host andW CSometimes another characterD both create o0erating system commands as child 0rocesses of S()GHl s. !he difference is that the ,host, will 0erform *ariable s bstit tion of & or && symbols7 whereas ,W, will not. %ote also that the defa lt shorthand character *aries with 0latform. .nder BMS7 yo se the Y symbol. 8.<. Wh4 a,At I "se a ta1!e ,a3e i, a s"1stit"tio, #aria1!e% :ften7 0eo0le try and 0 t a table name in a s bstit tion *ariable and then se it as follows: define W:RJ5!AB)-#,-MH, select &&W:RJ5!AB)-.D-H!%: from &&W:RJ5!AB)-K Mind yo 7 the s bstit tion in the ,from, cla se is :J. What is ha00ening is that the ,., between &&W:RJ5!AB)- and D-H!%: is a terminator for s bstit tion. !h s define EIU#,AB2, 0rom0t &&EIU.abc will gi*e ,AB2abc, !h s7 yo sho ld ha*e sed Select &&W:RJ5!AB)-.D-H!%: from &&W:RJ5!AB)-K CIo can change this meaning of ,., if it b gs yo se the S-! command with the 2:%2A! arg ment b t I do not recommend changing it witho t lots of tho ghtD. 8.=. 7ow a, I see a!! o0 a LON>% ?irst of all7 the following might be sef l S-! MAEDA!A '$848 S-! ARRAISIU- 1 Io sho ld then S-! ):%+ 3<<< S-! WRAH and maybe se 2:).M% >>>> ?:RMA! A4< W:RD5WRAH for it. :h yeah7 if there is a he> dis0lay f nction in :racle S()7 b t yo canFt se it on a ):%+ when yo need it. Io sho ld also &now something of the S-! 0arameters and ens re yo do not go o tside system limits. MAEDA!A ARRAISIU):%+ Ma>im m total b ffer siMe % mber of records b ffered 2haracters of a long ,seen,

RecordSiMe G ArraysiMe m st be less than MAEDA!A. %ote that ARRAISIU- defa lts to 1< or $<7 and yo will 0robably blow the MAEDA!A e>tracting large ):%+S so chec& these o t and 0 t a00ro0riate S-! statements in yo r scri0t. It is worth ha*ing a co 0le of library scri0ts in :racle that loo& after these 0arameters in a co/ordinates way so that other scri0ts co ld sim0ly start Y:RA2)-5":M-LlocalL0l sLset1long !R.or start Y:RA2)-5":M-LlocalL0l sLset1long ?A)S8.'. 7ow a, I 0or e a o!"3, to 1e5i, o, the !e0t o0 the 2a5e% .se the 2:).M% ?:RMA! command with ?:)D CB-?:R-\A?!-RD.

8.+.

Ca, I a!ias SQL o33a,/s% !here is no real alias mechanism in S()GHl s7 b t yo can do something similar sing && *ariables. Ca, I es a2e si5,i0i a,t 2", t"atio, 3ar$s% Many .%IE/oriented sers li&e to ha*e a general ,esca0e, character to remo*e the significance of s0ecial characters. !hey want to be able to refer to a real ,&, sing O&7 for e>am0le. Well7 yo cannot. P"int to any of yo at :racleQ. What yo ha*e to do is chec& o t the S-! command 0arameter that is s0ecific to the character yo were interested in and change it. ?or e>am0le: rem alter the character set define ,Z, select ,!his & that are normal, from d alK acce0t yo r in0 t 0rom0t ,+i*e me a string, Select Zyo r in0 t from d alK Set define ,&, %ow this is fairly 0ainf l if yo want &ee0 trac& of things and there are some characters yo cannot esca0e. Do a ,S":W A)), and yo Fll see all the *ario s things yo can 0lay with.

8.1..

1. S()G?:RMS ' (.-S!I:%S ///////////////////////// :.1. 7ow a, I 5et a !ist o0 #a!"es 0ro3 a har/ o/e/ !ist% Ass me the field is S-E52:D-7 se the following in the )ist/of/*al es S() statement S-)-2! .%I:% S-)-2! .%I:% S-)-2! .%I:% S-)-2! .%I:% S-)-2! .%I:% S-)-2! FMF7 FAd lt MaleF I%!: S-E52:D- ?R:M D.A) F?F7 FAd lt ?emaleF ?R:M D.A) FmF7 FV *enile MaleF ?R:M D.A) FfF7 FV *enile ?emaleF ?R:M D.A) F.F7 FAd lt .n&nownF ?R:M D.A) F F7 FV *enile .n&nownF ?R:M D.A)

ItFs for a Moo catalog of animals... :/D :.2. 7ow a, I 5et 0i,/ to !oo$ at /es ri2tio, with !ist o0 #a!"es% Imagine that yo are ha*e the following list of *al es te>t for a &ey Ce.g. for the D-H!%: field of the -MH bloc&D: Select D-H!%:7 D%AM-7 ):2 into: -MH.D-H!%: from D-H! !he list/of/*al es find ca0ability only wor&s on the first field howe*er7 which is ne>t to seless. !o get the searching on the name7 yo need to 0 t the name first in the S-)-2! cla se. :f co rse7 it needs somewhere to go7 so yo need to ha*e a field C+):BA) *ariables wonFt wor&D that yo se as a bitb c&et. Select D%AM-7 D-H!%:7 ):2 into :2:%!R:).BI!B.2J-!7 :-MH.D-H!%: from D-H! :f co rse7 yo had better ma&e: 2:%!R:).BI!B.2J-! $33 characters wide to a*oid lots of annoying tr ncation messages. :.2. Ca, I e/it SQLB9or3s o/e with 34 text e/itor%

Ies7 b t it is ns 00orted Csince IA+ became S()G?ormsD. Hersonally7 I se the S()G?orms Designer interface to c t the basic code and screen layo t and then do the rest inside my te>t editor. I wonder how many others do it this way? ?orms $.' is diffic lt beca se the synta> is so obt se and ta&es a fair bit of m c&ing aro nd if yo want to learn how to change the logic. V st changing an S() statement7 howe*er is easy eno gh. CI was able to do it beca se I grew 0 with S()G?orms before it e*en had a screen 0ainter or field triggers or &ey triggers7 so I learnt grad allyD. ?orms ' is a ):! easier7 b t be warned7 D: %:! I%2).D- !ABS. .se leading s0aces. !.R% :?? A.!:I%D-%! ?-A!.R-S :? I:.R -DI!:R Cor 0ost/0rocess with the e>0and tility of .%IE which con*erts tabs to s0acesD. :racle 0ro0osed not ha*ing a h man readable .in0 file for S()G?orms 17 b t eno gh 0rotests were recei*ed to 0re*ent remo*al of this feat re. If yo are sing a te>t editor7 yo m st remember to reload the form bac& in0 t the database sing the iac 0rogram. Io will ha*e to remo*e it sing ,iac /d, first. :ne thing worth noting is the fact that the te>t file Cand the database definitionD 0ermits association of 0rom0t te>t to be associated with the field7 and 0osition abo*e or to the left of the field7 mo*ing a tomatically when yo edit the 0osition of the field. Io can also a tomatically ha*e the 0rom0t re0eated in m lti/row bloc&s. With the screen/based interface7 the te>t is hard/coded into dis0lay of the form and is %:! associated with the field. !h s yo m st mo*e !W: things7 the field and the associated te>t. Why doesn@t :racle s 00ort the f ll .in0 ca0abilities? By the way7 chec& o t the ad*antages of sing .in0 files as referenced so rce7 0artic larly *ersion control mentioned near the end of this doc ment. :.8. Ca, I e/it SQLB9or3s o/e 14 "2/ati,5 the /ata1ase% Ies7 b t it is ns 00orted. In S()G?orms $.'7 the tables being with ,IAH,7 in '.<7 with ,?:RM,. ( ite often7 when I change the name of a col mn or table7 I se a form created with forms tables as the base tables of the bloc&s to 0date the database and then generate the new forms. .sing these tables for re0orts can also be handy to com0are the definition and consistency of col mns and fields that se it as well as for technical doc mentation Cs ch as ,where is S ch/and/s ch a table sed?D. :ne *ery sef l thing to do is r n a = ery that brings 0 fields based on the same col mn and se the ,d 0licate field, &ey to co0y the hel0 message = ic&ly. !his can be a GlotG faster than o0ening 0 all the forms nder S()G?orms designer7 na*igating a million men s and then doing hea0s of ty0ing. Where I ha*e had the l > ry of s0ecifying an entire a00lication where each col mn had a ni= e name7 it was *ery easy to write scri0ts that 0dated dataty0es7 lengths and hel0 from the table definitions and comments stored in the main data dictionary CAfter I had r n a re0ort to see what my 0date was going to

doD. !his ga*e me a high degree of confidence in the integrity of my a00lication. Similar scri0ts made hel0 consistent for fields across the entire a00lication CI had a s 00lementary table that &e0t my hel0 &eyed on field name7 this was sed to 0date the forms databaseD. De0ending on how yo set 0 forms7 most sers see tables li&e SIS!-M.?:RM5AHH7 SIS!-M.?:RM5B)J7 etc. !hese contain code for forms owned by that ser. If yo are SIS!-M7 then yo can see tables SIS!-M.?:RM5AHH57 SIS!-M.?:RM5B)J57 etc that ha*e code for all sers in them. :.:. Wh4 a,At I see /ata i, a o,tro! 0ie!/% If yo ha*e the Dis0layed attrib te on for a field7 that only means that the field is dis0layed7 not the data. Io need to t rn on -2": I%H.!7 e*en if the field is not to be entered by the ser. :.&. Wh4 is 34 ter3i,a! s ra31!e/ i, a "ser exit% When r nning :racle ?orms7 the line settings are all changed. Hartic larly whether the IL: is raw or coo&ed. If yo are doing terminal IL: in a ser e>it yo will need to sa*e the settings7 set them to what yo want7 do yo r st ff and then reset them. Io can sa*e settings with the .%IE shell command stty /g stty.sa*e.file Restore settings sing stty ]cat stty.sa*e.file] :.<. What ha22e,s to LON>s% ):%+s are only 0artially s 00orted in ?orms '. Anything after the $33th character goes to the great bit b c&et in the s&y. "ow to deal with ):%+s sing forms is to get the R:WID into a field in yo r form. Io r ser e>it 0ic&s this 0 and selects from the base table sing the R:WID7 then brea&s the ):%+ 0 into a n mber of forms fields. R mor has it that ?orms 1 will handle ):%+s a lot better. :.'. What are "ser-writte, 0or3 !e#e! 0", tio,s% !hese are a s0ecialiMed *ersion of 0roced res not 0ro0erly doc mented. !hey *ary from 0roced res in that they &eyword ,f nction, is sed7 they m st be declared with a ret rn ty0e and the &eyword ,ret rn, is sed within the code. A sim0le e>am0le is as follows: D-?I%- HR:2-D.R%AM- # !:5?A"R-%"-I! D-?I%I!I:% # SSS f nction MI5?.%2!I:% C B%AM- in n mber D ret rn n mber is Begin Ret rn CCB%AM- G ; L 3D R '$DK endK -%DD-?I%- HR:2-D.RWithin other code7 it is sed as follows: : f :# !:5?A"R-%"-I! C:cDK 2hoosing to se a f nction o*er a 0roced re is a stylistic iss e. I 0refer to &ee0 all arg ments to f nctions read/only Ci.e. declared as ,in,D and se them where I want to se the

res lt in an e>0ression a lot. I also se the word f nction for those 0roced res that ret rn a sim0le *al e and do not really 0erform side effects. 1.;. "ow can I se reg lar e>0ressions for field *alidation? :J7 yo Fre 0robably a .%IE 0erson as&ing this. ?or those of yo that are not7 reg lar e>0ressions are a m ch more e>0ressi*e way of s0ecifying a ,wildcard string,7 analogo s to N and 5 sed with the ,)IJ-, &eyword of S(). ?or e>am0le PA/2QG! wo ld match !7 A!7 2!7 2A!7 BA!7 BBA2A22A2!. Io need to write a 2 ser e>it that ses the sedstr CD f nction. !his 0ermits both matching Cand tells yo the 0osition of the matchD or s bstit tion Chence the name / ,sed, on 2 stringsD. !his is a*ailable from any com0.so rces. ni> archi*e. !his also ses other HD code7 the ,rege>0, 0ac&age o t of -MA2S. Io can get -MA2S from any +%. archi*e. :f co rse7 yo co ld write the whole thing from scratch sing the rege>0 ro tines 0ro*ided straight from the 2 libraries7 b t sedstrCD is GM.2"G easier to se. %o*ice 2 0rogrammers can se sedstr CD7 they cannot se the standard rege>0 0ac&age. Both these archi*es are on archie.a in A stralia7 in Zft0Lgn and Zft0L senetLcom0.so rces. ni>. I thin& garbo in - ro0e and Simtel in the .S also ha*e this st ff. 2ontact yo r local archi*e ser*er to find the site nearest yo . :.1.. What is a "ser-exit% A ser/e>it is a ro tine in some other lang age Cty0ically 2 or HroG2D written locally and lin&ed in to :racle forms. When I say relin&ed7 I mean create a new e>ec table that incl des yo r ob6ect CG.oD files. !his Gm stG be managed by yo r DBA and tho ght o t caref lly7 as yo r forms e>ec table siMe will increase. Also7 yo r code sho ld be damn well beha*ed or yo Fll core d m0 e*eryone and be most n0o0 lar. .ser e>its are called from yo r H)LS() and can be 0assed an arg ment as a bit fat string 0 to $33 chars. !hey can read and write forms fields sing ,get, and ,0 t, f nctions. It is th s a bad mo*e to incl de a00lication/s0ecific code as ser e>its e>ce0t where absol tely necessary. +eneral 0 r0ose ro tines are another matter. Attrib tes of good candidates are C1D +ood at something forms cannot do easily C$D %ot s itable for B8 DBMS 0i0es. CAct ally DBMS 0i0es are sort/of ,&ernel ser/e>its,D ->am0les of good candidates incl de aD +etting data from non/:racle so rces: te>t files7 other RDBMS bD ->tra string ro tines s ch as rege> ty0e searches cD Dealing 0ro0erly with ):%+S dD ?ancy mathematical f nctions eD Standard IL: *ia files and 0i0es fD Inter 0rocess comm nication: shmem7 soc&ets7 msg=7 sems7 etc. PWarning: Ad :nQ Act ally IF*e written a few of these7 along with the 0arsing of the single command arg ment into argc7 GGarg* for yo 2 Hrogrammers. 2annot release it tho gh as it is 0ro0rietary7 altho gh good deals negotiable with my lords and masters. PAd :ffQ Hro0rietaryD. .ser/e>its are good for things that are C1D not in s=lforms area of e>0ertise andLor C$D to be done at the front end7 not *ia B8 DBMS 0i0es. +ood e>am0les wo ld be ro tines to 0erform rege> searches7 read data from non/:racle so rces7 send

Inter/0rocess comm nication messages ro tines to calc late %ormal distrib tion st ff7 read st ff from te>t files into fields. 1.1<. "ow can I call a 0o0 0 window for field *alidation? :J7 so yo are trying to go to a 0o0 0 window in yo r :n/*alidate trigger and yo cannot. Basically yo cannot do ,goCbl&\fldD Cbl&\fldDnameD, ty0e things in most ,on/,7 ,0re/, and ,0ost/, triggers. What yo need to do is a. Write a 0roced re or f nction that does the to/and/froing. b. 2all that f nction from all the a00ro0riate ,&ey/, triggers in that field conte>t. Io will need to chec& whether the field has changed7 etc. Ie07 it is gly. Anyone got a better way? 3. S()G?:RMS 1 (.-S!I:%S ///////////////////////// 3.1. What new feat res can be e>0ected in forms 1 generator from 2AS-? ?orms will be generated with s 00ort for forms 1 widgets s ch as 0 sh b ttons7 radio bo>es7 chec& bo>es. +.I ob6ects will follow layo t 0references defined in the 2AS- dictionary. 2lient/ser*er a00lications will be generated a00ro0riately. &.2. What ,ew 0eat"res a, 1e ex2e te/ i, 0or3s :% ? ll bac&ward com0atibility with S()G?orms '.<. If yo ha*e forms $.' code7 this sho ld be 0dated first to S()G?orms ' sing iac'<Liag'<. Bac&ward com0atibility with S()GMen 3.< is also s 00orted. CS()GMen f nctionality is incl ded in S()G?orms 1D. +.I ob6ects Cb ttons7 chec& bo>es7 radio b ttons7 images7 dynamic boiler0late7 etcD e*en in characters and bloc& modes. Bitma0 editor. S 00ort for so rce in flat files. Better integration with other :racle 0rod cts Cs ch as gra0hs7 etc7 embedded in a formD. Shared mod les: Some mod les can be 0 t into shared memory segments if yo write a nice set of library f nctions and triggers. !his c ts down the total memory re= irements. 4. HR:G2 (.-S!I:%S /////////////////// <.1. Wh4 are 34 C #aria1!es o#erwritte,% !his = estion only gets 0hrased this way once yo F*e got to the stage of deb gging yo r 0rograms by 0 tting 0rintfCD calls e*erywhere beca se yo cannot fig re o t what is going on. It s ally stems from the fact that yo ha*e been writing 2 for some time and are new to the HroG2 0recom0iler. !he 0roblem is that HroG2 does GnotG nderstand the sco0ing of 2 *ariables in a file. Basically7 if yo ha*e declared a *ariable to HroG2 in an -E-2 S() B-+I% D-2)AR- .... -%D D-2)AR- section7 it is global to the file rather than limited to the 2 sco0ing yo ha*e declared it in. Io also cannot se HroG2 to refer to the same *ariable in different files Ci.e. the same 0art of memory7 by declaring the *ariable to be e>tern in one fileD.

Basically7 e>ce0t where necessary7 it might be a good idea to limit a HroG2 so rce file to a single f nction7 th s a*oiding this sort of 0roblem. !his can 0ose a 0roblem if yo want to deal with *archar data from other files7 as HroG2 does the declaration for yo . Io can 0ass the *archar across to other f nctions by 0ointers. <.2. Ca, I "se C 2re2ro essor /e0i,itio,s 0or 6ARC7AR siEe% .sing HroG27 yo cannot / HroG2 has finished before the 2 0re0rocessor gets a loo& in and it wonFt acce0t a symbol. :ne way aro nd is to write a set of 2 f nctions that deal with *archars and se these in f nctions that do not directly access the database. I ha*e a s ite of f nctions that create a *archar library that 0ermits s ch declarations7 mallocs for *archars7 as well as im0lementations of *archar *ersions of string.h ty0e f nctions and con*ersions. Io can mail me7 or if I become o*erwhelmed7 I will 0ost it again to com0.databases.oracle. Another way sing HroG2 is to D-2)AR- yo r HroG2 *ariables as 0ointers to *archar7 and declaring the GrealG storage in 0arts of the file not seen by HroG2 and sing 2 0re0rocessor symbols. Io can be = ite e*il to embedded S() 0recom0ilers if yo are wanting to get :racle to ret rn a ma>im m of n characters and not o*erwrite yo r nR1th n ll character and th s ma&e 2 strings easy. Sim0ly declare yo r 2 *ariables at the a00ro0riate length to 2 rather than in a D-2)AR- section. !o hold a 4 character string7 yo need se*en bytes. H t the -E-2 S() D-2)AR- section inside 2 comments and ma&e the siMe of the char to be 47 easy if yo &now that the col mn is charC4D. %ote that the -E-2 &eyword m st %:! a00ear on the line in which the comment o0ens7 b t f rther down. -.g. LG Begin 2 comment !his st ff not seen by 2 b t still *isible to HroG2 -E-2 S() B-+I% D-2)AR- S-2!I:%K my*ar charC4DK -E-2 S() -%D D-2)AR- S-2!I:%K -nd of 2 comment GL char my*arP8Q # ^ <7<7<7<7<7<7< _ K %ote that HroG2 then ass mes it is binding a 4/byte char field7 2 has got 8 bytes7 which yo set to all n ll C<>D characters and yo can get data in and o t = ic&ly as :racle will only ta&e or 0 t 4 characters7 b t 2 f nctions li&e strcm0CD will not r naway as the 8th byte has a n ll terminating character. .nless yo hide the S() declarations from 27 yo will get d 0licate D-2)AR- within 2 comments. Definitely not s 00orted b t can ma&e life m ch easier. It is also the nicest 0er*ersion of a lang age facility that I e*er coo&ed 0. !his tric& was first de*elo0ed for the Ingress es=lc 0recom0iler. "a*e not tried it for a while / I se my *archar handling library to deal with *archars and I do not ris& getting into tro ble sho ld the ne>t release of HroG2 get the smarts to &now if it is commented o t. )et me &now if yo find it to wor&. <.8. What a, I /o a1o"t K!i,e too !o,5K errors with #ersio, o,tro!% Bersion control systems s ally s bstit te a symbol in yo r original code with a longer e>0ansion. ?or e>am0le7 in R2S7 yo can ha*e the &eyword Id that e>0ands to incl de the filename7 a thor7 date7 etc. As HroG2 is at least slightly brain/damaged

definition errors7 which is why yo

in not being able to handle long lines C0artially fi>ed by a 2ommand/line o0tion that 0s the limit a bitD7 yo sho ld be caref l of this and se se0arate *ersion control &ey words on different lines7 e.g. the filename7 a thor and *ersion n mber &eywords sho ld be &e0t se0arate. Io can also ma&e it safer by sing a *ariable in yo r ma&e files Cor e= i*alentD7 HR:27 defined to incl de the a00ro0riate command line switches yo commonly se7 incl ding the one to set in0 t and o t0 t line lengths to the ma>im m. <.:. Wh4 /o 34 o32i!es rash or weir/ thi,5s ha22e,% Sometimes yo r 2 com0iler does not obey the System B way of doing things. !his ha00ens in BSD deri*ed *ersions of .ni> Cli&e S n:SD and BMS. Basically if there is an o0tion a*ailable to se System B com0atibility on yo r gear7 then those o0tions sho ld be sed when wor&ing with HroG2. See similar = estion in .%IE (.-S!I:%S section. If yo ha*e a ,d al ni*erse, machine7 li&e Hyramids and some others7 ma&e s re yo do yo r 2 com0ilation in the A!&! System B en*ironment. <.&. Ca, I "se CNN% HroG2 is not designed for 2RR. Io can of co rse se the :2I Cthe :racle 2 InterfaceD in 2RR and lin& in the a00ro0riate libraries as yo do not ha*e to 0ass yo r code thro gh the HroG2 0recom0iler. If yo GdoG want to se 2RR with embedded S()7 then what yo sho ld do is write a ,wra0aro nd, 2 f nction in HroG2 and call this from yo r 2RR code where a00ro0riate. Be caref l7 howe*er7 beca se not all the code 0rod ced from HroG2 is s itable as re/entrant code. I belie*e that a third 0arty has an S()G2RR 0rod ct a*ailable7 b t I ha*e no details as yet. <.<. 7ow /o I "se O(SO!o5i,% .se ,L, for the sernameL0assword combination

8. 2AS- (.-S!I:%S ////////////////// =.1. Ca, CASE 5e,erate 0or3s with ow,er 2re2e,/e/ to ta1!e ,a3es% Set the !AB:W% o0tion. =.2. Ca, CASE 5e,erate 6= /ata1ases% 2AS- 3.1 is needed to ta&e f ll ad*antage of B8 constr cts from within 2AS-.

9. .%IE (.-S!I:%S ////////////////// 9.1. 2an I create a com0ressed e>0ort on the fly witho t needing to ha*e the s0ace for both the e>0ort file and the com0ressed file? Ies7 se named 0i0es. m&nod 0 mye>0ort.dm0 ` Ma&e the 0i0e com0ress S mye>0ort.dm0 mye>0ort.dm0.U & ` Bac&gro nd com0ress ->0ort scottLtiger filename#mye>0ort.dm0 ` Do e>0ort !he only s0ace yo need is that for the final com0ressed file and abo t 1 dis& bloc&s for the 0i0e. !his is beca se if the 0i0e is f ll Ccom0ress might be slower than e>0ortD7 the writing 0rocess is bloc&ed ntil the 0i0e em0ties a bit. !he res lt is *ery efficient with dis&. Io can do a similar thing the other way to im0ort the file. '.2. 7ow a, I 2re#e,t trai!i,5 s2a es i, a s2oo!e/ re2ort% Io canFt. Host/0rocess with sed:

sed /e FsL GYLLF S infile o tfile !his 0roblem affects other :S *ersions as well. ?or BMS7 yo wo ld ha*e to write a D2) scri0t that fiddles with SISYI%H.! and SISY:.!H.! and ses )-EI2A)S to trim the lines. DonFt as& me for details / my BMS is r sty and I do not ha*e a man al handy. 2o ld someone mail me CdirectlyD the D2) and IFll incl de it here and mo*e the = estion to S()GHl s. '.8. 7ow a, I 5et a, e,#iro,3e,ta! #aria1!e i,to SQLB(!"s #aria1!es% a. 2reate a se= ence accessed in glogin.s=l Ce.g. my5se=D !his 0ermits yo to ha*e a , ni= e, n mber to b ild a file that will not conflict with another 0rocess. 2ol mn > old5*al e tm05n m no0rintK Set heading off Set 0a se off Select my5se=.new*al e > from d alK b. 2reate a geten*.s=l scri0t li&e the following host echo ,define &1#O,Y&1O,, Y":M-Ls&&tm05n m..s=l start Y":M-Ls&&tm05n m..s=l host rm Y":M-Ls&&tm05n m..s=l c. When yo want to create a *ariable ,):+%AM-, that reflects the ):+%AM- en*ironment *ariable7 do the following start geten*.s=l ):+%AM:J7 so it is a bit reso rce hea*y7 and may need to be altered for yo r im0lementation7 b t yo sho ld get the basic idea. :f co rse7 S() *ariables are %:! case sensiti*e.... :ther o0erating systems can do a similar thing7 I wo ld e>0ect7 b t not necessarily so easily. .nder BMS7 for e>am0le7 I had to write a 2 0rogram that did a geten*C'2D and then 0rod ced the S=l0l s scri0t file that had the define in it. "owe*er7 beca se of the 0rocess model of BMS7 it was m ch too slow a0art from the most im0ortant *ariables. Maybe let the 2 0rogram ta&e m lti0le arg ments and 0rod ce a line for each. '.:. Ca, I 2i2e st"00 thro"5h SQLB(!"s% Ies. ?or e>am0le in *i7 I often need to reference a table str ct re. I sim0ly ty0e ,desc -MH, into a new line in my b ffer7 :.7.WS=l0l s /s L and wait for the em0loyee table descri0tion to a00ear7 which then gets c t and 0asted into the S() statement I want. Hi0ing thro gh gre0 is handy7 as is thro gh sed or e*en aw& for formatting. Serio sly tho gh7 get :ra0erl. '.&. Wh4 /oes (roBC o32i!es or 2ro5ra3s rash o, 34 S",% Some Bac&gro nd /////////////// S n:S 1.> Ca.&.a. Solaris 1D is a BSD based :S. It comes with two 2 com0ilers. :ne is in L srLbinLcc Cwhich sho ld be lin&ed to LbinLccD and it the BSD com0iler7 0ointing to BSD header files and libraries. !he other is in L srL3binLcc Cwhich sho ld be lin&ed to L3binLccD and 0oints to A!&! System B headers and libraries. Io may ha*e +%. 2 installed on yo r system. %ote that Solaris $ is System B/based. S n:S 1.1 comes standard with !W: 2 2om0ilers. LbinLcc !he BSD based com0iler +ets defa lt incl des and libraries from L srLincl de and L srLlib

L3binLcc !he A!&! com0iler +ets defa lt incl des and libraries from L srL3incl de and L srL3lib Io may also ha*e +%. 2 installed on yo r system. !his too is based 0on BSD. !he BSD and A!&! com0ilers se libraries and incl de files from different directories7 reflecting the system libraries of the two different dialects of .%IE. Sometimes the f nction is 6 st called nder another name7 sometimes the n mber of 0arameters Cand their orderingD is different. ->am0les incl de +et wor&ing directory 2o0y Memory 2om0are Memory getcwd *s. getwd memc0y *s bco0y memcm0 *s bcm0

:racle HroG2 libraries call System B library f nctions if one is 2ommonly a*ailable for yo r architect re. :b*io sly7 if the :racle libraries ha*e references to the System B *ersion7 they will either be nresol*ed in the BSD libraries7 or worse7 resol*e to something ina00ro0riate. What to Do ////////// :racle recommends that when sing HroG2 Cor e*en installing and lin&ing :racleD yo ha*e the L3bin directory ahead of Lbin in yo r HA!" *ariable. P!his is good 0ractice anyway7 beca se yo will get sed to the System B *ersions of commands Cdf and 0s are good e>am0les of this / I s ally create a soft lin& to LbinL0s and LbinLdf as L srLlocalLbinLb0s and L srLlocalLbinLbdf / a similar 0ractice to "H when they s 00ly both *ersions of a tilityD. Q Io might li&e to try the following if yo GreallyG want to se the +%. 2 Cor other BSDD com0iler. C1D .sing +%. 27 b t 0oint at System B libraries C$D .sing +%. 2 and libraries b t add in yo r own7 written in +%. 2 that mimic the system B calls. Io Fll &now which ones yo need7 as they will be the nresol*ed references. Some of these may sim0ly be st bs that call the BSD f nction of a different name or reorder the 0arameters. C'D ->tract the f nctions yo need from the System B libraries and add them to yo r list to be lin&ed in *ia the ma&e file. When wor&ing in the :racle en*ironment Cor sim0ly to hel0 yo change to a System B frame of mindD7 yo sho ld 0 t the System B directories ahead of the BSD directories in yo r HA!". Also7 the 22 *ariable Ces0ecially in yo r Ma&efilesD sho ld 0oint to the System B com0iler. Alternati*ely7 yo can try sing the /I L3incl de and /) L3lib flags ahead of other directories. C!hese are 0robably lin&ed from L srL3incl de and L srL3libD. )oo&7 I &now it in*ol*es some hac&ing7 b t if yo are that &een on +n 2 and only sing yo r 0rod cts in/ ho se7 yo sho ld be :J. I am not &noc&ing +n 27 mind yo . +n 2 is a m st for many sho0s de*elo0ing in/ho se code and com0iling things from the net. :ne R&D sho0 I wor&ed in tried it o t on o r code7 and it ga*e tighter e>ec tables than the nati*e "H com0iler at the timeW :ne other thing to note if yo are r nning Solaris $ is that the good 2 com0iler has been nb ndled. !he com0iler that comes standard with S ns now is re0orted by some to be dain bramaged. If yo are serio s abo t yo r com0iler Cand yo sho ld be if yo are r nning :racleD then s0end the money and get the GR-A)G de*elo0ers &it. CAt least this is not as bad as some .%IE systems distrib ted witho t a com0ilerWD '.&. 7ow a, I 0i,/ a !ost Ora !e ex2ort 0i!e%

Io need to add a descri0tion of the layo t of an e>0ort file to the LetcLmagic file. See magic C1D and file C1D for details. .se the fact that an :racle e>0ort starts with a control/A and then the word -EH:R! and the *ersion n mber of the e>0ort that 0rod ced it. C.se the string C1D or od C1D command to chec& this o tD. Io r system administrator can then edit LetcLmagic to not :nly recogniMe an e>0ort file b t tell yo the *ersion n mber when yo se fileC1D. Say the &ey descri0tion was ,:racle ->0ort,7 yo can loo& for :racle e>0ort files from the c rrent directory and below as follows: find . /ty0e f /e>ec file ^_ OK \ gre0 ,:racle ->0ort, \ O sed /e FsL:.GLLF '.<. 7ow a, I te!! 3a$e a1o"t SQLB9or3s% I se a ma&e incl de file Y:RA2)-5":M-LlocalLincl deLoracle.m&. Among other things it sets 0 the following: :.H # L ` :racle serL0assword7 defa lts to :HSYlogin IA+ # iag'< ` +enerates .frm from .in0 IA2 # iac'< ` 2on*erts bLw ?:RM5N tables and .in0 ` I se .dbo to sign a form o t of database7 and .dbi as a sign/in . S.??IE-S: .in0 .frm .dbo .dbi . In0.frm: / rm YG.frm YG.erf / YCIA+D YG YC:.HD YG. in0.err $&1 test YG.frm . in0.dbi: / rm YG.frm YG.erf / YCIA+D YG YC:.HD YG. in0.err $&1 test YG.frm / YCIA2D /d YG YG YC:.HD YCIA2D /i YG YG YC:.HD to ch YG.dbi . dbo.in0: / m* YG.in0 YG.in0.ba& YCIA2D YG YG YC:.HD / to ch YG.dbo to ch YG.in0 ;. MIS2 (.-S!I:%S ////////////////// +.1. 7ow a, I a!ter ta1!e stora5e 2ara3eters 0ro3 a, ex2ort 0i!e% .se the ndoc mented I%D-E?I)-#>>>>> 0arameter. !his creates an AS2II file ,>>>>>, with the table creation statements R-Mmed o t and the inde> creation statements not. -dit this to change the table storage 0arameters Cs ch as initial siMe7 tables0ace7 etcD. ->am0le: im0 scottLtiger filename#mye>0ort.dm0 inde>file#mye>0ort.s=l B!W7 it IS doc mented in B8. +.2. What 3a$es the 1est Ora !e ser#er 0or a ,etwor$% :J7 I am biased and will say get a S n. -*en the low/end SHAR2lassic might ser*ice aro nd '$ conc rrent sers7 b t yo are limiting yo r 0gradeability. A SHAR2/1< is 0robably the best :0tion for mid/range st ff for the long term. If yo are 0 shing de0artmental ser*ers C sers 0 shing the 1<< mar& and abo*eD consider the SHAR2ser*er 1<<< series.

!here is some 6 stification for this7 :racle do most of their de*elo0ment on S ns7 more :racle licences go onto S ns than anything else and so releases will be timely and well s 00orted. Also7 as the most im0ortant so rce of re*en e for :racle is .%IE based7 going .%IE for the ser*er is 0retty sensible. Act ally7 :racle and S n get to loo& at each otherFs so rce code at early de*elo0ment le*els and are "-ABI)I allied against the common enemy7 a.&.a Bill +ates. !al& is that :racle and S n is abo t to release benchmar&s sing :racle B8 and S nFs Solaris $.1 that will show *ery good bang for b c& com0ared to anything else. !he other thing is that S nFs Solaris $.$ is r mored to ha*e RAID and Vo rnalled ?ile Systems7 ma&ing it *irt ally :J to &ic& o t the 0ower s 00ly witho t too m ch drama. !his combined with :racle DBA tools ma&es a 0retty good fa lt tolerant machine. With %etware C%o*ellD and WABI Cr n Windows binariesD facilities a*ailable or b ndled7 it is a 0retty attracti*e machine. In the mid/range7 I do thin& I sho ld at least mention "H and Se= ent. 2ertainly I ha*e ne*er had any 0roblems with "H &it or ser*ice. ?or low end sers7 e*en tho gh a %o*ell7 or :SL$ ser*er might loo& chea0er7 I do thin& that .%IE ma&es a better architect re for something as com0le> as a m lti/ ser database to li*e in. .nless7 of co rse7 r mors of %o*ell b ndling :racle sometime in the f t re are tr e and the 0rice becomes im0ossible to resist. !he Ca00arentD lac& of Birt al Memory in %o*ell means the :racle ser*er co ld r n o t of memory and blow 0. Windows %! co ld be interesting. It 0romises hea0s of feat res7 b t on loo&ing recently at the ,system calls, for Windows I bal&ed at the loss of clean elegance at .%IE str ct res. Herha0s Windows %! will be 6 st as threatening. PWhat 0latform does %! 0erform best on? A '3mm slide 0ro6ector :/DQ Its chief designer7 an e>/D-2 S-7 howe*er7 does deser*e res0ect tho. +.8. 7ow a, I i32!e3e,t #ersio, o,tro!% !he iss e of *ersion control for :racle a00lications code is a stic&y one and is com0licated by iss es of different o0erating systems7 b t most es0ecially by :racleFs 0redilection for %on/AS2II storage formats. %ote the r c& s ca sed when :racle 0ro0osed no AS2II .in0 format file for ?orms1. Bersion control is an im0ortant iss e for MIS de0artments howe*er and M.S! be s ccessf lly addressed7 otherwise things start 1. 2hoice of Bersion 2ontrol !ool ////////////////////////////////// !here are a n mber of *ersion control tools a*ailable for different 0latforms. !hese incl de 2MS for BAELBMS and S22S for A!&! .%IE. In the MS/D:S world7 most formats are 0ro0rietary. : r choice of tool was R2S howe*er7 beca se of the following reasons a. Re0orts and management are more ser friendly than S22S7 the defa lt tool for .%IE7 o r main de*elo0ment 0latform Caltho gh o r networ& incl des D:S and BMS nodesD. b. So rce code is a*ailable in the 0 blic domain from most sites archi*ing +%. code. !his ma&es it 0ossible to 0ort it fairly easily7 es0ecially if yo are r nning BAELBMS and ha*e either the H:SIE 2 libraries or sing +%. 2. D:S so rce code falling a0art.

and binaries are also a*ailable. We can also modify the way some of the 0rograms C0artic larly the re0ort 0rogramsD wor& to 0erform e>tra things we li&e. c. !he binary files sed to store initial code and deltas Cfrom which any *ersion can be retrie*edD are com0atible across architect res. ?or e>am0le7 I can se the D:S R2S 0rograms to e>tract so rce files from the binary R2S files transferred from the .%IE machine. d. An add/on7 2BS7 also a*ailable in the 0 blic domain7 0ermits fairly easy management where !W: sites are carrying o t conc rrent de*elo0ment. !his is common where a *endor is 0ro*iding the so rce7 b t some local changes are being made. e. Her sal of :racle so rce code for scri0ts and the li&e shows that they se R2S. If itFs good eno gh for them to se HD 0rod cts ..... f. R2S is more efficient than the System B standard S22S. S22S stored the original intact and then the deltas. R2S stores the most recent intact and then the deltas. +etting more recent files is th s easier with R2S. g. R2S 0ermits yo to ,remo*e, intermediate *ersions Ce.g. between 8.$ and 8.3 when yo are on ;.1D when re= ired.S22S $. : tline of R2S o0eration //////////////////////////// -ssentially7 yo chec& in a file to R2S Cwith o0tional sec rity information7 ,aliases, for the *ersion and state informationD. S bse= ent chec& ins are stored as deltas within the R2S storage file7 C nless yo are chec&ing in binary files7 in which case the entire new co0y is storedD. ?or AS2II files7 R2S loo&s for certain &eywords7 and on chec& o t7 s bstit tes the *ersion s0ecific information. !hese &eywords are enclosed between dollar signs. !hese &eywords incl de R2Sfile "eader A thor So rce Date State Id filename witho t 0ath 2ombination of the &eywords below !he ser name of the file owner ? ll 0athLfilename of so rce Date and time of chec& in A &eyword yo can assign e.g. ,2 t,7 ,!ested,7 etc A combination of all information CDangero s for many :racle 0rod ctsD cannot.

Io sho ld be able to see e>0anded *ersions of these near the to0 of this file. I ha*e not sed the dollar signs here as they wo ld get e>0anded and r in the format. Io can also ca se R2S to incl de in yo r so rce all comments made s0ecific to that *ersion7 for e>am0le7 the reason why changes had to be made sing the )og &eyword. %ote that with AS2II files7 only storage for the changes between s ccessi*e *ersions are re= ired. ?or binary files7 the entire file is stored / chewing 0 dis& fairly = ic&ly. Bario s R2S tilities allow yo to e>tract any *ersion7 merge changes from different branches and see the differences between any two *ersions. Bersions for m lti/ ser o0erating systems allow better control than the nati*e o0erating system7 as yo can assign a list of

sers a thoriMed to mani0 late the files. A thoriMed sers can be different for each file. '. Basic Hhiloso0hy of Bersion 2ontrol with :racle A00 So rce ////////////////////////////////////////////////////////////// Where*er 0ossible7 se *ersion control on AS2II re0resentations of the code. !h s for forms7 se the .in0 file7 for men s7 the .s=l file 0rod ced by ,e>0orting, the men . ?or S()GRe0orts7 .re> files rather than .re0 files are 0 t nder *ersion control. !he &eywords are 0laced in the so rce7 howe*er yo li&e7 the AS2II file 0rod ced chec&ed in to R2S. When mo*ing to a testing or 0rod ction en*ironment7 the so rce is chec&ed o t of R2S Cres lting in &eyword s bstit tionD and ,com0iled, in the target en*ironment to 0rod ce the r ntime a00lication. 1. +eneral 2a*eat ////////////////// Where so rce code for an :racle a00lication can be stored in the database Cs ch as forms or men D7 &eyword e>0ansion of the Id &eyword can be dangero s7 as it may e>0and to M:R- than the database allows to be stored. !h s7 rather than se Id7 I se the more atomic &eywords on different lines7 these being nli&ely to e>0and abo*e legal limits. 3. S0ecifics for some 0rod cts /////////////////////////////// A .S()GHl s Scri0ts R2S &eywords are generally 0laced in Remar& lines B. S()G?orms R2S &eywords are 0laced in the comments at forms le*el. Selected &eywords are 0laced as defa lt *al es for %on/enterable fields7 so that the ser can see *ersion information. 2. S()GMen R2S &eywords are 0laced either in the title section of a men or in the defa lt *al e for a 0arameter7 de0ending on how we want to se the &eyword. If yo do not want to do this7 0 t a wra0aro nd f nction to create the Remar& lineCsD at the to0 of the .s=l file 0rior to chec&ing it in. !his will %:! affect 2om0ilation of the res lting .dmm. D. S()GRe0ortWriter Ma6or B.MM-R7 .re> files are not ,sensible, AS2II that will 0ermit e>0ansion of R2S &eywords. !he only way I &now how to sol*e this is to *ersion an AS2II file 0rod ced by selecting the data o t of the re0ort writer internal tables and *ersioning that7 then sing S()G)oader to 0 t them bac& into the S()GRe0ortWriter tables in the 0rod ction en*ironment. While this wo ld wor&7 I ha*e not tried it myself Cas we do not se RWD7 b t a00arently some gro 0 in the .S has a tool that 0erforms this tas&. If anyone &nows how I can contact that gro 07 let me &now 0lease. %otes: 1. R2S and 2BS7 together with the +%. com0iler yo may need are a*ailable from most +%. archi*e sites. If yo are in A stralia7 try archie.a in Zft0Lgn . )ess 0/to/date *ersions are also a*ailable in com0.so rces. ni>. $. D:S R2S e>ec tables are a*ailable from SIM!-). Again7 in A stralia7 try archie.a Csomewhere nder

Zft0LmicrosL0cLoa&7 I forget which s bdirectoryD. '. I thin& I ha*e seen :SL$ *ersions of R2S floating aro nd. Io co ld 0robably get the D:S 0atches and com0ile it for the :SL$ en*ironment with a few mods anyway. +.8. What 1oo$s are a#ai!a1!e a1o"t Ora !e% ?irst of all7 I m st mention the range of boo&s 0rod ced by :racle. Io might not get the ones yo need sim0ly by ordering the man als for the 0rod cts yo b y. ?or e>am0le7 there are = ite a few boo&s written by the :racle .J team that are e>cellent7 es0ecially ,Ad*anced S()G?orms !echni= es, and *ario s 2ASreferences Cwell :racle .J was originally an inde0endent gro 0 that created 2AS-7 then &nown as SDDD. Also loo& o t for the :racle Herformance ! ning + ide. Some of the ,:racle .J, boo&s are 0 blished inde0endently by Addison/Wesley and written by Richard Bar&er and 2liff )ongman. %ote that :racle ha*e a whole boo& that lists technical 0 blications a*ailable from them. !his is worth getting. :ther boo&s incl de: 1. :racle ! ning beyond !he Man al Heter 2orrigan and Mar& + rry 2o*ers :racle 0erformance from design7 DBA and a00lication 0rogrammer 0ers0ecti*es. !his boo& has been recommended by a n mber of 0eo0le7 and ha*ing wor&ed with Mar& briefly in 1;997 I can tell yo that he is no idiot. !he thing to remember abo t this boo& is that there are abo t to be two *ersions of it. !he first has been 0 blished by the a thors themsel*es for AY4;. C3$ Rowena Harade7 Richmond7 Melbo rne7 Bic7 A stralia or mag[scammell.ecos.tne.oM.a D. !he second *ersion is to be made a*ailable by :FReilly and Associates in Se0 ;' and is 0robably to be called ,:racle Herformance ! ning,. According to Mar&7 there has been almost a com0lete re/write together with the :FReilly editors and it is now at the final re*iew stage. While there ha*e been a n mber of ty0os introd ced by the rewrite which are c rrently being addressed7 Mar& seems to thin& that the res lt is a m ch more readable boo& than the original *ersion. :FReilly are sending me a re*iew co0y Cthan&sWD so e>0ect more details in 0coming iss es. $. Mastering :racle B4 Daniel 2ronin and Voe )ee Hro*ides a good o*er*iew of B4 a00lication de*elo0ment in one handy boo& with an almost com0lete a00lication sed as an e>am0le. !his boo& came o t *ery soon after !he release of B4 and th s only disc sses ?orms $.' and has a B3 to B4 migration g ide. %ot really detailed eno gh for 0ower 0rogramming7 does not go into HroGEEE lang ages7 b t great for somebody 6 st mo*ing into RDBMS or :racle. It wo ld be nice to see a new edition for B8. ?????? +eorge Joch "a*e not seen this boo&7 b t has generally recei*ed fa*orable re*iews. A00arently the B8 st ff seems tac&ed on to the end. DanFs :racle8 + ide Daniel B. Bi&le IF*e 0 t this here7 beca se I thin& Dan will be mar&eting this7 tho gh some drafts are a*ailable from him gratis. "e is b ilding an AS2II file of ti0s and e>am0le code that can be c t and 0asted into yo r code. IF*e seen early drafts and it loo&s sef l. Dan is an ->/:racle em0loyee and can be contacted *ia dbi&le[al mni.caltech.ed and .S 0hone 113L931/;31$.

'.

1.

New Q"estio,s 1<.1 What is )ibrary 2ache )oc&s When a database ob6ect Cs ch as a table7 *iew7 0roced re7 f nction7 0ac&age7 0ac&age body7 trigger7 inde>7 cl ster7 or synonymD is referenced d ring 0arsing or com0iling of a str ct red = ery lang age CS()D7 CData Mani0 lation )ang age CDM)D or Data Definition )ang age CDD)D7 H)LS()7 or Va*a statement7 the 0rocess 0arsing or com0iling the statement ac= ires the library cache loc& in the correct mode. In :racle;i7 the loc& is held only ntil the 0arse or com0ilation com0letes Cfor the d ration of the 0arse callD.

Ora !eP 9re-"e,t!4 As$e/ Q"estio,s //////////////////////////////////////////////////////////////////////////////// What b ilt/in f nctionsLo0erators are a*ailable for mani0 lating strings? 2an I 0rint inside a H)LS() 0rogram? Is it 0ossible to write a H)LS() 0roced re that ta&es a table name as in0 t and does something with that table? What is the correct synta> for ordering = ery res lts by row/ty0e ob6ects? "ow do I &ill long/r nning = eries in s=l0l s7 HroG27 and VDB2? In HroG27 why do I get a strange ,brea& o tside loo0 or switch, error message? //////////////////////////////////////////////////////////////////////////////// What b ilt/in f nctionsLo0erators are a*ailable for mani0 lating strings? !he most sef l ones are )-%+!"7 S.BS!R7 I%S!R7 and \\: )-%+!" CstrD ret rns the length of str in characters. S.BS!R Cstr7m7nD ret rns a 0ortion of str7 beginning at character m7 n characters long. If n is omitted7 all characters to the end of str will be ret rned. I%S!R Cstr17str$7n7mD searches str1 beginning with its n/th character for the m/th occ rrence of str$ and ret rns the 0osition of the character in str1 that is the first character of this occ rrence. str1 \\ str$ ret rns the concatenation of str1 and str$. !he e>am0le below shows how to con*ert a string name of the format Flast7 firstF into the format Ffirst lastF: S.BS!R Cname7 I%S!R Cname7F7F7171DR$D \\ F F \\ S.BS!R Cname7 17 I%S!R Cname7F7F7171D/1D ?or case/insensiti*e com0arisons7 first con*ert both strings to all 00er case sing :racleFs b ilt/in f nction 00erCD Cor all lower case sing lowerCDD. //////////////////////////////////////////////////////////////////////////////// 2an I 0rint inside a H)LS() 0rogram? Strictly s0ea&ing H)LS() doesnFt c rrently s 00ort IL:. B t7 there is a standard 0ac&age DBMS5:.!H.! that lets yo do the tric&. "ere is an e>am0le: // create the 0roced re 2R-A!- HR:2-D.R- nothing AS B-+I% DBMS5:.!H.!.H.!5)I%-CFI did nothingFDK // se !:52"AR to con*ert *ariablesLcol mns // to 0rintable strings -%DK . R.%K // set o t0 t onK otherwise yo wonFt see anything S-! S-RB-R:.!H.! :%K // in*o&e the 0roced re B-+I% nothingK -%DK . R.%K !hen yo sho ld see ,I did nothing, 0rinted on yo r screen. DBMS5:.!H.! is *ery sef l for deb gging H)LS() 0rograms. "owe*er7 if yo 0rint too m ch7 the o t0 t b ffer will o*erflow Cthe defa lt b ffer siMe is $JBD. In that case7 yo can set the b ffer siMe to a larger *al e7 e.g.: B-+I%

DBMS5:.!H.!.-%AB)-C1<<<<DK nothingK -%DK . R.%K //////////////////////////////////////////////////////////////////////////////// Is it 0ossible to write a H)LS() 0roced re that ta&es a table name as in0 t and does something with that table? ?or 0 re H)LS()7 the answer is no7 beca se :racle has to &now the schema of the table in order to com0ile the H)LS() 0roced re. "owe*er7 :racle 0ro*ides a 0ac&age called DBMS5S()7 which allows H)LS() to e>ec te S() DM) as well as DD) dynamically at r n time. ?or e>am0le7 when called7 the following stored 0roced re dro0s a s0ecified database table: 2R-A!- HR:2-D.R- dro05table Ctable5name I% BAR2"AR$D AS cid I%!-+-RK B-+I% // o0en new c rsor and ret rn c rsor ID cid :# DBMS5S().:H-%52.RS:RK // 0arse and immediately e>ec te dynamic S() statement // b ilt by concatenating table name to DR:H !AB)- command DBMS5S().HARS-Ccid7 FDR:H !AB)- F \\ table5name7 dbms5s=l.*8DK // close c rsor DBMS5S().2):S-52.RS:RCcidDK -E2-H!I:% // if an e>ce0tion is raised7 close c rsor before e>iting W"-% :!"-RS !"-% DBMS5S().2):S-52.RS:RCcidDK // reraise the e>ce0tion RAIS-K -%D dro05tableK . R.%K //////////////////////////////////////////////////////////////////////////////// What is the correct synta> for ordering = ery res lts by row/ty0e ob6ects? As a concrete e>am0le7 s 00ose we ha*e defined an ob6ect ty0e Herson!y0e with an :RD-R M-MB-R ?.%2!I:%7 and we ha*e created a table Herson of Herson!y0e ob6ects. S 00ose yo want to list all Herson!y0e ob6ects in Herson in order. Io Fd 0robably e>0ect the following to wor&: S-)-2! G ?R:M Herson 0 :RD-R BI 0K B t it doesnFt. Somehow7 :racle cannot fig re o t that yo are ordering Herson!y0e ob6ects. "ere is a hac& that wor&s: S-)-2! G ?R:M Herson 0 :RD-R BI D-R-?CR-?C0DDK //////////////////////////////////////////////////////////////////////////////// "ow do I &ill long/r nning = eries in s=l0l s7 HroG27 and VDB2? Sometimes it is necessary to sto0 long/r nning = eries7 either beca se they ta&e longer to r n than yo Fd li&e7 or beca se yo realiMe yo F*e made a mista&e. It is im0ortant &ill off s ch = eries 0ro0erly so that they donFt ta&e 0 e>tra com0 tational reso rces and 0re*ent others from sing the system7 es0ecially near 0ro6ect deadlines when reso rces are most strained. As a general 0reca tionary meas re7 0lease be s re to test yo r = eries nder s=l0l s 0rom0t before r nning them thro gh 2+I or VDB2. It is m ch easier to &ill a = ery in s=l0l s than in 2+I or VDB2. If yo r test = ery ta&es a long time to r n nder s=l0l s7 yo can sim0ly hit 2trl/2 to terminate it. %e*er close an ssh or telnet or >term window witho t 0ro0erly logging o t. Always = it yo r 0rograms Cincl ding s=l0l sD7 sto0 Va*a ser*lets7 and ty0e ,e>it, or ,logo t, to = it. If yo force/close yo r sshLtelnetL>term window7 there may still be 0rocesses r nning in the bac&gro nd7 and yo may be ta&ing 0 system reso rces witho t &nowing it. If7 for some reason7 yo cannot logo t normally Cfor e>am0le7 the system is not res0ondingD7 yo sho ld o0en another window7 login to the same machine where yo ha*e the 0roblem7 and &ill the 0rocesses that is ca sing tro ble: !y0e ,0s /aef \ gre0 P sernameQ, to find the Hrocess IDs of yo r 0rocesses Cre0lace P sernameQ with yo r leland ser nameD7 and &ill the 0rocesses yo want to terminate sing ,&ill P0rocessIDQ,. Always se the ,&ill, command witho t the /; flag first. .se /; flag only if yo cannot &ill it otherwise. If yo closed the window by mista&e and do not remember which sweet hall machine yo were logged into7 o0en another window immediately and log into any sweet hall machine7 then ty0e ,sweetfinger P sernameQ, Cre0lace P sernameQ with yo r act al leland ser nameD. It will gi*e yo the machine names yo were on a few min tes ago. !hen7 log in to the a00ro0riate machine and &ill yo r 0rocesses there.

If yo iss ed a = ery thro gh VDB2 that is ta&ing a long time to e>ec te and yo want to &ill it7 yo sho ld sto0 yo r Va*a ser*let. In most cases this will &ill the = ery. Io can also se the set( ery!imeo tCPtime in secondsQD method on a statement ob6ect to sto0 = eries that r n too long. If yo iss ed a = ery thro gh 2+I that is ta&ing a long time to e>ec te7 normally the 2+I ser*ice will &ill it for yo within 1< seconds. "owe*er7 the abo*e occasionally fails to wor&7 and we do not &now of any better way of &illing r naway = eries iss ed by VDB2 or 2+I Cother than as&ing the administrator to &ill them for yo D. !hatFs why we as& yo to always test yo r = eries nder s=l0l s first. It is m ch easier to &ill = eries there. //////////////////////////////////////////////////////////////////////////////// In HroG27 why do I get a strange ,brea& o tside loo0 or switch, error message? If yo get an error message ,brea&, o tside loo0 or switch when com0iling yo r HroG2 0rogram7 chances that yo ha*e the following statement somewhere before a loo0: -E-2 S() W"-%-B-R %:! ?:.%D D: brea&K After the loo07 yo sho ld insert the following statement: -E-2 S() W"-%-B-R %:! ?:.%D 2:%!I%.-K !his wo ld cancel the 0re*io s W"-%-B-R statement. If yo do not do this7 yo may get the error message at s bse= ent S() calls. Ora !e 9a-Hs ,:racle 9i is what ty0e of database? ,7,AD hierarchical networ& BD ob6ect networ& 2D hierarchical relational DD ob6ect relational,7,DD ob6ect relational , ,Which two Cif anyD of the following three W"-R- cla ses are e= i*ilent. C%ote / the n mbers are for reference only7 they are not 0art of the W"-R- cla sesD 1 W"-R- ename # FSMI!"F $ W"-R- .HH-RCenameD # FsmithF ' W"-R- ename # .HH-RCFsmithFD,7,AD 1 and $ BD 1 and ' 2D $ and ' DD each will yield different res lts,7,BD 1 and ', ,Which &eyword is sed to s 00ress d 0licate rows from being dis0layed?,7,AD S.HHR-SS BD DIS!I%2! 2D .%I(.DD %:%D.H)I2A!-,7,BD DIS!I%2!, ,A 0rimary &ey can be made 0 of,7,AD one col mn BD two col mns 2D three or more col mns DD A7 B7 or 2 -D %one of the abo*e,7,DD A7 B7 or 2, ,Which of the following :racle *ersions meets A%SI standards?,7,AD S()GHl s BD H)LS() 2D S() DD IS:,7,2D S(), ,Which of the following is not a H)LS() section?,7,AD )::H BD -E2-H!I:% 2D D-2)ARDD B-+I%,7,AD )::H, ,Which of the following does ha*e a semi/colon at the end?,7,AD A ?R:M cla se which is followed by a W"-Rcla se BD !he &eyword -%D at the end of a H)LS() bloc& 2D !he &eyword D-2)AR- at the beginning of a H)LS() bloc& DD A S-)-2! cla se,7,BD !he &eyword -%D at the end of a H)LS() bloc&, ,Which was the first ob6ect/ca0able database de*elo0ed by :racle?,7,AD :racle 3.$ BD :racle 8 2D :racle 9

DD :racle 9i,7,2D :racle 9, ,Which of the following is not a com0onent of the relational model?,7,AD random file ca0ability on DASD BD collections of ob6ects or relations that store data 2D a set of o0erators that act on the relations to 0rod ce other relations DD data integrity for acc racy and consistency,7,AD random file ca0ability on DASD, ,Which of the following is not a &ey com0onent of the -R model?,7,AD entities BD hierarchies 2D attrib tes DD relationshi0s,7,BD hierarchies, ,Which of the following is a DM) statement?,7,AD S-)-2! BD 2:MMI! 2D .HDA!DD DR:H,7,2D .HDA!-, ,Which of the following is not a DM) statement?,7,AD S-)-2! BD I%S-R! 2D D-)-!DD .HDA!-,7,AD S-)-2!, ,Which constraint is dis0layed *ia the D-S2RIB- command?,7,AD .%I(.- J-I BD 2"-2J 2D HRIMARI J-I DD %:! %.)),7,DD %:! %.)), ,Which of the following is a DM) statement?,7,AD 2R-A!BD 2:MMI! 2D I%S-R! DD DR:H,7,2D I%S-R!, ,Which S()GHl s command is e= i*alent to S!AR!?,7,AD [ BD Y 2D W DD CRD,7,AD [, ,Which of the following is a DM) statement?,7,AD 2R-A!BD !R.%2A!2D R:))BA2J DD D-)-!-,7,DD D-)-!-, ,A field is defined in :racle as the intersection of what?,7,AD attrib te and table BD select and from 2D data ty0e and H)LS() DD row and col mn,7,DD row and col mn, ,Which of the following is a DD) statement?,7,AD +RA%! BD 2:MMI! 2D D-)-!DD 2R-A!-,7,DD 2R-A!-, ,Which of the following is not a DD) statement?,7,AD A)!-R BD I%S-R! 2D R-%AMDD DR:H,7,BD I%S-R!, ,"ow many &eywords are there in the following? S-)-2! ename7 sal7 hiredate ?R:M em0 W"-R- de0tno # F1<F :RD-R BI enameK,7,AD 1 BD $ 2D ' DD 1 -D 3 ?D 4,7,-D 3, ,"ow many cla ses are there in the following? S-)-2! ename7 sal7 hiredate ?R:M em0 :RD-R BI enameK,7,AD 1 BD $ 2D ' DD 1 -D 3 ?D 4,7,2D ', ,"ow many statements are there in the following? S-)-2! ename7 sal7 hiredate ?R:M em0 W"-R- de0tno # 1<

A%D em0no T 8;<< :RD-R BI enameK,7,AD 1 BD $ 2D ' DD 1 -D 3 ?D 4,7,AD 1, ,A relational database can contain at most one table.,7,!r eL?alse,7,?alse, ,A gi*en table can many rows.,7,!r eL?alse,7,!r e, ,S() &eywords are case sensiti*e.,7,!r eL?alse,7,?alse, ,H)LS() is the A%SI created lang age for S() systems.,7,!r eL?alse,7,?alse, ,2ommands within S()GHl s can be abbre*iated.,7,!r eL?alse,7,!r e, ,A col mn is made 0 of many rows7 and rows are made 0 of many tables.,7,!r eL?alse,7,?alse, ,A col mn which ser*es as the 0rimary &ey for a table can ha*e d 0licate *al es if the constraint .%I(.- BA).- is set to %.)).,7,!r eL?alse,7,?alse, ,A 0rimary &ey can not contain any n ll *al es.,7,!r eL?alse,7,!r e, ,Jeywords within S() can be abbre*iated.,7,!r eL?alse,7,?alse, ,A col mn which has the .%I(.- J-I constraint will ha*e an inde> created for it a tomatically.,7,!r eL?alse,7,!r e, ,A col mn which has the .%I(.- J-I constraint can contain %.)) *al es. ,7,!r eL?alse,7,!r e, ,What does F-RF stand for7 as in F-R ModelingF? ,7,Short Answer,7,-ntity Relationshi0, ,!wo tables can be related *ia their common col mn. In one table this col mn wo ld be the Hrimary Jey. What term describes the related col mn in the other table?,7,Short Answer,7,?oreign Jey, ,What does S() stand for? ,7,Short Answer,7,Str ct red ( ery )ang age, ,What does H)LS() stand for?,7,Short Answer,7,Hroced ral )ang ageLS(), ,What does A%SI stand for? ,7,Short Answer,7,American %ational Standards Instit te, ,What does IS: stand for? ,7,Short Answer,7,International Standards :rganiMation, ,)ist the three C'D DM) statements. Also7 what does DM) stand for?,7,Short Answer,7,I%S-R! .HDA!D-)-!Data Mani0 lation )ang age, ,)ist the fi*e C3D DD) statements. Also7 what does DD) stand for?,7,Short Answer,7,2R-A!A)!-R DR:H R-%AM!R.%2A!Data Definition )ang age, ,)ist the three C'D !ransaction control statements.,7,Short Answer,7,2:MMI! R:))BA2J SAB-H:I%!, ,)ist the two C$D D2) statements. Also7 what does D2) stand for?,7,Short Answer,7,+RA%! R-B:JData 2ontrol )ang age, ,What is the term sed to describe a 0rimary &ey which is com0osed of two or more col mns.,7,Short Answer,7,2oncatenated, ,!he standard with which :racleFs *ersion of S() com0lies with.,7,AD AS2II BD A%SI 2D %"!SA DD IS:,7,BD A%SI, ,Write a statement to retrie*e all col mns from the em0 table.,7,Short Answer,7,S-)-2! G ?R:M em0K, ,Write a statement to retrie*e em0loyees who ma&e more than $<<< in salary7 listing their name and salary.,7,Short Answer,7,S-)-2! ename7 sal ?R:M em0 W"-R- sal T $<<<K, ,Write a statement to retrie*e em0loyees who wor& in Dallas.,7,Short Answer,7,S-)-2! e.ename7 e.de0tno7 d.loc ?R:M em0 e7 de0t d W"-R- e.de0tno # d.de0tno A%D d.loc # FDA))ASFK, ,Write a statement to retrie*e the a*erage salary for all em0loyees.,7,Short Answer,7,S-)-2! a*gCsalD ?R:M em0K,

,Write a statement to retrie*e the a*erage salary for all em0loyees who are %:! salesmen.,7,Short Answer,7,S-)-2! a*gCsalD ?R:M em0 W"-R- 6ob W# FSA)-SMA%FK /also/ S-)-2! a*gCsalD ?R:M em0 W"-R- 6ob ST FSA)-SMA%FK, ,Write a statement to retrie*e em0loyeesF name and salary for those who earn less than the a*erage for all em0loyees.,7,Short Answer,7,S-)-2! ename7 sal ?R:M em0 W"-R- sal S CS-)-2! a*gCsalD ?R:M em0DK, ,Write a statement to retrie*e the ename and loc for all em0loyees7 0l s sort the data by loc ascending7 then within loc by ename descending.,7,Short Answer,7,S-)-2! ename7 loc ?R:M em0 e7 de0t d W"-R- e.de0tno # d.de0tno :RD-R BI loc7 ename D-S2K, ,Write a statement to dis0lay the n mber of em0loyees at each location C%ew Ior&7 Dallas7 2hicago7 and BostonD.,7,Short Answer,7,S-)-2! loc7 co ntCGD ?R:M em0 e7 de0t d W"-R- e.de0tno # d.de0tno +R:.H BI locK, ,!he )I%-5I!-M table contains these col mns )I%-5I!-M5ID %.MB-RC;D Hrimary Jey :RD-R5ID %.MB-RC;D HR:D.2!5ID BAR2"AR$C;D (.A%!I!I %.MB-RC3D -*al ate this S() statement: S-)-2! = antity7 0rod ct5id ?R:M line5item :RD-R BI = antity7 0rod ct5id Which statement is tr e concerning the res lts of e>ec ting this statement?,7,AD !he res lts are sorted n merically only. BD !he res lts are sorted al0habetically only. 2D !he res lts are sorted n merically and then al0habetically. DD !he res lts are sorted al0habetically and then n merically.,7,2, ,Which synta> t rns an e>isting constraint on?,7,AD A)!-R !AB)- table5name -%AB)- contstraint5nameK BD A)!-R !AB)- table5name S!A!.S # -%AB)- 2:%S!RAI%! constraint5nameK 2D A)!-R !AB)- table5name -%AB)- 2:%S!RAI%! constraint5nameK DD A)!-R !AB)- table5name S!A!.S -%AB)- 2:%S!RAI%! constraint5nameK -D A)!-R !AB)- table5name !.R% :% 2:%S!RAI%! constraint5nameK,7,2, ,!he -MH):I--S table contains these col mns: )AS!5%AMBAR2"AR$ C$3D SA)ARI %.MB-R C47$D 2:MMISSI:%5H2! %.MB-R C4D

Io need to write a = ery that will 0rod ce these res lts: 1. Dis0lay the salary m lti0lied by the commission50ct. $. ->cl de em0loyees with a Mero commission50ct. '. Dis0lay a Mero for em0loyees with a n ll commission *al e. -*al ate the S() statement: S-)-2! last5name7 salary G commission50ct ?R:M em0loyees W"-R- commission50ct IS %:! %.))K What does the statement 0ro*ide?,7,AD All of the desired res lts BD !wo of the desired res lts 2D :ne of the desired res lts DD An error statement,7,2, ,Which S-)-2! statement sho ld yo se to e>tract the year from the system date and dis0lay it in the format F1;;9F?,7,AD S-)-2! !:52"ARCSISDA!-7 FyyyyFD ?R:M d alK BD S-)-2! !:5DA!-CSISDA!-7 FyyyyFD ?R:M d alK 2D S-)-2! D-2:D-CS.BS!RCSISDA!-7 9D7 FIIIIFD ?R:M d alK DD S-)-2! D-2:D-CS.BS!RCSISDA!-7 9D7 FyearFD ?R:M d alK -D S-)-2! !:52"ARCS.BS!RCSISDA!-7 97 $D7 FyyyyFD ?R:M d alK,7,A, ,Which of the following correctly describes the 0recedence of mathematical o0erators?,7,AD M lti0lication7 Di*ision7 Addition7 S btraction BD S btraction7 Di*ision7 Addition7 M lti0lication 2D M lti0lication7 Addition7 Di*ision7 S btraction DD S btraction7 Di*ision7 Addition7 M lti0lication,7,A, ,Which of the following correctly describes the 0recedence of com0arison and logical o0erators?,7,AD And7 %ot7 All com0arison o0erators7 :r BD %ot7 And7 :r7 All com0arison o0erators 2D All com0arision o0erators7 %ot7 And7 :r DD All com0arison o0erators7 :r7 %ot7 And,7,2, ,?or a hire date of December 1<7 1;;;7 what does the following f nction e*al ate to? !:52"ARChiredate7 FfmDD M:%!" IIIIFD,7,AD December 1<7 1;;; BD 1< December 1;;; 2D 1$L1<L1;;; DD ! esday7 December 1<7 1;;; -D !en D-2-MB-R 1;;; ?D 1< december 1;;; +D !en December 1;;;,7,B, ,?or the cla ses +R:.H BI7 "ABI%+7 and W"-R-7 what is the correct order of e*al ation? ,7,AD Where7 +ro 0 By7 "a*ing BD +ro 0 By7 "a*ing7 Where 2D "a*ing7 Where7 +ro 0 By DD Where7 "a*ing7 +ro 0 By,7,A, ,Which of the following S()GHl s commands reads in .ser In0 t and stores it in a *ariable?,7,AD Define BD Bariable 2D 2ol mn DD Acce0t,7,D, ,Which of the following is %:! tr e of DM)?,7,AD It is e>ec ted when yo add new rows to a table.

BD It is e>ec ted when yo modify e>isting rows in a table. 2D It is e>ec ted when yo remo*e e>isting rows from a table. DD It is e>ec ted when yo select rows from a table.,7,D, ,Which of the following is the correct format for a S-)-2! statement which sho ld select all col mns in the em0 table and be immediately e>ec ted?,7,AD S-)-2! G ?R:M em0L BD S-)-2! G ?R:M em0K 2D S-)-2! all ?R:M em0K DD S-)-2! GL ?R:M em0 -D S-)-2! && ?R:M em0L,7,B, ,Which of the following is the correct format to clear a col mn?,7,AD 2)-AR 2:).M% col mn5name BD 2:).M% col mn5name 2)-AR 2D D-)-!- 2:).M% col mn5name DD .%D-?I%- 2:).M% col mn5name,7,B, ,Which is the correct order of the mathematical o0erators?,7,AD /RLG BD RL/G 2D GLR/ DD G R / L,7,2, ,!he W"-R- cla se restricts which of the following?,7,AD Rows BD 2ol mns 2D +ro 0s DD !ables,7,A, ,Is H)LS() a 0rogramming lang age or a way to gather data?,7,Short Answer,7,It is a 0rogramming lan ga ge. It ses S() to gather data., ,"ow do yo read s0ecific data from a table Cs ch as name7 de0artment7 etcD?,7,Short Answer,7,With a S-)-2! statement7 s ch as: S-)-2! ename7 de0tno ?R:M em0K, ,"ow do yo list all items in a table?,7,Short Answer,7,With an asteris& in a S-)-2! statement7 s ch as: S-)-2! G ?R:M em0K

If yo r intention is to see which col mns are in a table7 se the D-S2RIB- command of S()GHl s. D-S2RIB- em0, ,Does :racle store all data in 00er case7 lower case7 or mi>ed?,7,Short Answer,7,Data is stored in both 00er and lower case7 s ch as an em0loyeeFs name FVonesF. 2ol mn names and table names are stored in the Data Dictionary in 00er case., ,Which statement wo ld 0rod ce the following res lts: -MH%: -%AMSA) M+R ///////// ////////// ///////// ///////// 8;<$ ?:RD '<<< 8344 8'4; SMI!" 9<< 8;<$ 8899 S2:!! '<<< 8344 8984 ADAMS 11<< 8899,7,AD S-)-2! em0no7 ename7 sal7 mgr ?R:M em0 W"-R- mgr %:! I% C8;<$7 83447 8899DK BD S-)-2! em0no7 ename7 sal7 mgr ?R:M em0 W"-R- mgr I% C8;<$7 83447 8899DK 2D S-)-2! em0no7 ename7 mgr ?R:M em0 W"-R- em0no %:! I% C8;<$7 83447 8899DK DD S-)-2! em0no7 ename7 sal7 mgr ?R:M em0 W"-R- em0no I% C8;<$7 83447 8899DK,7,B, ,Why are Aliases better?,7,AD !hey ma&e the col mnLtable name more meaningf l BD !hey ta&e 0 less memory 2D !hey 6 st loo& better DD !hey sim0lify things and ma&e them more readable,7,D, ,If F&de0t5nameF is being inserted into the col mn de0artment5name7 what ty0e of data is de0artment5name?,7,AD n mber BD blob 2D *archar$ DD date,7,2 %ote: Single = otes Ca0ostro0hesD are also sed when inserting dates7 howe*er Fde0artment5nameF wo ld be a *ery bog s col mn name for a date col mn., ,"ow many rows can yo insert into a table.,7,AD As many as yo want BD As many as the 0hysical s0ace of the database will allow 2D De0ends on which *ersion of :racle yo are r nning DD Both B and 2,7,.n&nown7 altho gh I wo ld g ess D, ,Which of the following will always S-)-2! all col mns and all rows from the em0 table?,7,AD S-)-2! A)) ?R:M em0K

BD S-)-2! G ?R:M em0 W"-R- sal IS %:! %.))K 2D S-)-2! G ?R:M em0K DD S-)-2! G ?R:M em0 "ABI%+ A)) R:WSK,7,2, ,?or a gi*en row which contains the *al e F*ariableF in a col mn named Fty0eF7 what does the following f nction ret rn? S.BS!RCty0e7 /'D,7,AD FriableF BD FiableF 2D FableF DD FbleF -D none of the abo*e,7,D, ,?or a gi*en row which contains the *al e FVohnsonF in a col mn named Fc st5nameF7 what does the following f nction ret rn? S.BS!RCc st5name7 17 'D,7,AD FhnsoF BD FnsoF 2D FnosnF DD FnosF,7,B, ,Which of the following is not a *alid ty0e of V:I%?,7,AD %on/-= i6oin BD Self/6oin 2D )imited/6oin DD : ter/6oin -D All the abo*e are *alid,7,2, ,"ow do HRIMARI J-I and .%I(.- J-I 2onstraints differ?,7,AD !hey do not differ7 b t are two different ways to achie*e the same res lt BD !he .%I(.- J-I 2onstraint allows % ll *al es7 HRIMARI J-I does not 2D !he HRIMARI J-I 2onstraint allows % ll *al es7 .%I(.- does not DD !he HRIMARI J-I 2onstraint has an inde>7 .%I(.- does not,7,B, ,"ow are HRIMARI J-I and .%I(.- J-I constraints ali&e?,7,Short Answer,7,!hey are ali&e in that both ha*e inde>es created for their col mns a tomatically. !hey differ as follows: P Q A 0rimary &ey col mn can %:! contain %.)) *al es7 and all its *al es m st be ni= e. P Q A ni= e &ey col mn 2A% contain %.)) *al es7 howe*er7 if *al es are 0resent Cnon/%.))D7 then the *al es m st be ni= e., ,)ist the ty0es of 6oins which are a*ailable.,7,Short Answer,7,%on/-= i6oin -= i/6oin Self/6oin : ter/6oin, ,-*al ate the following e>0ression: 9 G $ L 1,7,Short Answer,7,9 G $ L 1 14 L 1 1, ,-*al ate the following e>0ression:

' R 1<< L $,7,Short Answer,7,' R 1<< L $ 'R 3<

3', ,-*al ate the following e>0ression: 9 / $ R 1,7,Short Answer,7,9 / $ R 1 4 R1 1<, ,-*al ate the following e>0ression: 8 G C9 / 1D R C' G $D,7,Short Answer,7,8 G C9 / 1D R C' G $D 8 G C1D R C4D 8G $9 1 R R 4 4

'1, ,-*al ate the following e>0ression: 1<< L 3< G $,7,Short Answer,7,1<< L 3< G $ $ G$

1 , ,-*al ate the following e>0ression: 1<< L C3< G $D,7,Short Answer,7,1<< L C3< G $D 1<< L C1<<D 1<< L 1<< 1, ,-*al ate the following e>0ression: $ R $ / 1,7,Short Answer,7,$ R $ / 1 1 /1 <, ,A n ll in a character col mn is e= i*alent to blan&7 and in a n meric col mn is e= i*alent to Mero.,7,!r eL?alse,7,?alse, ,A col mn alias 0recedes the col mn name in the select cla se.,7,!r eL?alse,7,?alse, ,!he &eyword AS is o0tional when sing col mn aliases.,7,!r eL?alse,7,!r e, ,!he following synta> is correct for sing a col mn alias: S-)-2! em0 F-m0loyee %ameF7 sal Salary ?R:M em0K,7,!r eL?alse,7,?alse !he alias sho ld be enclosed in D:.B)- = otes instead of SI%+)- = otes Ca0ostro0hesD., ,.nder which of the following circ mstances sho ld yo se do ble = otes aro nd a col mn alias?,7,AD It contains s0aces BD It contains s0ecial characters 2D It is case sensiti*e DD All of the abo*e -D %one of the abo*e7 yo sho ld se single = otes instead,7,DD All of the abo*e, ,Within a S() statement7 a col mn alias 2A% be sed with both the S-)-2! and the :RD-R BI cla ses7 b t can %:! be sed in the W"-R- cla se.,7,!r eL?alse,7,!r e, ,If a col mn alias is %:! enclosed in do ble = otes7 it will be dis0layed in all ca0ital letters.,7,!r eL?alse,7,!r e, ,What is the concatenation o0erator?,7,AD &&

BD RR 2D YY DD \\,7,DD \\, ,Which of the following S() statements will res lt in the following dis0lay for a table with only three rows? 2.S!:M-RS ///////// ?lo Vones Moe Jing Voe Brown ' rows selected.,7,AD S-)-2! first5name7 F F7 last5name F2.S!:M-RSF ?R:M c stK BD S-)-2! first5name F F \\ F F last5name F2 stomersF ?R:M c stK 2D S-)-2! first5name \\ last5name 2.S!:M-RS ?R:M c stK DD S-)-2! first5name \\ F F \\ last5name 2 stomers ?R:M c stK,7,DD, ,Date and character literals are enclosed within single = otes7 whereas aliases are enclosed within do ble = otes.,7,!r eL?alse,7,!r e, ,Date and character literals are enclosed within do ble = otes7 whereas aliases are enclosed within single = otes.,7,!r eL?alse,7,?alse, ,2om0ose a S() statement to concatenate the em0loyee name7 the literal F wor&s in F7 and the location with a col mn heading in all ca0s of W:RJSW"-R-. A ty0ical o t0 t wo ld loo& li&e this: W:RJSW"-R///////////////////////////////// JI%+ wor&s in %-W I:RJ ... 11 rows selected.,7,Short Answer,7,S-)-2! e.ename \\ F wor&s in F \\ d.loc wor&swhere ?R:M em0 e7 de0t d W"-R- e.de0tno # d.de0tnoK, ,Which of the following ses the correct synta> for eliminating d 0licate rows?,7,AD S-)-2! ename7 sal7 de0tno ?R:M em0 DIS!I%2!K BD S-)-2! DIS!I%2! ename7 sal7 de0tno ?R:M em0K 2D S-)-2! .%I(.- ename7 sal7 de0tno ?R:M em0K DD S-)-2! ename7 sal7 de0tno ?R:M em0 %:%D.H)I2A!-K,7,BD S-)-2! DIS!I%2! ename7 sal7 de0tno ?R:M em0K, ,Which of the following is based on A%SI standards?,7,AD S() BD S()GHl s,7,AD S(), ,Which of the following has &eywords which 2A% be abbre*iated?,7,AD S() BD S()GHl s,7,BD S()GHl s, ,Which of the following has &eywords which can %:! be abbre*iated?,7,AD S() BD S()GHl s,7,AD S(), ,Which of the following does %:! ha*e a contin ation character?,7,AD S() BD S()GHl s,7,AD S(), ,Which of the following D:-S ha*e a contin ation character?,7,AD S() BD S()GHl s,7,BD S()GHl s

Its contin ation character is the dash C/D., ,Which of the following ses a termination character to e>ec te the command immediately?,7,AD S() BD S()GHl s,7,AD S() / ses the semi/colon, ,What three 0ieces of information do yo 0ro*ide to S()GHl s when logging in remotely?,7,Short Answer,7,.ser %ame Hassword "ost String, ,What is the s0ecial character sed to 6oin the 0assword and host string when sing the 2:%%-2! command?,7,Short Answer,7,[ as in: S()T conn scottLtiger[dba, ,What S()GHl s command is sed to dis0lay the str ct re of a table?,7,Short Answer,7,D-S2RIBor D-S2, ,)ist some common S() dataty0es.,7,Short Answer,7,%.MB-RC07sD BAR2"AR$CnD 2"ARCnD DA!-, ,What S()GHl s command is sed to em0ty o t the S() b ffer?,7,Short Answer,7,2)-AR B.??-R or 2) B.??, ,What S()GHl s command is sed to dis0lay the contents of the S() b ffer?,7,Short Answer,7,)IS! or ), ,What S()GHl s command is sed to e>ec te the contents of the S() b ffer?,7,Short Answer,7,R.% or L, ,What S()GHl s command is sed to start recording of the screen dis0lay to an AS2II file?,7,Short Answer,7,SH::) filename , ,What S()GHl s command is sed to sto0 s0ooling of the screen dis0lay?,7,Short Answer,7,SH::) :??, ,)ist the com0arison o0erators Calso &nown as relational o0eratorsD.,7,Short Answer,7,# T S T# S# ST B-!W--% . . . A%D . . . )IJI% IS %.)) IS %:! %.)) not e= al to can also be written as: W# , ,Which of the following will res lt in one or more rows being retrie*ed?,7,AD S-)-2! sal ?R:M em0 W"-R- sal B-!W--% 13<< A%D 3<<K BD S-)-2! sal ?R:M em0 W"-R- B-!W--% 13<< A%D 3<<K 2D S-)-2! sal

?R:M em0 W"-R- sal B-!W--% 3<< A%D 13<<K DD S-)-2! sal ?R:M em0 W"-R- B-!W--% 3<< A%D 13<<K,7,2D S-)-2! sal ?R:M em0 W"-R- sal B-!W--% 3<< A%D 13<<K, ,Which of the following W"-R- cla ses ses the correct synta>?,7,AD W"-R- I% 8;<$7 83447 8899K BD W"-R- mgr I% 8;<$7 83447 8899K 2D W"-R- I%C8;<$7 83447 8899DK DD W"-R- mgr I%C8;<$7 83447 8899DK,7,DD W"-R- mgr I%C8;<$7 83447 8899DK, ,!he com0arison o0erator B-!W--% . . . A%D . . . e>cl des the end 0oints of the range.,7,!r eL?alse,7,?alse, ,!he com0arison o0erator B-!W--% . . . A%D . . . incl des the end 0oints of the range.,7,!r eL?alse,7,!r e, ,+i*en: A table has fo rteen C11D rows with the following salaries CsalD: 3<<7 4<<7 8;;7 8;;7 9<<7 9<<7 9<17 1<<<7 11<<7 11;;7 11;;7 13<<7 13<<7 and 13<1. "ow many rows will be retrie*ed with the following S() statement? S-)-2! sal ?R:M em0 W"-R- sal B-!W--% 9<< A%D 13<<K,7,AD 3 BD 8 2D ; DD 1$,7,2D ;, ,!he )IJ- com0arison o0erator ses which wildcard characters?,7,Short Answer,7,N C0ercent signD for Mero or many characters 5 C nderscoreD denotes one character, ,?or a col mn named FtagF with a dataty0e of 2"ARC4D7 what W"-R- cla se wo ld yo s0ecify to loo& for all tags that had n&nown characters in the first two 0ositions7 followed by a F2F in the third 0osition7 followed by an n&nown character in the fo rth 0osition7 and F18F in the last two 0ositions?,7,Short Answer,7,W"-R- tag )IJ- F552518FK, ,Which of the following W"-R- cla ses res lts in listing all em0loyees whose name begins with the letter F"F?,7,AD W"-R- ename )IJ- F"NFK BD W"-R- ename )IJ- F"RFK 2D W"-R- ename )IJ- F"?FK DD W"-R- ename )IJ- F"5FK,7,AD W"-R- ename )IJ- F"NFK, ,)ist the three logical o0erators.,7,Short Answer,7,%:! A%D :R, ,What is the correct order of e*al ation for logical o0erators?,7,AD A%D7 %:!7 :R BD A%D7 :R7 %:! 2D %:!7 A%D7 :R DD %:!7 :R7 A%D

-D :R7 A%D7 %:! ?D :R7 %:!7 A%D,7,2D %:!7 A%D7 :R, ,?or the logical o0erator A%D7 fill in the following !r th !able Ca&a a )ogic !ableD? A%D !R.- ?A)S- %.)) !R.- //// ///// //// ?A)S- //// ///// //// %.)) //// ///// ////,7,Short Answer,7,A%D !R.- ?A)S- %.)) !R.- !R.- ?A)S- %.)) ?A)S- ?A)S- ?A)S- ?A)S%.)) %.)) ?A)S- %.)), ,?or the logical o0erator :R7 fill in the following !r th !able Ca&a a )ogic !ableD? :R !R.- ?A)S- %.)) !R.- //// ///// //// ?A)S- //// ///// //// %.)) //// ///// ////,7,Short Answer,7, :R !R.- ?A)S- %.)) !R.- !R.- !R.- !R.?A)S- !R.- ?A)S- %.)) %.)) !R.- %.)) %.)), ,?or the logical o0erator :R7 fill in the following !r th !able Ca&a a )ogic !ableD? %:! Res lt !R.- ////// ?A)S- ////// %.)) //////,7,Short Answer,7,%:! Res lt !R.- ?A)S?A)S- !R.%.)) %.)), ,Which of the following statements A)WAIS res lts in %: rows being retrie*ed?,7,AD S-)-2! G ?R:M em0 W"-R- sal S 13<< A%D sal T 3<<K BD S-)-2! G ?R:M em0 W"-R- sal T 13<< :R sal S 3<<K 2D S-)-2! G ?R:M em0 W"-R- sal T 13<< A%D sal S 3<<K DD S-)-2! G ?R:M em0 W"-R- sal S 13<< :R sal T 3<<K,7,2D S-)-2! G ?R:M em0 W"-R- sal T 13<< A%D sal S 3<<K, ,Which of the following statements A)WAIS res lts in A)) rows being retrie*ed?,7,AD S-)-2! G ?R:M em0 W"-R- sal S 13<< A%D sal T 3<<K BD S-)-2! G ?R:M em0 W"-R- sal T 13<< :R sal S 3<<K 2D S-)-2! G ?R:M em0 W"-R- sal T 13<< A%D sal S 3<<K DD S-)-2! G ?R:M em0

W"-R- sal S 13<< :R sal T 3<<K,7,DD S-)-2! G ?R:M em0 W"-R- sal S 13<< :R sal T 3<<K, ,Which of the W"-R- cla ses below Cm lti0le/choiceD is e= i*alent to the following W"-R- cla se? W"-R- sal B-!W--% 9<< A%D 13<<K,7,AD W"-R- sal T# 9<< A%D sal S# 13<<K BD W"-R- sal S# 9<< A%D sal T# 13<<K 2D W"-R- sal S# 9<< :R sal T# 13<<K DD W"-R- sal T# 9<< :R sal S# 13<<K,7,AD W"-R- sal T# 9<< A%D sal S# 13<<K, ,Which cla se is sed to sort rows?,7,Short Answer,7,:RD-R BI , ,What is the defa lt way in which rows are sorted when sing the :RD-R BI cla se?,7,AD Ascending / AS2 BD Descending / D-S2,7,AD Ascending / AS2, ,If neither AS2 nor D-S2 is sed in con6 nction with :RD-R BI7 which is the defa lt?,7,Short Answer,7,AS2, ,2ol mn aliases 2A% be sed in an :RD-R BI cla se.,7,!r eL?alse,7,!r e, ,Which of the following :RD-R BI cla ses res lts in both col mns being sorted in descending order?,7,AD :RD-R BI state7 tag D-S2K BD :RD-R BI state D-S27 tag D-S2K 2D :RD-R BI D-S2 state7 tagK DD :RD-R BI D-S2 state7 D-S2 tagK,7,BD :RD-R BI state D-S27 tag D-S2K, ,)ist nine C;D single row character f nctions.,7,Short Answer,7,):W-R .HH-R I%I!2AH 2:%2A! S.BS!R )-%+!" I%S!R )HAD !RIM, ,What res lts from the following f nction? 2:%2A! CFAdamF7 FAntFD,7,Short Answer,7,FAdamAntF, ,+i*en: A 0rod ct code s ch as FAB21$'MI;;F contains the state where the 0rod ct was man fact red. 2om0ose a f nction to 0ic& off the letters FMIF from this string.,7,Short Answer,7,S.BS!RCFAB21$'MI;;F7 87 $D, ,!he col mn loc5code contains a two letter state abbre*iation7 a fi*e digit Mi0 code7 and a one character 0lant code. Which of the following e>tracts the Mi0 code from that col mn? An e>am0le of a *al e contained in loc5code is: FMI1;<18BF ,7,AD S.BS!RCloc5code7 87 'D BD S.BS!RCloc5code7 '7 8D 2D S.BS!RCloc5code7 '7 3D DD S.BS!RCloc5code7 37 'D,7,2D S.BS!RCloc5code7 '7 3D, ,What *al e does the following f nction ret rn?

)-%+!"CFAB21$'FD,7,Short Answer,7,4, ,What *al es do the following f nctions ret rn? CIo will ha*e fo r answersD 1 / R:.%DC1<.91;7 1D $ / R:.%DC1'.'37 1D ' / R:.%DC99.141;7 $D 1 / R:.%DC99.143<7 $D,7,Short Answer,7,1 / 1<.9 $ / 1'.1 ' / 99.14 1 / 99.18, ,What *al es do the following f nctions ret rn? CIo will ha*e fo r answersD 1 / !R.%2C1<.91;7 1D $ / !R.%2C1'.'37 1D ' / !R.%2C99.141;7 $D 1 / !R.%2C99.143<7 $D,7,Short Answer,7,1 / 1<.9 $ / 1'.' ' / 99.14 1 / 99.14, ,What *al e is ret rned by the following f nction? M:DC187 'D,7,Short Answer,7,$, ,What is the f nction which ret rns the c rrent o0erating system date?,7,Short Answer,7,SISDA!-, ,)ist si> date f nctions.,7,Short Answer,7,M:%!"S5B-!W--% ADD5M:%!"S %-E!5DAI )AS!5DAI R:.%D !R.%2, ,What *al es do the following f nctions ret rn? CIo will ha*e si> answersD 1 / M:%!"S5B-!W--%CF<1/MAI/<$F7 F<1/MAI/<'FD $ / M:%!"S5B-!W--%CF<1/MAI/<'F7 F<1/MAI/<$FD ' / ADD5M:%!"SCF'1/V.)/;;F7'D 1 / %-E!5DAICF<8/:2!/<$F7 FW-D%-SDAIFD 3 / )AS!5DAICF13/:2!/<$FD 4 / %-E!5DAIC)AS!5DAICF1'/:2!/<$FD7 FSA!.RDAIFD ,7,Short Answer,7,1 / min s 1$ C/1$D $ / 0ositi*e 1$ C1$D ' / F'1/:2!/;;F 1 / F<;/:2!/<$F 3 / F'1/:2!/<$F 4 / F<$/%:B/<$F, ,)ist some common elements sed when con*erting a n mber to a character *al e.,7,Short Answer,7,Y dollar sign ; digit nine 7 comma < digit Mero .

decimal 0oint, ,)ist some common elements sed when con*erting a date to a character *al e.,7,Short Answer,7,IIII I-AR MM M:%!" DI DAI DDD DD D fm, ,)ist the three con*ersion f nctions.,7,Short Answer,7,!:52"AR !:5DA!!:5%.MB-R , ,When con*erting a date col mn to a character *al e7 the !:52"AR f nction is sed. What does the fill mode FfmF at the beginning of the format do? CAs belowD !:52"ARChiredate7 FfmDAI M:%!" IIIIFD,7,Short Answer,7,It s 00resses leading Meroes and remo*es 0added blan&s., ,"ow wo ld yo dis0lay F%o 2ommissionF for those em0loyees with either a Mero commission or a n ll commission?,7,Short Answer,7,S-)-2! D-2:D-C %B)Ccomm7 <D7 <7 F%o 2ommissionF7 commD commission ?R:M em0K, ,What is wrong with the following f nction? %B)Ccomm7 F%o 2ommissionFD,7,Short Answer,7,!he col mn comm is a n meric col mn7 therefore the re0lacement *al e m st also be n meric. , ,Which f nction is sed to re0lace n ll *al es with a re0lacement *al e?,7,Short Answer,7,%B) , ,What f nction and what format wo ld yo se to dis0lay the n merica *al e 1$'1348.;; as: Y17$'17348.;; ,7,Short Answer,7,!:52"ARC1$'1348.;;7 FY;7;;;7;;;.;;FD, ,2om0ose a f nction to associate an em0loyeeFs 6ob with a re= ired le*el of e>0erience. .se the following table: 2)-RJ none SA)-SMA% some A%A)IS! moderate MA%A+-R high HR-SID-%! high all others n&nown,7,Short Answer,7,D-2:D-C6ob7 F2)-RJF7 FnoneF7 FSA)-SMA%F7 FsomeF7 FA%A)IS!F7 FmoderateF7 FMA%A+-RF7 FhighF7 FHR-SID-%!F7 FhighF7 F n&nownFD, ,What term is sed to describe the 0lacing of one f nction inside another f nction?,7,Short Answer,7,nesting, ,If two tables are sed to dis0lay data7 b t a W"-R- cla se is not sed7 what ty0e of 6oin res lts?,7,Short Answer,7,2artesian Voin a&a 2artesian Hrod ct, ,If one table has 1< rows and the second table has 13 rows7 how many rows res lt from a 2artesian Voin?,7,AD 1< BD 13 2D $3 DD 13<,7,DD 13<, ,"ow many aliases are in the following S() statement? S-)-2! ename em0loyee7 sal salary7 loc location ?R:M em0 e7 de0t dK

Also7 what ty0e of 6oin does the abo*e ill strate?,7,Short Answer,7,?i*e aliases: ' col mn aliases7 and $ table aliases A 2artesian Voin: Beca se there is no W"-R- condition, ,)ist se*en C8D gro 0 f nctions.,7,Short Answer,7,AB+ 2:.%! MAE MI% S!DD-B S.M BARIA%2-, ,Which of the following -= i6oins is correctly written?,7,AD S-)-2! ename7 loc ?R:M em07 de0t W"-R- de0tno # de0tnoK BD S-)-2! ename7 loc ?R:M em0 e7 de0t d W"-R- de0tno # de0tnoK 2D S-)-2! ename7 loc ?R:M e.em07 d.de0t W"-R- e.de0tno # d.de0tnoK DD S-)-2! ename7 loc ?R:M em0 e7 de0t d W"-R- e.de0tno # d.de0tnoK,7,DD S-)-2! ename7 loc ?R:M em0 e7 de0t d W"-R- e.de0tno # d.de0tnoK, ,Which of the following %on/e= i6oins is correctly written?,7,AD S-)-2! e.ename7 e.sal7 s.grade ?R:M em07 salgrade W"-R- losal # salK BD S-)-2! ename7 sal7 grade ?R:M em0 e7 salgrade s W"-R- e.sal T# s.losal A%D e.sal S# s.hisalK 2D S-)-2! ename7 sal7 grade ?R:M em07 salgrade W"-R- e.sal B-!W--% s.losal A%D s.hisalK DD S-)-2! e.ename7 e.sal7 s.grade ?R:M em0 e7 salgrade s W"-R- sal T# losal :R sal S# hisalK,7,BD S-)-2! ename7 sal7 grade ?R:M em0 e7 salgrade s W"-R- e.sal T# s.losal A%D e.sal S# s.hisalK, ,What is the o ter 6oin o0erator?,7,Short Answer,7,CRD Which is an o0en 0arenthesis7 followed by a 0l s sign7 followed by a closing 0arenthesis., ,!he o ter 6oin o0erator F CRD F is 0laced on the side which is deficient in information.,7,!r eL?alse,7,!r e, ,!he cars table has the col mns ma&e7 model7 and color. !he ma&es table has a single col mn7 ma&e. -*ery ma&e from the ma&es table matches a ma&e in the cars table7 howe*er7 some ma&es in the cars table do not ha*e matching ma&es in the ma&es table. 2ars: ?:RD7 2"-BI7 D:D+-7 +-:7 ?:RD7 2"-BI Ma&es: ?:RD7 D:D+2om0ose a = ery which shows the ma&e and model for A)) cars7 A%D which dis0lays the ma&e from the ma&es table Cif there is a matching ma&eD.,7,Short Answer,7,S-)-2! c.ma&e7 c.model7 m.ma&e ?R:M cars c7 ma&es m W"-R- c.ma&e # m.ma&e CRDK,

9REQUENTL* ASKED QUESTIONSP 1. Write a = ery to eliminate d 0licate rows in a table? D-)-!- ?R:M D-H! D W"-R- D.R:WIDW # CS-)-2! MAE CR:WIDD ?R:M D-H! D1 W"-RD.D-H!%: # D1.D-H!%: A%D D.D%AM- # D1.D%AM- A%D D.):2 # D1.):2D $. Write a = ery to find ma> 3 salaries of em0loyees? Select sal from Cselect distinct CsalD from em0 order by sal descD Where rown m S 4 !o0 a n/ Analysis. Select rown m as Ran&7 ename7 Sal from Cselect ename7 Sal from em0 order by sal descD where rown m S#' '. +i*en a Hroced re in a Hac&age and a Hroced re standalone what is the diff between the two and which is better to se? A/#a,ta5es o0 a 2a $a5eP )o/"!arit4 /+ro 0 logically related H)LS() ty0es7 items7 and s b0rograms. Easier A22!i atio, Desi5, bcoM yo can code and com0ile a s0ecification witho t its body. Io need not define the 0ac&age body f lly ntil yo are ready to com0lete the a00lication. I,0or3atio, 7i/i,5 -Io can decide which constr cts are 0 blic C*isible and accessibleD or 0ri*ate Chidden and inaccessibleD. !he 0ac&age hides the definition of the 0ri*ate constr cts Ci.e they are not incl ded in 0ac&age s0ecificationD so that only the 0ac&age is affected Cnot yo r a00licationD if the definition changes. Also7 by hiding im0lementation details from sers7 yo 0rotect the integrity of the 0ac&age. NoteP When coding the 0ac&age body7 the definition of the 0ri*ate f nction has to be abo*e the definition of the 0 blic 0roced re. (ersiste, e / Hac&aged 0 blic *ariables and c rsors 0ersist for the d ration of a session. !h s they can be shared by all s b0rograms that e>ec te in the en*ironment O#er!oa/i,5 -Hac&ages allow yo to o*erload 0roced res and f nctions7 which means yo can create m lti0le s b0rograms with the same name in the same 0ac&age7 each ta&ing 2ara3eters o0 /i00ere,t ,"31er?or/er or /atat42e. Ne essit4 o0 o#er!oa/i,5 is / Sometimes the 0rocessing in two s b0rograms is the same. In that case it is logical to gi*e them the same name. H)LS() determines which s b0rogram is being called by chec&ing its formal 0arameters. :nly local or 0ac&aged s b0rograms can be o*erloaded. *o" a,,ot o#er!oa/P b!wo s b0rograms if their formal 0arameters differ only in name or 0arameter mode. Cdataty0e and their total n mber is sameD. b!wo s b0rograms if their formal 0arameters differ only in dataty0e and the different dataty0es are in the same family Cn mber and decimal belong to the same familyD b!wo s b0rograms if their formal 0arameters differ only in s bty0e and the different s bty0es are based on ty0es in the same family CBAR2"AR and S!RI%+ are s bty0es of BAR2"AR$D b!wo f nctions that differ only in ret rn ty0e7 e*en if the ty0es are in different families. Exa32!e o0 O#er!oa/i,5P

(a $a5e s2e i0i atio, 2R-A!- :R R-H)A2- HA2JA+- o*er50ac& IS HR:2-D.R- add5de0t C*5de0tno I% de0t.de0tnoN!IH-7 *5name I% de0t.dnameN!IH- D-?A.)! F n&nownF7 *5loc I% de0t.locN!IH- D-?A.)! F n&nownFDK HR:2-D.R- add5de0t C*5name I% de0t.dnameN!IH- D-?A.)! F n&nownF7 *5loc I% de0t.locN!IH- D-?A.)! F n&nownFDK -%D o*er50ac&K (a $a5e Bo/4 2R-A!- :R R-H)A2- HA2JA+- B:DI o*er50ac&

IS HR:2-D.R- add5de0t C*5de0tno I% de0t.de0tnoN!IH-7 *5name I% de0t.dnameN!IH- D-?A.)! F n&nownF7 *5loc I% de0t.locN!IH- D-?A.)! F n&nownFD IS B-+I% I%S-R! I%!: de0t BA).-S C*5de0tno7*5name7*5locDK -%D add5de0tK HR:2-D.R- add5de0t C*5name I% de0t.dnameN!IH- D-?A.)! F n&nownF7 *5loc I% de0t.locN!IH- D-?A.)! F n&nownFD IS B-+I% I%S-R! I%!: de0t BA).-S Cde0t5de0tno.%-E!BA)7*5name7*5locDK -%D add5de0tK -%D o*er50ac&K If yo call ADD5D-H! with an e>0licitly 0ro*ided de0artment n mber7 H)LS() ses the first *ersion of the 0roced re. If yo call ADD5D-H! with no de0artment n mber7 H)LS() ses the second *ersion. -E-2.!- :B-R5HA2J.ADD5D-H! C847FMARJ-!I%+F7FA!)A%!AFD -E-2.!- :B-R5HA2J.ADD5D-H! CFS.HH:R!F7F:R)A%D:FD Allow :racle9 to read m lti0le ob6ects into memory at once. When yo call a 0ac&aged H)LS() constr ct Cs b0rogramD for the first time7 the whole 0ac&age is loaded into memory. !h s7 later calls to related constr cts re= ire no dis& IL:.

Note : Hac&ages cannot be called7 0arameteriMed7 or nested. A 2ro e/"re i, a 2a $a5e is 1etter to "se 1 oEP In case of stand alone 0roced re7 whene*er it is called it has to be loaded into memory th s dis& IL: ta&es 0lace e*erytime while if the 0roced re is in a 0ac&age then first time when we call the 0roced re from the 0ac&age it gets loaded into memory and any later calls doesn@t re= ire dis& IL:. Hac&age 0roced re can be defined as 0 blic which can be called from other s b0rograms of the 0ac&age and from o tside the 0ac&age.Similarly we can define 0 blic f nction and 0 blic *ariables. %ote: Hac&age s0ecification can e>ist witho t 0ac&age body b t 0ac&age body cannot e>ist witho t 0ac&age s0ecification.!o dro0 a 0ac&age first dro0 0ac&age s0ecification then 0ac&age body. DR:H HA2JA+- 0ac&age5name DR:H HA2JA+- B:DI 0ac&age5name 1. What is ?:RWARD D-2)ARA!I:% in Hac&ages? H)LS() allows for a s0ecial s b0rogram declaration called a forward declaration. It consists of the s b0rogram s0ecification in the 0ac&age body terminated by a semicolon. Io can se forward declarations to do the following: b Define s b0rograms in logical or al0habetical order. b Define m t ally rec rsi*e s b0rograms. CBoth calling each otherD. b +ro 0 s b0rograms in a 0ac&age Exa32!e o0 0orwar/ De !aratio,P 2R-A!- :R R-H)A2- HA2JA+- B:DI forward50ac& IS HR:2-D.R- calc5ratingC. . .DK HR:2-D.R- award5bon sC. . .D IS B-+I% calc5ratingC. . .DK ... -%DK // forward declaration // s b0rograms defined // in al0habetical order

HR:2-D.R- calc5ratingC. . .D IS B-+I% ... -%DK -%D forward50ac&K &. (RA>)A RESTRICT;RE9ERENCESP b2hec&s that the restrictions of sing f nctions in S() statements are not *iolated bAllows 0ac&aged f nctions to be sed in S() statements bBerifies the 0 rity of a f nction at com0ilation. !he 0 rity le*el asserts the e>tent to which the f nction 0ermits database o0erations li&e insert7 0date or delete. (RA>)A RESTRICT;RE9ERENCES is ,o !o,5er re-"ire/ 0or Ora !e'i. HRA+MA R-S!RI2!5R-?-R-%2-SCf nction5name7 W%DS //write no database state P7W%HSQ //write no 0ac&age state P7R%DSQ //read no database state P7R%HSQDK// read no 0ac&age state 2R-A!- :R R-H)A2- HA2JA+- ta>es50ac& AS ?.%2!I:% ta> C*5*al e I% %.MB-RD R-!.R% %.MB-RK HRA+MA R-S!RI2!5R-?-R-%2-S Cta>7 W%DS7 R%HS7 W%HSDK -%D ta>es50ac&K Example -nca0s late the f nction7 !AE7 in a 0ac&age7 !AE-S5HA2J. !he f nction will be called from S() statements on remote databases. !herefore7 yo need to assert the R%HS7 W%HS7 and W%DS 0 rity le*els7 beca se remote f nctions can neither read nor write the 0ac&age *ariables7 nor modify database tables when called from a S() statement. NoteP we can declare the 0 blic CglobalD c rsor in the 0ac&age s0ecification. 4. %ame some :racle Ser*er s 00lied 0ac&ages: aDBMS5HIHaDBMS5DD) aDBMS5V:B aDBMS5:.!H.! bWrite dynamic S() sing DBMS5S() and -E-2.!- IMM-DIA!-

DB)S;(I(E (a $a5e !he DBMS5HIH- 0ac&age 0erforms the following f nctions: bIt allows two or more sessions connected to the same instance C*isD to comm nicate thro gh a 0i0e 6 st li&e 0i0es sed in .%IE b-ach 0i0e wor&s asynchrono sly bDe0ending on yo r sec rity re= irements7 yo can se either a 0 blic 0i0e or a 0ri*ate 0i0e b:nce b ffered information is read by one ser7 it is em0tied from the b ffer7 and is not a*ailable for other readers of the same 0i0e b!o send a message7 first ma&e one or more calls to HA2J5M-SSA+- to b ild yo r message. !hen call S-%D5M-SSA+- to send the message on the named 0i0e b!o recei*e a message from a 0i0e7 first call R-2-IB-5M-SSA+-7 and then call .%HA2J5M-SSA+- to access the indi*id al items in the message :racle 0i0es b ffer information in the S+A7 which means that information is lost if yo sh t down yo r instance. Exa32!eP 2R-A!- :R R-H)A2- HR:2-D.R- send5message C*5message I% BAR2"AR$D IS s I%!-+-RK B-+I%

DBMS5HIH-.HA2J5M-SSA+-C*5messageDK s :# DBMS5HIH-.S-%D5M-SSA+-CFD-M:5HIH-FDK I? s ST < !"-% RAIS-5AHH)I2A!I:%5-RR:R C/$<$<<7 F-rror F\\!:52"ARCsD\\F sending on 0i0e.FDK -%D I?K -%D send5messageK 2R-A!- :R R-H)A2- HR:2-D.R- recei*e5message IS s I%!-+-RK *5message BAR2"AR$C3<DK B-+I% s :# DBMS5HIH-.R-2-IB-5M-SSA+-CFD-M:5HIH-FDK I? s ST < !"-% RAIS-5AHH)I2A!I:%5-RR:R C/$<$<17 F-rror F\\!:52"ARCsD\\F reading 0i0e.FDK -%D I?K DBMS5HIH-..%HA2J5M-SSA+-C*5messageDK DBMS5:.!H.!.H.!5)I%-C*5messageDK -%D recei*e5messageK Dynamic SQL A/#a,ta5esP Dynamic S() to create a 0roced re that o0erates on a table whose name is not &nown ntil r ntime7 or to write and e>ec te a data definition lang age CDDLD statement in H)LS(). In :racle97 and earlier7 yo ha*e to se DBMS5S() to write dynamic S(). I, Ora !e 'i? 4o" a, "se DB)S;SQL? EFECUTE I))EDIATE. If the statement is a m ltirow S-)-2!7 yo can se DBMS5S() or :H-%/?:R7 ?-!2"7 and 2):S- statements. Disa/#a,ta5e o0 /13s;s-!: .sing this 0ac&age to e>ec te DD) statements can res lt in a deadloc&. !he most li&ely reason for this is if7 for e>am0le7 the 0ac&age is being sed to dro0 a 0roced re7 which is still in se by yo . Ste2s to (ro ess SQL State3e,tsP All S() statements ha*e to go thro gh *ario s stages. %ot all the stages are mandatory7 and some stages may be missed. (arse -*ery S() statement m st be 0arsed. Harsing the statement incl des chec&ing the statementFs synta> and *alidating the statement7 ens ring that all references to ob6ects are correct7 and ens ring that the rele*ant 0ri*ileges to those ob6ects e>ist. Bi,/ After 0arsing7 :racle &nows the meaning of the :racle statement b t still may not ha*e eno gh information to e>ec te the statement. :racle may need *al es for any bind *ariable in the statement. !he 0rocess of obtaining these *al es is called binding *ariables. Exe "te At this 0oint7 :racle has all necessary information and reso rces7 so the statement is e>ec ted. 9et h In the fetch stage7 rows are selected and ordered Cif re= ested by the = eryD7 and each s ccessi*e fetch retrie*es another row of the res lt7 ntil the last row has been fetched. So3e o0 the 2ro e/"res a,/ 0", tio,s o0 the DB)S;SQL 2a $a5eP b:H-%52.RS:R bHARSbBI%D5BARIAB)b-E-2.!b?-!2"5R:WS b2):S-52.RS:R S*NTAF o0 DB)S;SQLP 2R-A!- :R R-H)A2- HR:2-D.R- delete5all5rows Ctab5name I% BAR2"AR$7 rows5del :.! %.MB-RD IS c rsor5name I%!-+-RK B-+I% c rsor5name :# DBMS5S().:H-%52.RS:RK

DBMS5S().HARS- C c rsor5name7Fdelete ?R:M F\\tab5name7 DBMS5S().%A!IB- DK rows5del :# DBMS5S().-E-2.!- Cc rsor5nameDK DBMS5S().2):S-52.RS:RCc rsor5nameDK S()T BARIAB)- deleted %.MB-R S()T -E-2.!- delete5all5rowsCFem0F7:deletedD H)LS() 0roced re s ccessf lly com0leted. S()T HRI%! deleted D-)-!-D ///////// 11 D4,a3i SQL with Ora !e'i "si,5 EFECUTE I))EDIATEP 2R-A!- HR:2-D.R- del5rows C*5table5name I% BAR2"AR$7 rows5deld :.! %.MB-RD IS B-+I% -E-2.!- IMM-DIA!- Fdelete from F\\*5table5nameK rows5deld :# S()NR:W2:.%!K -%DK S()T BARIAB)- deleted %.MB-R S()T -E-2.!- del5rowsCFem0F7:deletedD H)LS() 0roced re s ccessf lly com0leted. S()T HRI%! deleted D-)-!-D ///////// 11 DBMS_DDL Package UsesP bIo can recom0ile yo r modified 0roced res7 f nctions7 and 0ac&ages sing DBMS5DD).A)!-R52:MHI)-. ALTER;CO)(ILE Io1Ce t;t42e? ow,er? o1Ce t;,a3eG DB)S;DDL.ALTER;CO)(ILEIA(ROCEDUREA?AA;USERA?AQUER*;E)(AG bIo can analyMe a single ob6ect7 sing DBMS5DD).A%A)IU-5:BV-2!. C!here is a way of analyMing more than one ob6ect at a time7 sing DBMS5.!I)I!I.D ANAL*DE;OBQECT Io1Ce t;t42e? ow,er? ,a3e? 3etho/G DB)S;DDL.ANAL*DE;OBQECTIATABLEA?AA;USERA?AE)(A?ACO)(UTEAG b!his 0ac&age gi*es de*elo0ers access to A)!-R and A%A)IU- S() statements thro gh H)LS() en*ironments. DBMS_JOB Package Allows tas&s to be sched led and altered once in the = e e. Some 0roced res in the 0ac&age: bS.BMI! C6obno7 what7 ne>t5dateD. aV:B is an o t 0arameter7 which will contain the n mber allocated for the 6ob. aW"A! is the statement yo want to e>ec te. a%-E!5DA!- is the date of e>ec tion. !he defa lt is SISDA!-. bR.% C6obnoD: ?orce a s bmitted 6ob to e>ec te now %ote : .S-R5V:BS a Data dictionary *iew is sed to see the 6obs in the = e e. Exa32!eP S()T BARIAB)- 6obno %.MB-R

S()T -E-2.!- DBMS5V:B.S.BMI! C:6obno7 / T F:B-R5HA2J.ADD5D-H!CFF-D.2A!I:%FF7FFU.RI2"FFDKF7 / T SISDA!-D S()T 2:MMI!K S()T HRI%! 6obno bIo can force a 6ob in the = e e to r n now7 if yo s 00ly the 6ob n mber DBMS5V:B.R.% C6obnoD DBMS_OUTPUT Package Allows yo to o t0 t messages from H)LS() bloc&s Some of the 0roced res of the 0ac&age: bH.! b%-W5)I%bH.!5)I%b+-!5)I%b+-!5)I%-S b-%AB)-LDISAB)So3e other Ora !e s"22!ie/ 2a $a5esP bDBMS5A)-R! bDBMS5AHH)I2A!I:%5I%?: bDBMS5D-S2RIBbDBMS5):2J bDBMS5S-SSI:% bDBMS5S"AR-D5H::) bDBMS5!RA%SA2!I:% bDBMS5.!I)I!I b.!)5?I)8. What is the se= ence of firing of database triggers? !otal 1$ database triggers a insertL 0dateLdelete a beforeLafter a rowLstatement. Se-"e, e o0 0iri,5P Whe, si,5!e row is 3a,i2"!ate/ i, tri55erP Before statement Before row After row After statement Whe, 3"!ti2!e row is 3a,i2"!ate/ i, tri55erP Before statement Before row After row Before row After row ////// After statement Exa32!e o0 a state3e,t tri55erP 2reate one trigger to restrict all data mani0 lation e*ents on the -MH table to certain b siness ho rs7 Monday thro gh ?riday. 2R-A!- :R R-H)A2- !RI++-R sec re5em0 B-?:R- I%S-R! :R .HDA!- :R D-)-!- :% em0 B-+I% I? C!:52"AR Csysdate7FDIFD I% CFSA!F7FS.%FDD :R C!:52"AR Csysdate7 F""$1FD %:! B-!W--% F<9F A%D F19FD !"-% I? DELETIN> -$e4wor/s 5i#e, 14 ora !e i, ase o0 s" h tri55ers !"-% RAIS-5AHH)I2A!I:%5-RR:R C/$<3<$7 FIo may only delete from -MH d ring normal ho rs.FDK -)SI? INSERTIN>

!"-% RAIS-5AHH)I2A!I:%5-RR:R C/$<3<<7 FIo may only insert into -MH d ring normal ho rs.FDK -)SI? U(DATIN> CFSA)FD !"-% RAIS-5AHH)I2A!I:%5-RR:R C/$<3<'7 FIo may only 0date SA) d ring normal ho rs.FDK -)SRAIS-5AHH)I2A!I:%5-RR:R C/$<3<17 FIo may only 0date -MH d ring normal ho rs.FDK -%D I?K -%D I?K -%DK Exa32!e o0 a row tri55erP S()T 2R-A!- :R R-H)A2- !RI++-R D-RIB-52:MMISSI:%5H2! $ B-?:R- I%S-R! :R .HDA!- :? sal :% em0 ' ?:R -A2" R:W 1 B-+I% 3 I? NOT C:%-W.V:B I% CFMA%A+-RF 7 FHR-SID-%!FDD 4 A%D :%-W.SA) T 3<<< 8 !"-% 9 RAIS-5AHH)I2A!I:%5-RR:R ; C/$<$<$7 F-MH):I-- 2A%%:! -AR% !"IS AM:.%!FDK 1< -%D I?K 11 -%DK 9. What are o!/ a,/ ,ew -"a!i0iers i, tri55ers? //After deleting or inserting or 0dating on em0 ainsert the data in a dit5em05table to trac& all the changes done on em0 table. S()T2R-A!- :R R-H)A2- !RI++-R a dit5em05*al es $ A?!-R D-)-!- :R I%S-R! :R .HDA!- :% em0 ' ?:R -A2" R:W 1 B-+I% 3 I%S-R! I%!: a"/it;e32;ta1!e C ser5name7 4 timestam07 i/7 o!/;!ast;,a3e7 new5last5name7 8 old5title7 new5title7 old5salary7 new5salaryD 9 BA).-S C.S-R7 SISDA!-7 POLD.e32,o7 POLD.e,a3e7 ; :%-W.ename7 ::)D.6ob7 :%-W.6ob7::)D.sal7 :%-W.sal DK 11 -%DK 1$ L // : old is sed for the *al es before change and new for after change. ;. Difference between row and statement trigger? State3e,t Tri55ers a,/ Row Tri55ers Io can s0ecify the n mber of times the trigger action is to be e>ec ted: once for e*ery row affected by the triggering statement Cs ch as a m lti0le row .HDA!-D 7 or once for the triggering statement no matter how many rows it affects. State3e,t Tri55er A statement trigger is fired once on behalf of the triggering e*ent7 e*en if no rows are affected at all. Statement triggers are sef l if the trigger action /oes ,ot /e2e,/ o, /ata o0 rows that are affected or data 0ro*ided by the triggering e*ent itself. ?or e>am0le7 a trigger that 0erforms a com0le> sec rity chec& on the c rrent ser. Row Tri55er A row trigger fires each time the table is affected by the triggering e*ent. If the triggering e*ent affects no rows7 a row trigger is not e>ec ted at all. Row triggers are sef l if the trigger action /e2e,/s o, /ata o0 rows that are affected or data 0ro*ided by the triggering e*ent itself. 1<. "ow can yo restrict a row trigger? !o restrict the trigger action to those rows that satisfy a certain condition7 0ro*ide a W"-% cla se. Exa32!eP 2reate a trigger on the -MH table to calc late an em0loyee@s commission when a row is added to the -MH table or an em0loyee@s salary is modified.

S()T2R-A!- :R R-H)A2- !RI++-R deri*e5commission50ct $ B-?:R- I%S-R! :R .HDA!- :? sal :% em0 ' ?:R -A2" R:W 1 W"-% C%-W.6ob # FSA)-SMA%FD 3 B-+I% 4 I? I%S-R!I%+ 8 !"-% :%-W.comm :# <K 9 -)SI? ::)D.comm IS %.)) ; !"-% :%-W.comm :# <K 1< -)S- :%-W.comm :# ::)D.comm G C:%-W.salL::)D.salDK 11 -%D I?K 1$ -%DK 1' L !he %-W = alifier does not need to be 0refi>ed with a colon in the W"-% cla se. %ote: If we se after insert or 0date then we will get a com0ilation error. :RA/<1<91: cannot change %-W *al es for this trigger ty0e BcoM new can only be sed with before triggers. 11. What are instead of triggers? Instead of trigger is a trigger created on a com0le> *iew Cwith more than 1 tableD to modify them7 as com0le> *iews are inherently non/modifiable. These tri55ers are a!!e/ INSTEAD O9 tri55ers? 1e a"se? ",!i$e other tri55ers? Ora !e ser#er 0ires the tri55er i,stea/ o0 exe "ti,5 the tri55eri,5 state3e,t Ii,sert@"2/ate@/e!eteG. . Ex- reate tri55er tst i,stea/ o0 i,sert o, e32;#iew R/o so3ethi,5 Wh4 Use INSTEAD O9 Tri55ers% If a *iew consists of more than one table7 an insert to the *iew may entail an insert into one table and an 0date to another. So7 yo write an I%S!-AD :? trigger that fires7 when yo write an insert against the *iew. Instead of the original insert7 the trigger body e>ec tes7 which res lts in an insert into one table and an 0date to another table.e>/ if we insert a row in em0 table with em0 salary. And there is another table total which s ms total sal for each de0artment . In that case whene*er an insert will be on em0 table then table a total will also get 0dated. 1$. Difference between trigger and stored 0roced re? Tri55ers .se 2R-A!- !RI++-R Data dictionary contains so rce and 0/code Im0licitly in*o&ed 2:MMI!7 SAB-H:I%!7 R:))BA2J not allowed (ro e/"re .se 2R-A!- HR:2-D.RData dictionary contains so rce and 0/code ->0licitly in*o&ed 2:MMI!7 SAB-H:I%!7 R:))BA2J allowed

1'. Restrictions on instead of triggers: 1. A*ailable only on row le*el not on statement le*el. $. 2an be a00lied only to *iews not on tables. '. 2annot se cW"-%@ cla se to restrict instead of trigger. NoteP ALTER TRI>>ER trigger_name DISABLE S ENABLE ALTER TRI>>ER trigger_name DISABLE S ENABLE ALL T I!!E S ALTER TRI>>ER trigger_name CO)(ILE --to re o32i!e the tri55er 11. What are !o5o, a,/ !o5 o00 tri55er? Io can create this trigger to monitor how often yo log on and off7 or yo may want to write a re0ort on how long yo are logged on for. ->am0le: S()T 2R-A!- :R R-H)A2- !RI++-R ):+:%5!RI+ $ A?!-R logon :% S2"-MA ' B-+I% 1 I%S-R! I%!: log5trig5table 3 C ser5id7 log5date7 actionD 4 BA).-S C ser7 sysdate7 F)ogging onFDK 8 -%DK

S()T 2R-A!- :R R-H)A2- !RI++-R ):+:??5!RI+ $ B-?:R- logoff :% S2"-MA ' B-+I% 1 I%S-R! I%!: log5trig5table 3 C ser5id7 log5date7 actionD 4 BA).-S C ser7 sysdate7 F)ogging offFDK 8 -%DK 13. "ow do we call a 0roced re in a trigger? CALL statement is sed to call a stored 0roced re7 rather than coding the H)LS() body in the trigger itself. CREATE TRI>>ER TEST8 2 BE9ORE INSERT ON E)( 8 CALL 2ro 1 T where 2ro 1 is the ,a3e o0 store/ 2ro e/"re. 14. What is a 3"tati,5 ta1!e? Exa32!eP This tri55er? C7ECK;SALAR*? 5"ara,tees that whe,e#er a ,ew e32!o4ee is a//e/ to the E)( ta1!e or a, existi,5 e32!o4eeHs sa!ar4 or Co1 tit!e is ha,5e/? the e32!o4eeHs sa!ar4 0a!!s withi, the esta1!ishe/ sa!ar4 ra,5e 0or the e32!o4eeHs Co1. S()T 2R-A!- :R R-H)A2- !RI++-R chec&5salary $ B-?:R- I%S-R! :R .HDA!- :? sal7 6ob :% em0 ' ?:R -A2" R:W 1 W"-% Cnew.6ob ST FHR-SID-%!FD 3 D-2)AR4 *5minsalary em0.salN!IH-K 8 *5ma>salary em0.salN!IH-K 9 B-+I% ; S-)-2! MI%CsalD7 MAECsalD 1< I%!: *5minsalary7 *5ma>salary 11 ?R:M em0 1$ W"-R- 6ob # :new.6obK 1' I? :new.sal S *5minsalary :R 11 :new.sal T *5ma>salary !"-% 13 RAIS-5AHH)I2A!I:%5-RR:RC/$<3<37F: t of rangeFDK 14 -%D I?K 18 -%DK 19 L S()T .HDA!- em0 $ S-! sal # 13<< ' W"-R- ename # FSMI!"FK G -RR:R at line $: :RA/<1<;1: table -MH is m tating7 triggerLf nction may not see it :RA/<431$: at ,2"-2J5SA)ARI,7 line 3 :RA/<1<99: error d ring e>ec tion of trigger F2"-2J5SA)ARIF !he -MH table is 3"tati,5? or i, a state o0 ha,5e therefore the trigger cannot read from it. 18. Some commands to do A diting? S()T A.DI! I%S-R!7 .HDA!-7 D-)-!$ :% em0 ' BI A22-SS 1 W"-%-B-R S.22-SS?.)K A.DI! R:)-K A.DI! R:)- W"-%-B-R S.22-SS?.)K A.DI! R:)- W"-%-B-R %:! S.22-SS?.)K A.DI! S-)-2! !AB)-7 .HDA!- !AB)-K A.DI! S-)-2! !AB)-7 .HDA!- !AB)- BI scott7 bla&eK A.DI! D-)-!- A%I !AB)-K

19. When is cRAIS-5AHH)I2A!I:%5-RR:R@ sed? It is a 0roced re that lets yo iss e ser/defined error messages from stored s b0rograms. raise5a00lication5error Cerror5n mber7 messageP7 ^!R.- \ ?A)S-_QDK 2an be called from e>ec table as well as e>ce0tion section of a s b0rogram. 1;. What is an e>ce0tion and what are its ty0es ? %ame some 0re/defined e>ce0tions. ->ce0tion is an error in H)LS(). !y0es of e>ce0tions are: 1. Hre/defined e>ce0tions in :racle Ser*er / Im0licitly raised $. %on/HreDefined e>ce0tions in :racle Ser*er / Im0licitly raised '. .ser Defined // ->0licitly raised bSam0le 0redefined e>ce0tions: a%:5DA!A5?:.%D e>/ when no5data5fo nd then rollbac&K a!::5MA%I5R:WS aI%BA)ID52.RS:R aU-R:5DIBIDaD.H5BA)5:%5I%D-E %on/HreDefined e>ce0tions: / first name the e>ce0tion ////Declare / 2ode the 0ragma -E2-H!I:%5I%I! ////Associate / "andle the raised e>ce0tion or e>0licitly raise it by RAIS- command. //Reference ->/ !ra0 for :racle8 Ser*er error n mber /$$;$ an integrity constraint *iolation. LG HRA+MA -E2-H!I:%5I%I! CinitialiMeD sed to associate the e>ce0tion with an error n mber GL D-2)ARe50rod cts5remaining -E2-H!I:%K HRA+MA -E2-H!I:%5I%I! Ce50rod cts5remaining7 /$$;$DK ... B-+I% ... -E2-H!I:% W"-% e50rod cts5remaining !"-% !-E!5I:.H.!5)I%- CFReferential integrity constraint *iolated.FDK ... -%DK .ser Defined e>ce0tions: / first name the e>ce0tion ////Declare / ->0licitly raise it by RAIS- command PD-2)AR-Q e5amo nt5remaining -E2-H!I:%K ... B-+I% . . .ifd.then RAIS- e5amo nt5remainingK ... -E2-H!I:% W"-% e5amo nt5remaining !"-% :g5message :# F!here is still an amo nt in stoc&.FK ... -%DK $<. 9", tio,s 0or tra22i,5 errors? bW"-% :!"-RS e>ce0tion handler a!ra0s all e>ce0tions not yet handled. aIs the last handler. bS()2:DaRet rns the n meric *al e for the error code.

bS()-RRM aRet rns the message associated with the error n mber. D-2)AR*5error5code %.MB-RK *5error5message BAR2"AR$C$33DK B-+I% ... -E2-H!I:% ... W"-% :!"-RS !"-% R:))BA2JK *5error5code :# S()2:D- K *5error5message :# S()-RRM K I%S-R! I%!: errors BA).-SC*5error5code7 *5error5messageDK -%DK $1. In which scenario database triggers will be sed.%ame the database triggers. Diff between database triggers and form transactional triggers ? $$. !y0es of loo0s : "#ile l$$p W"I)- *5co nter S# 1< )::H I%S-R! I%!: s5item Cord5id7 item5idD BA).-S C*5ord5id7 *5co nterDK *5co nter :# *5co nter R 1K -%D )::HK 9or !oo2 ?:R inde> in PR-B-RS-Q lower5bo nd.. 00er5bo nd )::H Statement1K Statement$K ... -%D )::HK Ba%ic L$$p )::H I%S-R! I%!: s5item Cord5id7 item5idD BA).-S C*5ord5id7 *5co nterDK *5co nter :# *5co nter R 1K -EI! W"-% *5co nter T 1<K -%D )::HK $'. %ame the s=l c rsor attrib tes? SQLUROWCOUNT N"31er o0 rows a00e te/ 14 the 3ost re e,t SQL state3e,t Ia, i,te5er SQLU9OUND Boo!ea, attri1"te that e#a!"ates to TRUE i0 the 3ost re e,t SQL state3e,t a00e ts o,e or 3ore rows. SQLUNOT9OUND Boo!ea, attri1"te that e#a!"ates to TRUE i0 the 3ost re e,t SQL state3e,t /oes ,ot a00e t a,4 rows. SQLUISO(EN A!wa4s e#a!"ates to 9ALSE 1e a"se (L@SQL !oses i32!i it "rsors i33e/iate!4 a0ter the4 are exe "te/. $1. 2an we create a c rsor witho t declaring it? Ies a by sing c rsor for loo0 sing s b= eries. B-+I% ?:R em05record I% CS-)-2! em0no7 ename ?R:M -MHD )::H // Im0licit o0en and im0licit fetch occ r I? em05record.em0no # 89'; !"-% ... -%D )::HK // im0licit close occ rs -%DK #a!"eG.

$3. 2an we 0ass Harameters in c rsor? If yes then how do we 0o0 late them? What is c rsor for loo0? Why is W"-R- 2.RR-%! :? cla se sed in c rsors? *es we a, 2ass as show, 1e!owP 2.RS:R em05c rsor C*5de0t %.MB-R7 *56ob BAR2"AR$D IS S-)-2! last5name7 salary7 start5date ?R:M s5em0 W"-Rde0t5id # *5de0t A%D title # *56obK Begin :0en em05c rsor C1<7@?A2.)!I@D ///0arameters are 0assed in o0en c rsor statements ?etch c rsor into *17*$ 2lose em05c rsorK C"rsor 0or !oo2 Ishort "t 0or ex2!i it "rsors? ,o ,ee/ to o2e,? 0et h a,/ !oseG 2.RS:R em05c rsor C*5de0t %.MB-R7 *56ob BAR2"AR$D IS S-)-2! last5name7 salary7 start5date ?R:M s5em0 W"-Rde0t5id # *5de0t A%D title # *56obK Begin ?or em05data in em05c rsor loo0 ano need to declare *ariable em05data. ////////-m05data.last5name: # cSharma@K -nd loo0K W7ERE CURRENT O9 C!a"se b.0date or delete the c rrent row sing c rsors. b)oc& the rows first by incl ding the ?:R .HDA!- cla se in the c rsor = ery. S4,taxP 2.RS:R em05c rsor IS S-)-2!... ?:R .HDA!-K B-+I% ... ?:R em05record I% em05c rsor )::H .HDA!-... W"-R- 2.RR-%! :? em05c rsorK ... -%D )::HK 2:MMI!K -%DK 2 rsor with s b= eries Retrie#e /e2art3e,t ,"31er? /,a3e a,/ o",t o0 sta00 0ro3 /e2t a,/ E)( ta1!e where Co",t VW& D-2)AR2.RS:R my5c rsor IS S-)-2! t1.de0tno7 dname7S!A?? ?R:M de0t t17 CS-)-2! de0tno7 co nt CGD S!A?? ?R:M -MH +R:.H BI de0tnoD t$ aretrie*es co nt of staff in in 0lace of a table W"-R- t1.de0tno # t$.de0tno A%D S!A?? T# 3K $4. !y0es of *ariables in H)LS()? bH)LS() *ariables aScalar a2om0osite aReference a):B Clarge ob6ectsD

each de0t.!his = ery is sed

I,ter,a! LOBsP 2):B C2haracter ):BD B):B CBinary ):BD / 0hotos %):B Cnational lang age character large ob6ectD Exter,a! LOBsP B?I)- Cbinary fileD a files in database or :Ls system b%on/H)LS() *ariables aBind and host *ariables %ote: DB)S;LOB 0ac&age is sed to mani0 late the ):B. DB)S;LOB.READ 2all the R-AD 0roced re to read and ret rn 0iecewise a s0ecified AM:.%! of data from a gi*en ):B7 starting from :??S-!. DB)S;LOB.WRITE 2all the WRI!- 0roced re to write 0iecewise a s0ecified AM:.%! of data into a gi*en ):B7 from the ser/ s0ecified B.??-R7 starting from an absol te :??S-! from the beginning of the ):B *al e. DB)S;LOB.SUBSTR Cs bstr from clobD DB)S;LOB.INSTR Csearch information from clobD $8. What is the se of -MH!I52):BCDL-MH!I5B):BCD? !he se of f nction -MH!I52):BCD or -MH!I5B):BCD means that the ):B is initialiMed7 b t not 0o0 lated with data.)ater can be 0o0 lated by 0date statement. If yo se %.)) as the *al e for the ):B col mn7 the ):B is not initialiMedK therefore7 it can not be 0o0 lated sing an 0date statement. InitialiMe a ):B col mn sing f nctions -MH!I52):BCD L -MH!I5B):BCD I%S-R! I%!: em0loyee Cem05id7 em05name7 res me7 0ict reD BA).-SC89;97 FMarilyn MonroeF7 -MH!I52):BCD7%.))DK $9. What are tem0orary ):Bs? !em0orary ):Bs are new to Ora !e'i. !em0orary ):Bs can be B):Bs7 2):Bs7 or %2):Bs. Te32orar4 LOB 0eat"resP bData is stored in yo r tem0orary tables0ace. b!hey are not stored 0ermanently in the database. bAll tem0orary ):Bs are deleted at the end of the session in which they were created. b!hey are not associated with a table. b2reate a tem0orary ):B sing DBMS5):B.2R-A!-!-MH:RARI. !em0orary ):Bs are "se0"! when yo want to 0erform some transformational o0eration on a ):B7 for e>am0le changing a ):B from one format to another7 and then ret rn it to the 0ermanent ):B. A tem0orary ):B will be em0ty when created and it does not s 00ort the -MH!I5BL2L%2):B f nctions. .se the DBMS5):B 0ac&age to se and mani0 late tem0orary ):Bs. $;. What is the diffrence between )ong Raw and ):B dataty0e? LON>? LON> RAW Single col mn 0er table .0 to $ +B S-)-2! ret rns data Data stored in/line Se= ential access to data LOB M lti0le col mns 0er table .0 to 1 +B S-)-2! ret rns locator Data stored in/line or o t/of/line Random access to data

'<. What are com0osite dataty0es li&e we ha*e scalar Cn mber7char7*archar etc.D. %ame them and write the Synta> for them? Co32osite Data t42es: a H)LS() !AB)-S a H)LS() R-2:RDS %ested !AB)BARRAI

Ad*antage: a2ontain internal com0onents. aAre re sable. b(L@SQL TABLES aAre com0osed of two com0onents: bHrimary &ey of dataty0e BI%ARI5I%!-+-R b2ol mn of scalar dataty0e A/# aIncrease dynamically beca se they are nconstrained. S4,taxP D-2)AR!IH- ename5table5ty0e IS !AB)- :? em0.enameN!IHI%D-E BI BI%ARI5I%!-+-RK !IH- hiredate5table5ty0e IS !AB)- :? DA!I%D-E BI BI%ARI5I%!-+-RK ename5table ename5table5ty0eK hiredate5table hiredate5table5ty0eK B-+I% ename5tableC1D :# F2AM-R:%FK hiredate5tableC9D :# SISDA!- R 8K I? ename5table.-EIS!SC1D !"-% I%S-R! I%!: ... ... -%DK !he 0rimary &ey Ci.e inde> *al eD can be negati*e. Inde>ing need not start with 1. %ote: !he table.-EIS!SCiD statement ret rns !R.- if at least one row with inde> i is ret rned. .se the -EIS!S statement to 0re*ent an error which is raised in reference to a non/e>isting table element. NoteP If !IH- ename5table5ty0e IS !AB)- :? em0NR:W!IH!hen com0osite dataty0e is called T (L@SQL TABLE O9 RECORDS. (L@SQL RECORD X!reat a collection of fields as a logical nit. bAre con*enient for fetching a row of data from a table for 0rocessing.e32;re or/2e IS RECORD I!ast e32;re or/;t42eY S4,taxP !IH- em05record5ty0e IS R-2:RD Clast5name BAR2"AR$C$3D7 first5name BAR2"AR$C$3D7 gender 2"ARC1DDK em0loyee5record em05record5ty0eK T*(E e32;re or/;t42e T* T*(E e32;re or/;t42e IS RECORD em05record.last5name :# FMad roFK em05record.first5name :# F-lenaFK em05record.gender :# F?FK 7ow 2!@s-! re or/ is "se/ i, a 2ro e/"reP HR:2-D.R- all5de0t C*5de0t5id I% %.MB-RD IS de0t5record s5de0tNR:W!IH-K B-+I% S-)-2! G I%!: de0t5record //H)LS() R-2:RD ?R:M s5de0t W"-Rid # *5de0t5idK ... -%D all5de0tK 5e,/er C7ARI1GGY '1. .ses of decode f nction with e>am0le?

'$. What is acce0t7 *ariable and 0rint command in s=lG 0l s? bACCE(T aAcce0ts in0 t from the ser and stores the in0 t into a *ariable. S=lT A22-H! 05sal HR:MH! F-nter the salary: F LGsalary entered by ser is stored in 05sal GL b6ARIABLE aDeclares a bind or host *ariable. S=lT Bariable abc % mber C1<D S=lT Hrint abcI%- D%AM- # SA)-S S()TS-)! %AM- ?R:M S5D-H! W"-R): bDE9INE S=lT Define dname # csales@ S=lT Select dname from de0t where dname # c&dname@ //sales *al e is assigned to dname initially so = ery gi*es res lt for sales de0t. UNDE9INE command is sed to clear the *ariable. %A S()TD-?I%- D%AM- # SA)-S S()T b(RINT aDis0lays the c rrent *al e of bind *ariables. ->am0le : In0 t the monthly salary. : t0 t the calc lated ann al salary. A22-H! 05sal HR:MH! F-nter the salary: F LGsalary entered by ser is stored in 05sal GL BARIAB)- g5year5sal %.MB-R D-2)AR*5sal %.MB-R :# &05salK B-+I% :g5year5sal :# *5sal G 1$K -%DK L HRI%! g5year5sal b-E-2.!a->ec tes a 0artic lar s=l statement. ''. 2an we /ro2 a o!"3, in oracle 9i ? If yes then what is the command !o do that ? A)!-R !AB)- A DR:H 2:).M% -%:K '1. A table contains a col mn a gender with *al es cMale@ and c?emale@.Write a = ery to find the co nt of all male and female em0lyees in the com0any . : t0 t sho ld gi*e $ col mns showing the co nt of male and female em0loyees ? S-)-2! gender7 2:.%! CGD ?R:M em0 +R:.H BI genderK '3. In a select statement if co nt f nction is sed and a gro 0 by cla se is not sed then will it gi*e an error? If yes then which error? :RA/<<;'8: not a single/gro 0 gro 0 f nction '4. What is the difference between cI% c and c-EIS!S@ o0erator in s=l ? '8. What is the se= ence of f nctions a gro 0 by7ha*ing7orderby in a select statements ? Selectd.. +ro 0 byd "a*ingd :rderby..

'9. %ame some date f nctions? bM:%!"S5B-!W--%CF<1/S-H/;3F7F11/VA%/;1FD bADD5M:%!"SCF11/VA%/;1F74D b%-E!5DAICF<1/S-H/;3F7F?RIDAIFD b)AS!5DAICF<1/S-H/;3FD ';. %ame some con*ersion f nctions? b!:52"AR con*erts a n mber or date string to a character string. b!:5%.MB-R con*erts a character string containing digits to a n mber. b!:5DA!- con*erts a character string of a date to a date *al e. 1<. .se of an c-sca0e@ identifier? -S2AH- identifier is sed to search for ,N, or ,5,. 11. What is RR date format 1$. "ow can we see the code of a s b0rogram ? .sing *iew a USER;SOURCE select te>t from ser5so rce where name # cAB2@K :ther *iews are a DI2!I:%ARI7 DI2!52:).M%S7 .S-R5:BV-2!S7 .S-R52:%S!RAI%!S7 .S-R52:%S52:).M%S7 .S-R5I%D-E-S 7 .S-R5I%D52:).M%S 7.S-R5-RR:RS Cto see error details of a s b0rogramD7.S-R5!RI++-RS7 .S-R5D-H-%D-%2I-S Cto chec& s b0rograms reference which database ob6ects li&e tables7*iews etc.D Co!"3, Des ri2tio, 0or USER;SOURCE %AM%ame of the ob6ect !IH!y0e of ob6ect CHroced re7 f nctionD )I%)ine n mber of the so rce code !-E! !e>t of the so rce code line 1'. 2an $ s b0rograms say one f nction and the other 0roced re can ha*e same name. %o. $ s b0rograms of different ty0e cannot ha*e same name.. will get error saying that a :RA/<<;33: name is already sed by an e>isting ob6ect. 11. What is an im0licit and e>0licit rollbac&. When an s=l statement fails then only that statement is rolled bac& bcoM oracle creates an im0licit sa*e0oint for each statement. ->0licit rollbac& is gi*en by ser. 13. "ow can we dro0 a table and its de0endent integrity constraints? DR:H !AB)- table P2AS2AD- 2:%S!RAI%!SQK 14. 2ommand to e>ec te a 0roced re and a f nction? ->ec te abc Carg mentsD a where abc is 0roced re name. Bariable *51 n mber -E-2.!- *51 :# f nction5name PCarg ment5listDQ 18. Which table stores s b0rogram errors? .ser5errors 19. "ow to change :racle 0assword? Alter ser S sernameT identified by S0wdT WI!" +RA%! :H!I:% w'ith +rant command gi*es a ser a thority to 0ass along the 0ri*ileges +RA%! select :% s5em0 !: scott WI!" +RA%! :H!I:%K 1.;8811;1 F11/V.)/;1F F<9/S-H/;3F F'</S-H/;3F

+rant 0ri*elege to all sers. +RA%! select :% s5ord5id 1;. !y0es of 0ri*ileges?

!: H.B)I2K

bSystem 0ri*ileges Ce>/ create session7 create table etc.D a+ain access to the database b:b6ect 0ri*ileges Cgrant select7 0date on a tableD aMani0 late the content of the database ob6ects 3<. "ow to see which ser has logged in? S=lTshow ser 31. What is the difference between HJ and .ni= e &ey? What is a candidate and com0osite 0rimary &ey and foreign &ey? HJ can ne*er be n ll and is always ni= e while ni= e &ey col mn can be n ll. 2andidate &ey is a &ey that can be sed as a HJ. 2om0osite 0rimary &ey is formed with more than one HJ col mn. A foreign &ey C?JD is a col mn or combination of col mns in one table that refers to a HJ or ni= e &ey C.JD in the same table or in another table. 2onstraint that can only be defined at col mn le*el is: %:! %.)) constraint. Note: When create a table by sing a s b= ery then only the %:! %.)) 2onstraint is co0ied. Add a %:! %.)) constraint by sing the M:DI?I cla se 3$. What ha00ens when don@t gi*e name to a constraint?

Ser*er will generate a name by sing the SIS52n format. 3'. What is the se of :% D-)-!- 2AS2AD- cla se in a table? aAllows deletion in the 0arent table and deletion of the de0endent rows in the child table. 31. S 00ose we create a se= ence 7insert data in the table sing that se= ence and then dro0 that se= ence ? what will ha00en to the 0resent state of data. 33. "ow to add comments on a table or col mn? Io can add comments to a table or col mn by sing the 2:MM-%! command. S()T 2:MM-%! :% !AB)- s5em0 IS F-m0loyee InformationFK 2omment created 34. What are WI!" 2"-2J :H!I:% 2:%S!RAI%! and WI!" R-AD :%)I in a *iew? S()T 2R-A!- :R R-H)A2- BI-W em0* 11 $ AS S-)-2! G ' ?R:M s5em0 1 W"-Rde0t5id # 11 3 WI!" 2"-2J :H!I:% 2:%S!RAI%! em0* 115c&K Biew created. If yo attem0t to change the de0artment n mber for any rows in the *iew7 the statement will fail beca se it *iolates the 2"-2J :H!I:% constraint. -ns re that no DM) o0erations occ r by adding the WI!" R-AD :%)I o0tion to yo r *iew definition in case of sim0le *iews. Note:aA *iew can be dro00ed witho t remo*ing the nderlying data. C!hat means when we add or 0date or delete rows from sim0le *iew then the nderlying table also gets reflectedD 38. What is normaliMation and what are the ' normal forms?

Be,e0its o0 Nor3a!iEatio,P bMinimiMes data red ndancy bRed ces integrity 0roblems. C-ntity7 col mn7 referential integrity are maintained.D bIdentifies missing entities7 relationshi0s7 and tables R"!e ?irst normal form Second normal form !hird normal form Des ri2tio, All attrib tes m st be single/*al ed.CIntersection of a row and col mn m st be a single *al eD. An attrib te m st de0end 0on its entityFs entire .ID C.ni= e identifierD. C -ach table sho ld ha*e a HJ col mn and :ther col mns of a table m st de0end on HJ col mn of the tableD %o non/.ID attrib te can be de0endent 0on another non/.ID attrib te.

39. !y0es of data integrity constraints? b-ntity a%o 0art of a 0rimary &ey can be %.)) and the *al e m st be ni= e. A %.)) is an absence of a *al e. bReferential a?oreign &ey *al es m st match a 0rimary &ey or be %.)). b2ol mn aBal es in the col mn m st match the defined dataty0e. b.ser/defined aBal es m st com0ly with the b siness r les. 3;. Write a = ery to select all e*en and odd n mber of rows from the table? C"int : semod f nctionD

4<. "ow the n ll *al es are dis0layed in case of order by cla se by asc or desc. ?or asc a 1///1<<< n ll *al es are dis0layed at the end. ?or desc a 1<<<///1 n ll *al es are dis0layed first. 41. Ad*antage & Disad*antage of sing !r ncate command o*er Delete command? !r ncate table Stable5nameT aRemo*es all rows from a table. aReleases the storage s0ace sed by that table. Disad*antage is that it is a DD) command so cant be rolled bac&. 4$. Difference between in7o t and ino t 0arameters? I% 1. Defa lt 6a!"e is Hassed into s b0rogram. 9or3a! 2ara3eter a ts as A constant. :.! m st be s0ecified. Ret rned to calling -n*ironment. An ninitialiMed Bariable I% :.! M st be s0ecified. Hassed into s b0rogramK Ret rned to calling en*. an initialiMed *ariable.

A t"a! 2ara3eter 2an be a literal7 M st be a *ariable e>0ression7 constant7 or initialiMed *ariable. Ex- o0 IN OUT 2ara3eter.

M st be a *ariable.

S()T 2R-A!- :R R-H)A2- HR:2-D.R- format50hone $ C*50hone5no I% :.! BAR2"AR$D ' IS 1 B-+I% 3 *50hone5no :# FCF \\ S.BS!RC*50hone5no717'D \\ 4 FDF \\ S.BS!RC*50hone5no717'D \\ 8 F/F \\ S.BS!RC*50hone5no78DK 9 -%D format50honeK ;L 0assing in0 t as 0hone n mber and getting s bstr of the 0hone n mber.

NoteP As 0", tio,s sho"!/ o,!4 ret"r, a si,5!e #a!"e? 4o" sho"!/ ,ot /e !are OUT a,/ IN OUT 2ara3eters 0or a 0", tio,.

4'. What is 0/code? H/code is the com0iled form of the so rce code of a s b0rogram. 41. Difference between f nction and 0roced re? A 0roced re containing one :.! 0arameter can be rewritten as a f nction containing a R-!.R% statement. ->/ of a ser defined f nction: ?.%2!I:% ta> C*5*al e I% %.MB-RD R-!.R% %.MB-R IS B-+I% R-!.R% C*5*al e G .<9DK -%D ta>K (ro e/"re 1. ->ec te as a H)LS() statement $. %o R-!.R% dataty0e '. 2an ret rn none7 one or many *al es 9", tio, In*o&e as 0art of an e>0ression M st contain a R-!.R% dataty0e M st ret rn a single *al e

43. 2oordination 0ro0erties for master detail relation ? Immediate Deferred with A to= ery Deferred witho t A to= ery 44. Relational Hro0erties for master detail relation ? Isolated7non/isolated7cascading. 48. !riggers for master detail relation? "ow they change with realtional 0ro0erties. 49. Hroced res for master detail relation ? 4;. Signifance of cHre*ent masterless o0eration@? 8<. !y0es of form triggers with e>am0le? 81. Diff between Hroced re and a f nction? 8$. What is dynamic s=l? Hac&age sed for that and synta>? 8'. Diff between s=l and s=lG commands? 81. What are the different data so rces of a bloc&? Data So"r e Ta1!e 6iew 9RO) C!a"se (ro e/"re-Re0ere, e C"rsor (ro e/"re-Ta1!e o0 Re or/s Tra,sa tio,a!. Tri55er O1Ce t Ta1!e Q"er4 *ES *ES *ES *ES *ES *ES *ES DM) *ES *ES NO NO *ES *ES *ES

O1Ce t Co!"3, There ta1!e se!e te/ is the o1Ce t ta1!e 1"t o!"3, se!e te/ wi!! ha#e o1Ce t /atat42e.

*ES

*ES NO

Re0ere, e Loo$"2 T here ta1!e se!e te/ wi!! ha#e a re0ere, e *ES o!"3, whose attri1"tes wi!! 1e se!e te/ to reate a re0 !oo$"2 1!o $. 83. 2reating an O1Ce t Ta1!e?O1Ce t o!"3, and re0ere, e o!"3,? !he synta> below creates an ob6ect table based on an ob6ect ty0e: 2R-A!- !IH- aa5class5t AS :BV-2! Cde0artment BAR2"AR$C$<D7 co rse5id %.MB-RC1D7 credit5ho rs %.MB-RC1DDK 2R-A!- !AB)- aa5classes :? aa5class5tK 2R-A!- !AB)- aa5assignments Cst dent5id %.MB-RC3D7 class aa5class5tDK // this is an o1Ce t o!"3, with attrib tes 7credit5ho rs D 2R-A!- !AB)- aa5sched les Cst dent5id %.MB-RC3D7 class R-? aa5class5tDK

Cde0artment 7co rse5id

In the data bloc& wiMard7 the R-? col mn name C2)ASSD a00ears twice in the col mn selection list. It a00ears once as a heading for the referenced ob6ect@s attrib tes. It then a00ears again as a 0ointer7 and is a selectable col mn. 84. !y0es of record gro 0s? ( ery record +ro 0 aDesign time & r n time ////based on select stmt. %on/( ery record gro 0 aR n time ////not based on select stmt. Static record gro 0 // Design time //// not based on select stmt.

==. New (L@SQL' S a!ar Datat42esP b NC7AR stores fi>ed/length Cblan&/0added if necessaryD %)S character data. "ow the data is re0resented internally de0ends on the national character set7 which might se a fi>ed/width encoding s ch as .S8AS2II or a *ariable/width encoding s ch as VA14SVIS. b N6ARC7AR2 stores *ariable/length %)S character data. "ow the data is re0resented internally de0ends on the national character set7 which might se a fi>ed/width encoding s ch as W-9-B2DI2'82 or a *ariable/width encoding s ch as VA14DB2S. b SI>NT*(E lets yo restrict an integer *ariable to the *al es /17 <7 and 17 which is sef l in 0rogramming tri/state logic. b 9LOAT is a s bty0e of %.MB-R. "owe*er7 yo cannot s0ecify a scale for ?):A! *ariables. Io can only s0ecify a binary 0recision. b NATURALN is li&e s bty0e %A!.RA)7 b t 0re*ents the assignment of %.)). b (OSITI6EN is li&e s bty0e H:SI!IB-7 b t 0re*ents the assignment of %.)). b (LS;INTE>ER stores signed integers. Its magnit de range is /$11819'418 .. $11819'418. H)S5I%!-+-R *al es re= ire less storage than %.MB-R *al es. Also7 H)S5I%!-+-R o0erations se machine arithmetic7 so they are faster than %.MB-R and BI%ARI5I%!-+-R o0erations7 which se library arithmetic. Besides the database character set7 which is sed for identifiers and so rce code7 H)LS()9 now s 00orts a second character set called the national character set7 which is sed for %)S data. !he H)LS() dataty0es %2"AR and %BAR2"AR$ allow yo to store character strings formed from the national character set. 89. ->am0le of 9OR)S;DDL? 9OR);SUCCESS? DB)S;ERROR;CODE J DB)S;ERROR;TEFT 9OR)S;DDL IZBE>IN Z SS 2;2ro ;,a3e SSZY ENDY ZGY I9 ,ot 9OR);SUCCESS T7EN ha,/!e;ser#er;errorIDB)S;ERROR;CODE? DB)S;ERROR;TEFTGY

END I9Y 8;. In A00s11i diff between a standalone form and a f nction ? A form can show different o t0 t each time if it is stored as a f nction by gi*ing different o0tions in the o0tions field while registration. 9<. .ni> commands ? I32orta,t Q"estio,s i, Ora !e? De#e!o2er @2...I9or3 :.& a,/ Re2orts 2.&G Ora !e 1G What is the Ba $ 5ro",/ 2ro esses i, Ora !e a,/ what are the4. 1D !his is one of the most fre= ently as&ed = estions. !here are basically ; Hrocesses b t in a +eneral system we need to mention the first fi*e bac&gro nd 0rocesses. !hey do the ho se &ee0ing acti*ities for the :racle and are common in any system. !he *ario s bac&gro nd 0rocesses in oracle are aD Data Base Writer CDBWRD :: Data Base Writer Writes Modified bloc&s from Database b ffer cache to Data ?iles. !his is re= ired since the data is not written whene*er a transaction is commited. bD )ogWriter C)+WRD :: )ogWriter writes the redo log entries to dis&. Redo )og data is generated in redo log b ffer of S+A. As transaction commits and log b ffer fills7 )+WR writes log entries into a online redo log file. cD System Monitor CSM:%D :: !he System Monitor 0erforms instance reco*ery at instance start 0. !his is sef l for reco*ery from system fail re dD Hrocess Monitor CHM:%D :: !he Hrocess Monitor 0erforms 0rocess reco*ery when ser Hrocess fails. Hmon 2lears and ?rees reso rces that 0rocess was sing. eD 2hec&Hoint C2JH!D :: At S0ecified times7 all modified database b ffers in S+A are written to data files by DBWR at 2hec&0oints and .0dating all data files and control files of database to indicate the most recent chec&0oint fD Archie*es CAR2"D :: !he Archi*er co0ies online redo log files to archi*al storal when they are b sy. gD Reco*erorCR-2:D :: !he Reco*eror is sed to resol*e the distrib ted transaction in networ& hD Dis0atcher CDnnnD :: !he Dis0atcher is sef l in M lti !hreaded Architect re iD )c&n :: We can ha*e 0to 1< loc& 0rocesses for inter instance loc&ing in 0arallel s=l. 2G 7ow 3a,4 t42es o0 S-! State3e,ts are there i, Ora !e $D !here are basically 4 ty0es of s=l statements. !hey are aD Data Definition )ang age CDD)D: !he DD) statements define and maintain ob6ects and dro0 ob6ects. bD Data Mani0 lation )ang age CDM)D: !he DM) statements mani0 late database data. cD !ransaction 2ontrol Statements: Manage change by DM) dD Session 2ontrol: .sed to control the 0ro0erties of c rrent session enabling and disabling roles and changing .e.g: Alter Statements7 Set Role eD System 2ontrol Statements: 2hange Hro0erties of :racle Instance .e.g:: Alter System fD -mbedded S=l: Incor0orate DD)7 DM) and !.2.S in Hrogramming )ang age .e.g:: .sing the S=l Statements in lang ages s ch as F2F7 :0en7 ?etch7 e>ec te and close 8G What is a Tra,sa tio, i, Ora !e% 'D A transaction is a )ogical nit of wor& that com0romises one or more S() Statements e>ec ted by a single .ser. According to A%SI7 a transaction begins with first e>ec table statement and ends when it is e>0licitly commited or rolled bac&. :G Ke4 Wor/s Use/ i, Ora !e% 1D !he Jey words that are sed in :racle are :: aD 2ommitting: A transaction is said to be commited when the transaction ma&es 0ermanent changes res lting from the S() statements. bD Rollbac&: A transaction that retracts any of the changes res lting from S() statements in !ransaction. cD Sa*eHoint: ?or long transactions that contain many S() statements7 intermediate mar&ers or sa*e0oints are declared. Sa*e0oints can be sed to di*ide a transaction into smaller 0oints. dD Rolling ?orward: Hrocess of a00lying redo log d ring reco*ery is called rolling forward. eD 2 rsor: A c rsor is a handle Cname or a 0ointerD for the memory associated with a s0ecific statement. A c rsor is basically an area allocated by :racle for e>ec ting the S=l Statement. :racle ses an im0licit c rsor statement for Single row = ery and .ses ->0licit c rsor for a m lti row = ery. fD System +lobal Area CS+AD: !he S+A is a shared memory region allocated by the :racle that contains Data and control information for one :racle Instance. It consists of Database B ffer 2ache and Redo log B ffer. gD Hrogram +lobal Area CH+AD: !he H+A is a memory b ffer that contains data and control information for ser*er 0rocess.

gD Database B ffer 2ache: Database B ffer of S+A stores the most recently sed bloc&s of database data. !he set of database b ffers in an instance is called Database B ffer 2ache. hD Redo log B ffer :: Redo log B ffer of S+A stores all the redo log entries. iD Redo )og ?iles :: Redo log files are set of files that 0rotect altered database data in memory that has not been written to Data ?iles. !hey are basically sed for bac& 0 when a database crashes. 6D Hrocess :: A Hrocess is a Fthread of controlF or mechanism in :0erating System that e>ec tes series of ste0s. &G What are (ro e/"re? 0", tio,s a,/ (a $a5es% 3D Hroced res and f nctions consist of set of H)LS() statements that are gro 0ed together as a nit to sol*e a s0ecific 0roblem or 0erform set of related tas&s. Hroced res do not ret rn *al es while ? nctions ret rn one Bal e Hac&ages :: Hac&ages Hro*ide a method of enca0s lating and storing related 0roced res7 f nctions7 *ariables and other Hac&age 2ontents <G What are Data1ase Tri55ers a,/ Store/ (ro e/"res% 4D Database !riggers :: Database !riggers are Hroced res that are a tomatically e>ec ted as a res lt of insert in7 0date to7 or delete from table. Database triggers ha*e the *al es old and new to denote the old *al e in the table before it is deleted and the new indicated the new *al e that will be sed. D! is sef l for im0lementing com0le> b siness r les7 which cannot be enforced sing the integrity r les. We can ha*e the trigger as Before trigger or After !rigger and at Statement or Row le*el. e.g:: o0erations insert7 0date 7delete ' before 7after 'G$ A total of 4 combinations At statement le*el Conce for the triggerD or row le*elC for e*ery e>ec tion D 4 G $ A total of 1$. !h s a total of 1$ combinations are there and the restriction of sage of 1$ triggers has been lifted from :racle 8.' :nwards. Stored Hroced res :: Stored Hroced res are Hroced res that are stored in 2om0iled form in the database. !he ad*antage of sing the stored 0roced res is that many sers can se the same 0roced re in com0iled and ready to se format. =G 7ow 3a,4 I,te5rit4 R"!es are there a,/ what are the4% 8D !here are !hree Integrity R les. !hey are as follows :: aD -ntity Integrity R le :: !he -ntity Integrity R le enforces that the Hrimary &ey cannot be % ll bD ?oreign Jey Integrity R le :: !he ?JIR denotes that the relationshi0 between the foreign &ey and the 0rimary &ey has to be enforced. When there is data in 2hild !ables the Master tables cannot be deleted. cD B siness Integrity R les :: !he !hird Integrity r le is abo t the com0le> b siness 0rocesses which cannot be im0lemented by the abo*e $ r les. 'G What are the 6ario"s )aster a,/ Detai! Re!atio, shi2s% 9D !he *ario s Master and Detail Relationshi0 are aD %onIsolated :: !he Master cannot be deleted when a child is e>isting bD Isolated :: !he Master can be deleted when the child is e>isting cD 2ascading :: !he child gets deleted when the Master is deleted. +G What are the 6ario"s B!o $ Coor/i,atio, (ro2erties% ;D !he *ario s Bloc& 2oordination Hro0erties are aD Immediate Defa lt Setting. !he Detail records are shown when the Master Record are shown. bD Differed with A to ( ery :racle ?orms defer fetching the detail records ntil the o0erator na*igates to the detail bloc&. cD Differed with %o A to ( ery !he o0erator m st na*igate to the detail bloc& and e>0licitly e>ec te a = ery 1.G What are the Di00ere,t O2ti3iEatio, Te h,i-"es% 1<D !he Bario s :0timiMation techni= es are aD ->ec te Hlan :: we can see the 0lan of the = ery and change it accordingly based on the inde>es bD :0timiMer5hint :: set5item50ro0ertyCFDe0tBloc&F7:H!IMIU-R5"I%!7F?IRS!5R:WSFDK Select LGR ?irst5Rows GL De0tno7Dname7)oc7Rowid from de0t where CDe0tno T $3D cD :0timiMe5S=l :: By setting the :0timiMe5S=l # %o7 :racle ?orms assigns a single c rsor for all S() statements. !his slow downs the 0rocessing beca se for e*ery time the S() m st be 0arsed whene*er they are e>ec ted. f13r n mod le # my5firstform serid # scottLtiger o0timiMe5s=l # %o dD :0timiMe5!0 :: By setting the :0timiMe5!0# %o7 :racle ?orms assigns se0arate c rsor only for each = ery S-)-2! statement. All other S() statements re se the c rsor.

f13r n mod le # my5firstform serid # scottLtiger o0timiMe5!0 # %o 11G 7ow /o " i32!e3e,t the I0 state3e,t i, the Se!e t State3e,t% 11D We can im0lement the if statement in the select statement by sing the Decode statement. e.g select D-2:D- C-MH52A!7F1F7F?irstF7F$F7FSecondF% llDK "ere the % ll is the else statement where n ll is done . 12G 7ow 3a,4 t42es o0 Ex e2tio,s are there 1$D !here are $ ty0es of e>ce0tions. !hey are aD System ->ce0tions e.g. When no5data5foi nd7 When too5many5roiws bD .ser Defined ->ce0tions e.g. My5e>ce0tion e>ce0tion When My5e>ce0tion then 18G What are the i,!i,e a,/ the 2re o32i!er /ire ti#es% 18G The i,!i,e a,/ 2re o32i!er /ire ti#es /ete t the #a!"es /ire t!4 1:G 7ow /o 4o" "se the sa3e !o# 0or 2 o!"3,s 1:G We a, "se the sa3e !o# 0or 2 o!"3,s 14 2assi,5 the ret"r, #a!"es i, 5!o1a! #a!"es a,/ "si,5 the 5!o1a! #a!"es i, the o/e 1&G 7ow 3a,4 3i,i3"3 5ro"2s are re-"ire/ 0or a 3atrix re2ort 1&G The 3i,i3"3 ,"31er o0 5ro"2s i, 3atrix re2ort are : 1<G What is the /i00ere, e 1etwee, stati a,/ /4,a3i !o# 1<G The stati !o# o,tai,s the 2re/eter3i,e/ #a!"es whi!e the /4,a3i !o# o,tai,s #a!"es that o3e at r", ti3e 1=G What are s,a2 shots a,/ #iews% 1=G S,a2shots are 3irror or re2!i as o0 ta1!es. 6iews are 1"i!t "si,5 the o!"3,s 0ro3 o,e or 3ore ta1!es. The Si,5!e Ta1!e 6iew a, 1e "2/ate/ 1"t the #iew with 3"!ti ta1!e a,,ot 1e "2/ate/ 1'G What are the OO(S o, e2ts i, Ora !e. 1'G Ora !e /oes i32!e3e,t the OO(S o, e2ts. The 1est exa32!e is the (ro2ert4 C!asses. We a, ate5ories the 2ro2erties 14 setti,5 the #is"a! attri1"tes a,/ the, atta h the 2ro2ert4 !asses 0or the o1Ce ts. OO(S s"22orts the o, e2ts o0 o1Ce ts a,/ !asses a,/ we a, o,si/er the 2ro2ert4 !asses as !asses a,/ the ite3s as o1Ce ts 1+G What is the /i00ere, e 1etwee, a,/i/ate $e4? ",i-"e $e4 a,/ 2ri3ar4 $e4 1+G Ca,/i/ate $e4s are the o!"3,s i, the ta1!e that o"!/ 1e the 2ri3ar4 $e4s a,/ the 2ri3ar4 $e4 is the $e4 that has 1ee, se!e te/ to i/e,ti04 the rows. U,i-"e $e4 is a!so "se0"! 0or i/e,ti04i,5 the /isti, t rows i, the ta1!e. 2.GWhat is o, "rre, 4 2.G Co, "rre, 4 is a!!owi,5 si3"!ta,eo"s a ess o0 sa3e /ata 14 /i00ere,t "sers. Lo $s "se0"! 0or a essi,5 the /ata1ase are aG Ex !"si#e The ex !"si#e !o $ is "se0"! 0or !o $i,5 the row whe, a, i,sert? "2/ate or /e!ete is 1ei,5 /o,e. This !o $ sho"!/ ,ot 1e a22!ie/ whe, we /o o,!4 se!e t 0ro3 the row. 1G Share !o $ We a, /o the ta1!e as Share;Lo $ as 3a,4 share;!o $s a, 1e 2"t o, the sa3e reso"r e. 21G (ri#i!e5es a,/ >ra,ts 21G (ri#i!e5es are the ri5ht to exe "te a 2arti "!ar t42e o0 SQL state3e,ts. e.5 PP Ri5ht to Co,,e t? Ri5ht to reate? Ri5ht to reso"r e >ra,ts are 5i#e, to the o1Ce ts so that the o1Ce t 3i5ht 1e a esse/ a or/i,5!4. The 5ra,t has to 1e 5i#e, 14 the ow,er o0 the o1Ce t. 22GTa1!e S2a e? Data 9i!es? (ara3eter 9i!e? Co,tro! 9i!es 22GTa1!e S2a e PP The ta1!e s2a e is "se0"! 0or stori,5 the /ata i, the /ata1ase. Whe, a /ata1ase is reate/ two ta1!e s2a es are reate/. aG S4ste3 Ta1!e s2a e PP This /ata 0i!e stores a!! the ta1!es re!ate/ to the s4ste3 a,/ /1a ta1!es 1G User Ta1!e s2a e PP This /ata 0i!e stores a!! the "ser re!ate/ ta1!es We sho"!/ ha#e se2arate ta1!e s2a es 0or stori,5 the ta1!es a,/ i,/exes so that the a ess is 0ast. Data 9i!es PP E#er4 Ora !e Data Base has o,e or 3ore 2h4si a! /ata 0i!es. The4 store the /ata 0or the /ata1ase. E#er4 /ata0i!e is asso iate/ with o,!4 o,e /ata1ase. O, e the Data 0i!e is reate/ the siEe a,,ot ha,5e. To i, rease the siEe o0 the /ata1ase to store 3ore /ata we ha#e to a// /ata 0i!e.

(ara3eter 9i!es PP (ara3eter 0i!e is ,ee/e/ to start a, i,sta, e. A 2ara3eter 0i!e o,tai,s the !ist o0 i,sta, e o,0i5"ratio, 2ara3eters e.5.PP /1;1!o $;1"00eirs W &.. /1;,a3e W ORA= /1;/o3ai, W ".s.a 3e !a,5 Co,tro! 9i!es PP Co,tro! 0i!es re or/ the 2h4si a! str" t"re o0 the /ata 0i!es a,/ re/o !o5 0i!es The4 o,tai, the D1 ,a3e? ,a3e a,/ !o atio, o0 /1s? /ata 0i!es ?re/o !o5 0i!es a,/ ti3e sta32. 28G (h4si a! Stora5e o0 the Data 28G The 0i,est !e#e! o0 5ra,"!arit4 o0 the /ata 1ase are the /ata 1!o $s. Data B!o $ PP O,e Data B!o $ orres2o,/ to s2e i0i ,"31er o0 2h4si a! /ata1ase s2a e Exte,t PP Exte,t is the ,"31er o0 s2e i0i ,"31er o0 o,ti5"o"s /ata 1!o $s. Se53e,ts PP Set o0 Exte,ts a!!o ate/ 0or Exte,ts. There are three t42es o0 Se53e,ts aG Data Se53e,t PP No, C!"stere/ Ta1!e has /ata se53e,t /ata o0 e#er4 ta1!e is store/ i, !"ster /ata se53e,t 1G I,/ex Se53e,t PP Ea h I,/ex has i,/ex se53e,t that stores /ata G Ro!! Ba $ Se53e,t PP Te32orari!4 store A",/oA i,0or3atio, 2:G What are the ( t 9ree a,/ ( t Use/% 2:G ( t 9ree is "se/ to /e,ote the 2er e,ta5e o0 the 0ree s2a e that is to 1e !e0t whe, reati,5 a ta1!e. Si3i!ar!4 ( t Use/ is "se/ to /e,ote the 2er e,ta5e o0 the "se/ s2a e that is to 1e "se/ whe, reati,5 a ta1!e e5.PP ( t0ree 2.? (i t"se/ :. 2&G What is Row Chai,i,5 2&G The /ata o0 a row i, a ta1!e 3a4 ,ot 1e a1!e to 0it the sa3e /ata 1!o $. Data 0or row is store/ i, a hai, o0 /ata 1!o $s . 2<G What is a 2 (hase Co33it 2<G Two (hase o33it is "se/ i, /istri1"te/ /ata 1ase s4ste3s. This is "se0"! to 3ai,tai, the i,te5rit4 o0 the /ata1ase so that a!! the "sers see the sa3e #a!"es. It o,tai,s D)L state3e,ts or Re3ote (ro e/"ra! a!!s that re0ere, e a re3ote o1Ce t. There are 1asi a!!4 2 2hases i, a 2 2hase o33it. aG (re2are (hase PP >!o1a! oor/i,ator as$s 2arti i2a,ts to 2re2are 1G Co33it (hase PP Co33it a!! 2arti i2a,ts to oor/i,ator to (re2are/? Rea/ o,!4 or a1ort Re2!4 2=G What is the /i00ere, e 1etwee, /e!eti,5 a,/ tr", ati,5 o0 ta1!es 2=G De!eti,5 a ta1!e wi!! ,ot re3o#e the rows 0ro3 the ta1!e 1"t e,tr4 is there i, the /ata1ase /i tio,ar4 a,/ it a, 1e retrie#e/ B"t tr", ati,5 a ta1!e /e!etes it o32!ete!4 a,/ it a,,ot 1e retrie#e/. 2'G What are 3"tati,5 ta1!es 2'G Whe, a ta1!e is i, state o0 tra,sitio, it is sai/ to 1e 3"tati,5. e5 PP I0 a row has 1ee, /e!ete/ the, the ta1!e is sai/ to 1e 3"tati,5 a,/ ,o o2eratio,s a, 1e /o,e o, the ta1!e ex e2t se!e t. 2+G What are Co// R"!es 2+G Co// R"!es /es ri1e the i/ea! ,at"re o0 a RDB)S. No RDB)S satis0ies a!! the 12 o// r"!es a,/ Ora !e Satis0ies 11 o0 the 12 r"!es a,/ is the o,!4 R/13s to satis04 the 3axi3"3 ,"31er o0 r"!es. 8.G What is Nor3a!iEatio, 8.G Nor3a!iEatio, is the 2ro ess o0 or5a,iEi,5 the ta1!es to re3o#e the re/",/a, 4. There are 3ai,!4 & Nor3a!iEatio, r"!es. aG 1 Nor3a! 9or3 PP A ta1!e is sai/ to 1e i, 1st Nor3a! 9or3 whe, the attri1"tes are ato3i 1G 2 Nor3a! 9or3 PP A ta1!e is sai/ to 1e i, 2,/ Nor3a! 9or3 whe, a!! the a,/i/ate $e4s are /e2e,/a,t o, the 2ri3ar4 $e4 G 8r/ Nor3a! 9or3 PP A ta1!e is sai/ to 1e thir/ Nor3a! 0or3 whe, it is ,ot /e2e,/a,t tra,siti#e!4 81G What is the Di00ere, e 1etwee, a 2ost -"er4 a,/ a 2re -"er4 81G A 2ost -"er4 wi!! 0ire 0or e#er4 row that is 0et he/ 1"t the 2re -"er4 wi!! 0ire o,!4 o, e. 82G De!eti,5 the D"2!i ate rows i, the ta1!e 82G We a, /e!ete the /"2!i ate rows i, the ta1!e 14 "si,5 the Rowi/ 88G Ca, U /isa1!e /ata1ase tri55er% 7ow% 88G *es. With res2e t to ta1!e ALTER TABLE TABLE [ DISABLE a!!;tri55er \ 8:G What is 2se"/o o!"3,s % Na3e the3% 8:G A 2se"/o o!"3, 1eha#es !i$e a ta1!e o!"3,? 1"t is ,ot a t"a!!4 store/ i, the ta1!e. *o" a, se!e t 0ro3 2se"/o o!"3,s? 1"t 4o" a,,ot i,sert? "2/ate? or /e!ete their #a!"es. This se tio,

/es ri1es these 2se"/o o!"3,sP B CURR6AL B NEFT6AL B LE6EL B ROWID B ROWNU) 8&G 7ow 3a,4 o!"3,s a, ta1!e ha#e% The ,"31er o0 o!"3,s i, a ta1!e a, ra,5e 0ro3 1 to 2&:. 8<G Is s2a e a -"ire/ i, 1!o $s or exte,ts % I, exte,ts . 8=G what is !"stere/ i,/ex% I, a, i,/exe/ !"ster? rows are store/ to5ether 1ase/ o, their !"ster $e4 #a!"es . Ca, ,ot a22!ie/ 0or 7AS7. 8'G what are the /ata t42es s"22orte/ B4 ora !e IINTERNALG% 6ar har2? N"31er? Char ? )LSLABEL. 8+ G What are attri1"tes o0 "rsor% U9OUND ? UNOT9OUND ? UISO(EN?UROWCOUNT :.G Ca, 4o" "se se!e t i, 9RO) !a"se o0 SQL se!e t % *es.

9or3s :.& Q"estio,s 1G Whi h tri55er are reate/ whe, 3aster -/etai! re!atio,% 1G 3aster /e!ete 2ro2ert4 B NON-ISOLATED I/e0a"!tG aG o, he $ /e!ete 3aster 1G o, !ear /etai!s G o, 2o2"!ate /etai!s B ISOLATED aG o, !ear /etai!s 1G o, 2o2"!ate /etai!s B CASCADE aG 2er-/e!ete 1G o, !ear /etai!s G o, 2o2"!ate /etai!s 2G whi h s4ste3 #aria1!es a, 1e set 14 "sers% 2G S*STE).)ESSA>E;LE6EL S*STE).DATE;T7RES7OLD S*STE).E99ECTI6E;DATE S*STE).SU((RESS;WORKIN> 8G What are o1Ce t 5ro"2% 8G A, o1Ce t 5ro"2 is a o,tai,er 0or a 5ro"2 o0 o1Ce ts. *o" /e0i,e a, o1Ce t 5ro"2 whe, 4o" wa,t to 2a $a5e re!ate/ o1Ce ts so 4o" a, o24 or re0ere, e the3 i, a,other 3o/"!e.

:G What are re0ere, e/ o1Ce ts% :G Re0ere, i,5 a!!ows 4o" to reate o1Ce ts that i,herit their 0", tio,a!it4 a,/ a22eara, e 0ro3 other o1Ce ts. Re0ere, i,5 a, o1Ce t is si3i!ar to o24i,5 a, o1Ce t? ex e2t that the res"!ti,5 re0ere, e o1Ce t 3ai,tai,s a !i,$ to its so"r e o1Ce t. A re0ere, e o1Ce t a"to3ati a!!4 i,herits a,4 ha,5es that ha#e 1ee, 3a/e to the so"r e o1Ce t whe, 4o" o2e, or re5e,erate the 3o/"!e that o,tai,s the re0ere, e o1Ce t. &G Ca, 4o" store o1Ce ts i, !i1rar4% &G Re0ere, i,5 a!!ows 4o" to reate o1Ce ts that i,herit their 0", tio,a!it4 a,/ a22eara, e 0ro3 other o1Ce ts. Re0ere, i,5 a, o1Ce t is si3i!ar to o24i,5 a, o1Ce t? ex e2t that the res"!ti,5 re0ere, e o1Ce t 3ai,tai,s a !i,$ to its so"r e o1Ce t. A re0ere, e o1Ce t a"to3ati a!!4 i,herits a,4 ha,5es that ha#e 1ee, 3a/e to the so"r e o1Ce t whe, 4o" o2e, or re5e,erate the 3o/"!e that o,tai,s the re0ere, e o1Ce t.

<G Is 0or3s :.& o1Ce t orie,te/ too! % wh4% <G 4es ? 2artia!!4. 1G (RO(ERT* CLASS - i,herita, e 2ro2ert4 2G O6ERLOADIN> P 2ro e/"res a,/ 0", tio,s. =G Ca, 4o" iss"e DDL i, 0or3s% =G 4es? 1"t 4o" ha#e to "se 9OR)S;DDL. Re0ere, i,5 a!!ows 4o" to reate o1Ce ts that i,herit their 0", tio,a!it4 a,/ a22eara, e 0ro3 other o1Ce ts. Re0ere, i,5 a, o1Ce t is si3i!ar to o24i,5 a, o1Ce t? ex e2t that the res"!ti,5 re0ere, e o1Ce t 3ai,tai,s a !i,$ to its so"r e o1Ce t. A re0ere, e o1Ce t a"to3ati a!!4 i,herits a,4 ha,5es that ha#e 1ee, 3a/e to the so"r e o1Ce t whe, 4o" o2e, or re5e,erate the 3o/"!e that o,tai,s the re0ere, e o1Ce t. A,4 stri,5 ex2ressio, "2 to 82KP ]a !itera! ] a, ex2ressio, or a #aria1!e re2rese,ti,5 the text o0 a 1!o $ o0 /4,a3i a!!4 reate/ (L@SQL o/e ] a D)L state3e,t or ] a DDL state3e,t Restri tio,sP The state3e,t 4o" 2ass to 9OR)S;DDL 3a4 ,ot o,tai, 1i,/ #aria1!e re0ere, es i, the stri,5? 1"t the #a!"es o0 1i,/ #aria1!es a, 1e o, ate,ate/ i,to the stri,5 1e0ore 2assi,5 the res"!t to 9OR)S;DDL. 'G What is SECURE 2ro2ert4% 'G- 7i/es hara ters that the o2erator t42es i,to the text ite3. This setti,5 is t42i a!!4 "se/ 0or 2asswor/ 2rote tio,. + G What are the t42es o0 tri55ers a,/ how the se-"e, e o0 0iri,5 i, text ite3 +G Tri55ers a, 1e !assi0ie/ as Ke4 Tri55ers? )o"se Tri55ers ?Na#i5atio,a! Tri55ers. Ke4 Tri55ers PP Ke4 Tri55ers are 0ire/ as a res"!t o0 Ke4 a tio,. e.5 PP Ke4-,ext-0ie!/? Ke4-"2? Ke4-Dow, )o"se Tri55ers PP )o"se Tri55ers are 0ire/ as a res"!t o0 the 3o"se ,a#i5atio,. e.5. Whe,-3o"se-1"tto,2resse/? whe,-3o"se-/o"1!e !i $e/? et Na#i5atio,a! Tri55ers PP These Tri55ers are 0ire/ as a res"!t o0 Na#i5atio,. E.5 P (ost-Text-ite3? (re-text-ite3. We a!so ha#e e#e,t tri55ers !i$e whe, T,ew-0or3-i,sta, e a,/ whe,-,ew-1!o $-i,sta, e. We a,,ot a!! restri te/ 2ro e/"res !i$e 5o;toIZ34;1!o $.0irst;ite3HG i, the Na#i5atio,a! tri55ers B"t a, "se the3 i, the Ke4-,ext-ite3. The Di00ere, e 1etwee, Ke4-,ext a,/ (ost-Text is a, #er4 i32orta,t -"estio,. The $e4-,ext is 0ire/ as a res"!t o0 the $e4 a tio, whi!e the 2ost text is 0ire/ as a res"!t o0 the 3o"se 3o#e3e,t. Ke4 ,ext wi!! ,ot 0ire ",!ess there is a $e4 e#e,t. The se-"e, e o0 0iri,5 i, a text ite3 are as 0o!!ows PP aG 2re - text 1G whe, ,ew ite3 G $e4-,ext /G whe, #a!i/ate eG 2ost text 1. G Ca, 4o" store 2i t"res i, /ata1ase% 7ow% 1.G*es ? i, !o,5 Raw /atat42e.

11G What are 2ro2ert4 !asses% Ca, 2ro2ert4 !asses ha#e tri55er% 11G (ro2ert4 !ass i,herita, e is a 2ower0"! 0eat"re that a!!ows 4o" to -"i $!4 /e0i,e o1Ce ts that o,0or3 to 4o"r ow, i,ter0a e a,/ 0", tio,a!it4 sta,/ar/s. (ro2ert4 !asses a!so a!!ow 4o" to 3a$e 5!o1a! ha,5es to a22!i atio,s -"i $!4. B4 si32!4 ha,5i,5 the /e0i,itio, o0 a 2ro2ert4 !ass? 4o" a, ha,5e the /e0i,itio, o0 a!! o1Ce ts that i,herit 2ro2erties 0ro3 that !ass. *es . A!! t42e o0 tri55ers . B 12 aG I0 4o" ha#e 2ro2ert4 !ass atta he/ to a, ite3 a,/ 4o" ha#e sa3e tri55er writte, 0or the ite3. Whi h wi!! 0ire 0irst% 12GIte3 !e#e! tri55er 0ires ? I0 ite3 !e#e! tri55er 0ires? 2ro2ert4 !e#e! tri55er wo,At 0ire. Tri55ers at the !owest !e#e! are a!wa4s 5i#e, the 0irst 2re0ere, e. The ite3 !e#e! tri55er 0ires 0irst a,/ the, the 1!o $ a,/ the, the 9or3 !e#e! tri55er. 18G What are re or/ 5ro"2s % B Ca, re or/ 5ro"2s reate/ at r",-ti3e% 18GA re or/ 5ro"2 is a, i,ter,a! Ora !e 9or3s /ata str" t"re that has a o!"3,@row 0ra3ewor$ si3i!ar to a /ata1ase ta1!e. 7owe#er? ",!i$e /ata1ase ta1!es? re or/ 5ro"2s are se2arate o1Ce ts that 1e!o,5 to the 0or3 3o/"!e i, whi h the4 are /e0i,e/. A re or/ 5ro"2 a, ha#e a, ",!i3ite/ ,"31er o0 o!"3,s o0 t42e C7AR? LON>? NU)BER? or DATE 2ro#i/e/ that the tota! ,"31er o0 o!"3,s /oes ,ot ex ee/ <:K. Re or/ 5ro"2 o!"3, ,a3es a,,ot ex ee/ 8. hara ters. (ro5ra33ati a!!4? re or/ 5ro"2s a, 1e "se/ whe,e#er the 0", tio,a!it4 o00ere/ 14 a two-/i3e,sio,a! arra4 o0 3"!ti2!e /ata t42es is /esira1!e. T*(ES O9 RECORD >ROU(P Q"er4 Re or/ >ro"2 A -"er4 re or/ 5ro"2 is a re or/ 5ro"2 that has a, asso iate/ SELECT state3e,t. The o!"3,s i, a -"er4 re or/ 5ro"2 /eri#e their /e0a"!t ,a3es? /ata t42es? a,/ !e,5ths 0ro3 the /ata1ase o!"3,s re0ere, e/ i, the SELECT state3e,t. The re or/s i, a -"er4 re or/ 5ro"2 are the rows retrie#e/ 14 the -"er4 asso iate/ with that re or/ 5ro"2. No,--"er4 Re or/ >ro"2 A ,o,--"er4 re or/ 5ro"2 is a 5ro"2 that /oes ,ot ha#e a, asso iate/ -"er4? 1"t whose str" t"re a,/ #a!"es a, 1e 3o/i0ie/ 2ro5ra33ati a!!4 at r",ti3e. Stati Re or/ >ro"2 A stati re or/ 5ro"2 is ,ot asso iate/ with a -"er4Y rather? 4o" /e0i,e its str" t"re a,/ row #a!"es at /esi5, ti3e? a,/ the4 re3ai, 0ixe/ at r",ti3e. 1:G What are ALERT% 1:GA, ALERT is a 3o/a! wi,/ow that /is2!a4s a 3essa5e ,oti0i4i,5 o2erator o0 so3e a22!i atio, o,/itio,. 1&G Ca, a 1"tto, ha#e i o, a,/ !a1e! at the sa3e ti3e % 1&G -NO 1<G What is 3o"se ,a#i5ate 2ro2ert4 o0 1"tto,% 1<G Whe, )o"se Na#i5ate is Tr"e Ithe /e0a"!tG? Ora !e 9or3s 2er0or3s sta,/ar/ ,a#i5atio, to 3o#e the 0o "s to the ite3 whe, the o2erator a ti#ates the ite3 with the 3o"se. Whe, )o"se Na#i5ate is set to 9a!se? Ora !e 9or3s /oes ,ot 2er0or3 ,a#i5atio, Ia,/ the res"!ti,5 #a!i/atio,G to 3o#e to the ite3 whe, a, o2erator a ti#ates the ite3 with the 3o"se. 1=G What is 9OR)S;)DI;WINDOW% 1=G 0or3s r", i,si/e the )DI a22!i atio, wi,/ow. This 2ro2ert4 is "se0"! 0or a!!i,5 a 0or3 0ro3 a,other o,e. 1'G What are ti3ers % whe, whe,-ti3er-ex2ire/ /oes ,ot 0ire% 1'G The Whe,-Ti3er-Ex2ire/ tri55er a, ,ot 0ire /"ri,5 tri55er? ,a#i5atio,? or tra,sa tio, 2ro essi,5. 1+ G Ca, o1Ce t 5ro"2 ha#e a 1!o $% 1+G*es ? o1Ce t 5ro"2 a, ha#e 1!o $ as we!! as 2ro5ra3 ",its. 2.G 7ow 3a,4 t42es o0 a,#ases are there. 2.GThere are 2 t42es o0 a,#ases a!!e/ as Co,te,t a,/ Sta $ Ca,#as. Co,te,t a,#as is the /e0a"!t a,/ the o,e that is "se/ 3ost!4 0or 5i#i,5 the 1ase e00e t. Its !i$e a 2!ate o, whi h we a// ite3s a,/ sta $e/ a,#as is "se/ 0or 5i#i,5 8 /i3e,sio,a! e00e t. The 0o!!owi,5 -"estio,s 3i5ht ,ot 1e as$e/ i, a, A#era5e I,ter#iew a,/ o"!/ 1e as$e/ whe, the I,ter#iewer wa,ts to tro"1!e " a,/ 5o /ee2222222222222RR7e a,,ot 5o 0"rtherR.. 1G What are "ser-exits%

1G It i,#o$es 8>L 2ro5ra3s. 2G Ca, 4o" 2ass #a!"es to-a,/-0ro 0ro3 0orei5, 0", tio, % how % 2G *es . *o" o1tai, a ret"r, #a!"e 0ro3 a 0orei5, 0", tio, 14 assi5,i,5 the ret"r, #a!"e to a, Ora !e 9or3s #aria1!e or ite3. )a$e s"re that the Ora !e 9or3s #aria1!e or ite3 is the sa3e /ata t42e as the ret"r, #a!"e 0ro3 the 0orei5, 0", tio,. A0ter assi5,i,5 a, Ora !e 9or3s #aria1!e or ite3 #a!"e to a (L@SQL #aria1!e? 2ass the (L@SQL #aria1!e as a 2ara3eter #a!"e i, the (L@SQL i,ter0a e o0 the 0orei5, 0", tio,. The (L@SQL #aria1!e that is 2asse/ as a 2ara3eter 3"st 1e a #a!i/ (L@SQL /ata t42eY it 3"st a!so 1e the a22ro2riate 2ara3eter t42e as /e0i,e/ i, the (L@SQL i,ter0a e. 8G What is IA(FTB str" t"re % 8G The e,tries o0 (ro B C a,/ "ser exits a,/ the 0or3 whi h si3"!ate the 2ro or "ser;exit are store/ i, IA(FTB ta1!e i, /@1. :G Ca, 4o" a!! WIN-SDK thr"oA "ser exits% :G *ES. &G Does "ser exits s"22orts DLL o, )SWINDOWS % &G *ES . <G What is 2ath setti,5 0or DLL% <G )a$e s"re 4o" i, !"/e the ,a3e o0 the DLL i, the 9OR)S:&;USEREFIT #aria1!e o0 the ORACLE.INI 0i!e? or re,a3e the DLL to 9:&FTB.DLL. I0 4o" re,a3e the DLL to 9:&FTB.DLL? re2!a e the existi,5 9:&FTB.DLL i, the ^ORAWIN^BIN /ire tor4 with the ,ew 9:&FTB.DLL. =G 7ow is 3a22i,5 o0 ,a3e o0 DLL a,/ 0", tio, /o,e% =G The /!! a, 1e reate/ "si,5 the 6is"a! CNN @ 6is"a! Basi Too!s a,/ the, the /!! is 2"t i, the 2ath that is /e0i,e/ the re5istr4. 'G what is 2re o32i!er% 'G It is si3i!ar to C 2re o32i!er /ire ti#es. +G Ca, 4o" o,,e t to ,o, - ora !e /ata so"r e % 7ow% +G *es . 1. G what are $e4-3o/e a,/ !o $i,5 3o/e 2ro2erties% !e#e! % 1.G Ke4 )o/e P S2e i0ies how ora !e 0or3s ",i-"e!4 i/e,ti0ies rows i, the /ata1ase. This is 2ro2ert4 i, !"/es 0or a22!i atio, that wi!! r", a5ai,st NON-ORACLE /ata so"r es . Ke4 setti,5 ",i-"e I/e0a"!t.G /atea1!e ,-"2/atea1!e. Lo $i,5 3o/e P S2e i0ies whe, Ora !e 9or3s sho"!/ atte32t to o1tai, /ata1ase !o $s o, rows that orres2o,/ to -"erie/ re or/s i, the 0or3. aG i33e/iate 1G /e!a4e/ 11G What are sa#e2oi,t 3o/e a,/ "rsor 3o/e 2ro2erties % !e#e!% 11G S2e i0ies whether Ora !e 9or3s sho"!/ iss"e sa#e2oi,ts /"ri,5 a sessio,. This 2ro2ert4 is i, !"/e/ 2ri3ari!4 0or a22!i atio,s that wi!! r", a5ai,st ,o,-ORACLE /ata so"r es. 9or a22!i atio,s that wi!! r", a5ai,st ORACLE? "se the /e0a"!t setti,5. C"rsor 3o/e - /e0i,e "rsor state a ross tra,sa tio, O2e,@ !ose. 12G Ca, 4o" re2!a e /e0a"!t 0or3 2ro essi,5 % 7ow % 18G What is tra,sa tio,a! tri55er 2ro2ert4% 18G I/e,ti0ies a 1!o $ as tra,sa tio,a! o,tro! 1!o $. i.e. ,o, - /ata1ase 1!o $ that ora !e 0or3s sho"!/ 3a,a5e as tra,sa tio,a! 1!o $.INON-ORACLE /ata so"r eG /e0a"!t - 9ALSE. 1:G What is OLE a"to3atio, % 1:G OLE a"to3atio, a!!ows a, OLE ser#er a22!i atio, to ex2ose a set o0 o33a,/s a,/ 0", tio,s that a, 1e i,#o$e/ 0ro3 a, OLE o,tai,er a22!i atio,. OLE a"to3atio, 2ro#i/es a wa4 0or a, OLE o,tai,er a22!i atio, to "se the 0eat"res o0 a, OLE ser#er a22!i atio, to 3a,i2"!ate a, OLE o1Ce t 0ro3 the OLE o,tai,er e,#iro,3e,t. I9OR)S;OLEG 1&G What /oes i,#o$e 1"i!t-i, /o%

1&G This 2ro e/"re i,#o$es a 3etho/. S4,taxP (ROCEDURE OLE2.IN6OKE Io1Ce t o1C;t42e? 3etho/ 6ARC7AR2? !ist !ist;t42e PW .GY (ara3etersP o1Ce t Is a, OLE2 A"to3atio, O1Ce t. 3etho/ Is a 3etho/ I2ro e/"reG o0 the OLE2 o1Ce t. !ist Is the ,a3e o0 a, ar5"3e,t !ist assi5,e/ to the OLE2.CREATE;AR>LIST 0", tio,. 1<G What are O(EN;9OR)?CALL;9OR)?NEW;9OR)% /i00% 1<G CALL;9OR) P It a!!s the other 0or3. 1"t 2are,t re3ai,s a ti#e? whe, a!!e/ 0or3 o32!etes the o2eratio, ? it re!eases !o $ a,/ o,tro! 5oes 1a $ to the a!!i,5 0or3. Whe, 4o" a!! a 0or3? Ora !e 9or3s iss"es a sa#e2oi,t 0or the a!!e/ 0or3. I0 the CLEAR;9OR) 0", tio, a"ses a ro!!1a $ whe, the a!!e/ 0or3 is "rre,t? Ora !e 9or3s ro!!s 1a $ ", o33itte/ ha,5es to this sa#e2oi,t. O(EN;9OR) P Whe, 4o" a!! a 0or3? Ora !e 9or3s iss"es a sa#e2oi,t 0or the a!!e/ 0or3. I0 the CLEAR;9OR) 0", tio, a"ses a ro!!1a $ whe, the a!!e/ 0or3 is "rre,t? Ora !e 9or3s ro!!s 1a $ ", o33itte/ ha,5es to this sa#e2oi,t. NEW;9OR) P Exits the "rre,t 0or3 a,/ e,ters the i,/i ate/ 0or3. The a!!i,5 0or3 is ter3i,ate/ as the 2are,t 0or3. I0 the a!!i,5 0or3 ha/ 1ee, a!!e/ 14 a hi5her 0or3? Ora !e 9or3s $ee2s the hi5her a!! a ti#e a,/ treats it as a a!! to the ,ew 0or3. Ora !e 9or3s re!eases 3e3or4 Is" h as /ata1ase "rsorsG that the ter3i,ate/ 0or3 was "si,5. Ora !e 9or3s r",s the ,ew 0or3 with the sa3e R",0or3 o2tio,s as the 2are,t 0or3. I0 the 2are,t 0or3 was a a!!e/ 0or3? Ora !e 9or3s r",s the ,ew 0or3 with the sa3e o2tio,s as the 2are,t 0or3.

1= G What is a!! 0or3 sta $% 1=G Whe, s" essi#e 0or3s are !oa/e/ #ia the CALL;9OR) 2ro e/"re? the res"!ti,5 3o/"!e hierar h4 is $,ow, as the a!! 0or3 sta $. 1'G Ca, " 2ort a22!i atio,s a ross the 2!at0or3s% how% 1'G *es we a, 2ort a22!i atio,s a ross 2!at0or3s. Co,si/er the 0or3 /e#e!o2e/ i, a wi,/ows s4ste3. The 0or3 wo"!/ 1e 5e,erate/ i, ",ix s4ste3 14 "si,5 0:&5e, 34;0or3.031 s ott@ti5er >UI 1G What is a #is"a! attri1"te% 1G 6is"a! attri1"tes are the 0o,t? o!or? a,/ 2atter, 2ro2erties that 4o" set 0or 0or3 a,/ 3e," o1Ce ts that a22ear i, 4o"r a22!i atio,As i,ter0a e. 2G Di00. 1etwee, 6AT a,/ (ro2ert4 C!ass% i32 2GNa3e/ #is"a! attri1"tes /e0i,e o,!4 0o,t? o!or? a,/ 2atter, attri1"tesY 2ro2ert4 !asses a, o,tai, these a,/ a,4 other 2ro2erties. *o" a, ha,5e the a22eara, e o0 o1Ce ts at r",ti3e 14 ha,5i,5 the ,a3e/ #is"a! attri1"te 2ro5ra33ati a!!4Y 2ro2ert4 !ass assi5,3e,t a,,ot 1e ha,5e/ 2ro5ra33ati a!!4. Whe, a, o1Ce t is i,heriti,5 0ro3 1oth a 2ro2ert4 !ass a,/ a ,a3e/ #is"a! attri1"te? the ,a3e/ #is"a! attri1"te setti,5s ta$e 2re e/e, e? a,/ a,4 #is"a! attri1"te 2ro2erties i, the !ass are i5,ore/. 8 G Whi h tri55er re!ate/ to 3o"se% 8G Whe,-)o"se-C!i $ Whe,-)o"se-Do"1!eC!i $ Whe,-)o"se-Dow, Whe,-)o"se-E,ter Whe,-)o"se-Lea#e Whe,-)o"se-)o#e Whe,-)o"se-U2 :G What is C"rre,t re or/ attri1"te 2ro2ert4% :G S2e i0ies the ,a3e/ #is"a! attri1"te "se/ whe, a, ite3 is 2art o0 the "rre,t re or/. C"rre,t Re or/ Attri1"te is 0re-"e,t!4 "se/ at the 1!o $ !e#e! to /is2!a4 the "rre,t row i, a 3"!ti-re or/ I0 4o" /e0i,e a, ite3-!e#e! C"rre,t Re or/ Attri1"te? 4o" a, /is2!a4 a 2re-/eter3i,e/ ite3 i, a s2e ia! o!or whe, it is 2art o0 the "rre,t re or/? 1"t 4o" a,,ot /4,a3i a!!4 hi5h!i5ht the "rre,t ite3? as the i,2"t 0o "s ha,5es. &G Ca, " ha,5e 6AT at r", ti3e%

&G *es. *o" a, 2ro5ra33ati a!!4 ha,5e a, o1Ce tAs ,a3e/ #is"a! attri1"te setti,5 to ha,5e the 0o,t? o!or? a,/ 2atter, o0 the o1Ce t at r",ti3e. <G Ca, " set /e0a"!t 0o,t i, 0or3s% <G *es. Cha,5e wi,/ows re5istr4Ire5e/itG. Set 0or3:&;0o,t to the /esire/ 0o,t. =G Ca, " ha#e OLE o1Ce ts i, 0or3s% =G *es. 'G Ca, " ha#e 6BF a,/ OCF o,tro!s i, 0or3s % 'G *es. +G What r the t42es o0 wi,/ows IWi,/ow st4!eG% +G S2e i0ies whether the wi,/ow is a Do "3e,t wi,/ow or a Dia!o5 wi,/ow. 1.G What is OLE A ti#atio, st4!e 2ro2ert4% 1.G S2e i0ies the e#e,t that wi!! a ti#ate the OLE o,tai,i,5 ite3. 11G Ca, " ha,5e the 3o"se 2oi,ter % 7ow% 11G *es. S2e i0ies the 3o"se "rsor st4!e. Use this 2ro2ert4 to /4,a3i a!!4 ha,5e the sha2e o0 the "rsor. Re2orts 2.& 1G 1G 7ow 3a,4 t42es o0 o!"3,s are there a,/ what are the4 9or3"!a o!"3,s PP 9or /oi,5 3athe3ati a! a! "!atio,s a,/ ret"r,i,5 o,e #a!"e S"33ar4 Co!"3,s PP 9or /oi,5 s"33ar4 a! "!atio,s s" h as s"33atio,s et . (!a e ho!/er Co!"3,s PP These o!"3,s are "se0"! 0or stori,5 the #a!"e i, a #aria1!e Ca, " ha#e 3ore tha, o,e !a4o"t i, re2ort It is 2ossi1!e to ha#e 3ore tha, o,e !a4o"t i, a re2ort 14 "si,5 the a//itio,a! !a4o"t o2tio, i, the !a4o"t e/itor. Ca, " r", the re2ort with o"t a 2ara3eter 0or3 *es it is 2ossi1!e to r", the re2ort witho"t 2ara3eter 0or3 14 setti,5 the (ARA) #a!"e to N"!!

2G 2G 8G 8G

:G What is the !o $ o2tio, i, re2orts !a4o"t :G B4 "si,5 the !o $ o2tio, we a,,ot 3o#e the 0ie!/s i, the !a4o"t e/itor o"tsi/e the 0ra3e. This is "se0"! 0or 3ai,tai,i,5 the 0ie!/s . &G What is 9!ex &G 9!ex is the 2ro2ert4 o0 3o#i,5 the re!ate/ 0ie!/s to5ether 14 setti,5 the 0!ex 2ro2ert4 o, <G <G What are the 3i,i3"3 ,"31er o0 5ro"2s re-"ire/ 0or a 3atrix re2ort The 3i,i3"3 o0 5ro"2s re-"ire/ 0or a 3atrix re2ort are :

)ost 9re-"e,t!4 As$e/ Q"estio,s

What are yo r strengths and wea&nesses? !ell me abo t yo rself. What are yo r team/0layer = alities? +i*e e>am0les. :f the co rses yo ha*e had at college which co rses ha*e yo en6oyed the most? What is yo r +HA? "ow do yo feel abo t it? Does it reflect yo r abilities? "ow ha*e yo r ed cational and wor& e>0eriences 0re0ared yo for this 0osition? What wor& e>0eriences ha*e been most *al able to yo and why? What ha*e the e>0eriences on yo r res me ta ght yo abo t managing and wor&ing with 0eo0le? :f the hobbies and interests listed on yo r res me what is yo r fa*orite and tell me why? Where do yo see yo rself in fi*e years? What goals ha*e yo set for yo rself? "ow are yo 0lanning to achie*e them? !o what do yo owe yo r 0resent s ccess? Why sho ld I hire yo ? What ma&es yo thin& yo can handle this 0osition?

What is yo r most significant accom0lishment to date? Why do yo want to wor& here? Describe a leadershi0 role of yo rs and tell why yo committed yo r time to it. In a 0artic lar leadershi0 role yo had7 what was yo r greatest challenge? +i*e me an e>am0le of an idea that has come to yo and what yo did with it? +i*e me an e>am0le of a 0roblem yo sol*ed and the 0rocess yo sed? +i*e me an e>am0le of the most creati*e 0ro6ect that yo ha*e wor&ed on. !ell me abo t a 0ro6ect yo initiated? Describe the 0ro6ect or sit ation that best demonstrates yo r analytical abilities? Since attending college7 what is the to ghest decision that yo ha*e had to ma&e? !ell me abo t yo r most diffic lt decision and how did yo go abo t ma&ing it? What ty0es of sit ations 0 t yo nder 0ress re7 and how do yo deal with 0ress re? +i*e me a sit ation in which yo failed7 and how yo handled it? Why are yo interested in o r organiMation? What ty0e of 0osition are yo see&ing? Where do yo thin& yo r interest in this career comes from? What ind stry besides this one are yo loo&ing into? Why ha*e yo chosen this 0artic lar 0rofession? What interests yo abo t this 6ob? What challenges are yo loo&ing for in a 0osition? What can yo contrib te to this com0any? What moti*ates yo ? What t rns yo off? If I as&ed the 0eo0le who &now yo well to describe yo 7 what three words wo ld they se? If I as&ed the 0eo0le who &now yo for one reason why I sho ldnFt hire yo what wo ld they say? When yo ta&e on a 0ro6ect do yo li&e to attac& the 0ro6ect in a gro 0 of indi*id ally? Describe the ty0e of manager yo 0refer. !ell me abo t a team 0ro6ect of which yo are 0artic larly 0ro d and yo r contrib tion? Describe a sit ation where yo had to wor& with someone who was diffic lt7 how did yo handle it? What ty0e of wor& en*ironment a00eals to yo most? With which other com0anies are yo inter*iewing? What charactersitics do yo thin& are im0ortant for this 0osition? Why do yo feel that this com0any will be a career for yo rather than a 6ob? %ame two management s&ills that yo thin& yo ha*e? What characteristics are most im0ortant in a good manager? "ow ha*e yo dis0layed one of them? Why did yo choose this college and how did yo arri*e at this decision? What factors did yo consider in choosing yo r ma6or? Describe how yo r fa*orite co rse has contrib ted yo r career interests? Since yo ha*e been at college7 what is it that yo are 0ro dest of? "ow ha*e yo changed 0ersonally since starting college? What has been yo r greatest challenge? If yo co ld change a decision yo made while at college what wo ld yo change and why? Why did yo choose the cam0 s in*ol*ements yo did? What did yo gain? What did yo contrib te?

Q"estio,s *o" Ca, As$ the I,ter#iewerP

As& abo t the information yo researched. Describe my 6ob d ties. Is this a newly created 0osition? What are the com0anies short and long term goals? What do yo li&e most abo t wor&ing for this com0any? What is a ty0ical day li&e for yo ? !o whom wo ld I re0ort? Whom will I s 0er*ise? !ell me abo t the training 0rogram I will e>0erience. What is the com0anyFs 0romotional 0olicy? With whom will I be wor&ing most closely? When can I e>0ect to hear from yo ?

DataBase Assi5,3e,t

Q"estio, 1. Record !rac&ing In any com0etiti*e e*ent there are records that stand and records that are bro&en.!he e*ent categories contains the world record and commonwealth record fig res for all e*ents as this meeting.As the e*ents ha*e their heats and finals r n some of the records get bro&en with new records being set. Io r tas& in this = estion is to write H)LS() 0rogram to determine who 7if anyone7bro&e records d ring the meeting .?irst yo will need to create a table to store history into.Initially this new table will contain the c rrent world and commonwealth records for each e*ent category.!hen7as the races are com0leted 7each change to either the commonwealth or the world record time sho ld be recorded by adding a new row to the table. :nce com0leted yo r 0rogram will ha*e recorded7 in the table yo create7 the initial time for each record and all s bse= ent changes to the records. %ote that only the first 0erson to finish a race can brea& a record since anyone finishing after them will ha*e a slower time than the record they 6 st set. !he table yo create to store the history of the records sho ld ha*e col mns for the e*ent descri0tion7 the gender of com0etitors7 the name of the com0etitor who set the record7 the record ty0e Ceither W or 2 for the commonwealthD7 the date the record was set7 and the record time. ?or records which e>isted 0rior to the meeting Cwhich are stored in the -*ent 2ategories tableD the name7 and date of the record will be n ll. Io m st re0ort the record history in order of the e*ent descri0tion7 within e*ent descri0tion sort by gender7 within gender sort by record ty0e7within record ty0e sort in the descending order of time. S"13it the 0o!!owi,5P !he create table statement yo sed to create yo r table for storing the record history. !he H)LS() code yo sed to determine the records. !he S() code yo sed to o t0 t the table of res lting record history. !he act al o t0 t from the e>ec tion of the S() statement. No ta1!e Coi,s are 2er3itte/.*o"r 2ro e/"re sho"!/ ha#e 3"!ti2!e "rsors a,/ 2ass 2ara3eters.Exa32!es o0 2ara3eter 2assi,5 are i, !"/e/ i, the st"/4 5"i/e a,/ wi!! a!so a22ear i, !e t"res s!i/es /"ri,5 the se3ester. Q"estio, 2 Hrod ce a H)LS() stored 0roced re as follows: !he stored 0roced re sho ld acce0t an in0 t 0arameter of com0etitor ID.?or the com0etitor selected7the following information sho ld be 0resented on the screen. 2om0etitor %ame ?or each race in which the com0etitor has com0leted7the following information: -*ent % mber Res lt !ime Hosition

No ta1!e Coi,5 are 2er3itte/.*o"r 2ro e/"re sho"!/ ha#e 3"!ti2!e "rsors a,/ 2ass 2ara3eters. S"13it the 0o!!owi,5 0or 1oth (L@SQL -"estio,sP !he H)LS() code 0rinted o t. !he act al o t0 t from the e>ec tion of the 0rogram. The Ta1!es 0or the Data1ase Co",tries !he co ntries listed in the 2o ntries table7described below7incl de all of the co ntries that 0artici0ate in the 2ommonwealth +ames7howe*er7not all of these co ntries ha*e re0resentati*es at this com0etition. 2reate table 2o ntries

C2o ntryID *archar$C'D not n ll7 2o ntry%ame *archar$C1<D not n ll7 2:%S!RAI%! 2o ntries50& 0rimary &ey C co ntryIDDDK !he 2o ntryID re0resents the three letter abbre*iation sed fo rthe co ntry in the 2ommonwealth +ames com0etition.!he co ntry name is the name s ally sed when referring to the co ntry. Co32etitors !he com0etitors table contains a list of the com0etitors who may or may not com0ete in these games.%ot all com0etitors in the com0etitors table act ally com0ete in the games. 2reate table 2om0etitors C2om0etitor%o n mber C1D not n ll7 %ame *archar$C1<D not n ll7 2o ntryID *archar$C'D7 DateBirth date7 +ender charC1D7 2:%S!RAI%! 2om0etitors50& 0rimary &ey Ccom0etitor%:DDK !he co ntryID re0resents a co ntryID from the 2o ntries table and acts as foreign &ey into that table.+ender is a single character field that contains a code re0resenting the gender of the com0etitor.!his col mn will contain M for male com0etitors or ? for female com0etitors. E#e,t Cate5ories !he -*ent2ategories table contains the *ario s categories of e*ents that are contested at the games.?or e>am0le7one s ch e*ent category is the Men@s 1<<m Bac&stro&e.%otice that an e*ent category consists of an e*ent descri0tion and a gender.Also recorded in this table are the world and commonwealth record time for the 0artic lar e*ent as they stood 6 st 0rior to the com0etion. create table -*ent2ategories C-*ent2at%o n mberC$D not n ll7 -*entDescr *archar$C'<D not n ll7 +ender charC1D7 WorldRecord n mberC971D7 2ommonwealthRecord n mberC971D7 2:%S!RAI%! -*ent2ategories50& 0rimary &ey C-*ent2at%oDDK E#e,ts !he -*ents table contains the 0artic lar e*ents being contested at the games.In this table the e*ents are act al races7 which are ither eheats or finals and ha*e a sched led start time. create table -*ents C-*ent%o n mberC1D not n ll7 -*ent2at%o n mberC$D not n ll7 -*ent!y0e charC1D7 Start!ime date7 2:%S!RAI%! -*ents50& 0rimary &ey C-*ent%oD7 2:%S!RAI%! -*ents5f& foreign &ey C-*ent2at%oD references -*ent2ateogries C-*ent2at%oDDK !he -*ent%o col mn contains a ni= e integer sed as the 0rimary &ey for the e*ent.!he -*ent2at%o 0ro*ides a foreign &ey into the e*ent categories table and enables an association between the e*ent and its details incl ding the records.-*ent!y0e is a single character coding which shows whether an e*ent is a heatC"D or a finalCfD.

E,tries !he -ntries table associates a com0etitor with a 0artic lar e*ent.It not only records the fact that the com0etitor has entered the e*ent b t also the res lting time that they ha*e achie*ed7 the lane that they were assigned and a flag to indicate whether or not they were dis= alified. 2reate table -ntries C-*ent%o 2om0etitor%o )ane n mberC1D7 n mberC1D n mberC1D not n ll7 not n ll7

Res lt!ime n mberC971D7 Dis= alified charC1D7 2:%S!RAI%! -ntries50& 0rimary &ey C-*ent%o7 com0etitor%oD7 2:%S!RAI%! -ntries5-*ts5f& foreign &ey C-*ent%oD references -*entsC-*ent%oD7 2:%S!RAI%! -ntries52om05f& foreign &ey Ccom0etitot%oD references 2om0etitorsC2om0etitor%oDDK !he -*ent%o col mn is a foreign &ey into the -*ents table.!he com0etitor%o col mn 0ro*ides a foreign &ey bac& to the com0etitors table.Dis= alified contain a I if the com0etitor has been dis= alified and an % otherwise.A dis= alified com0etitor is not eligible for any medals not are they able to brea& any records7 regardless of the time they swim. INDEF

1. Q"er4 0or retrie#i,5 N hi5hest 2ai/ e32!o4ees 9RO) ea h De2art3e,t. 2. Q"er4 that wi!! /is2!a4 the tota! ,o. o0 e32!o4ees? a,/ o0 that tota! the ,"31er who were hire/ i, 1+'.?
1+'1? 1+'2? a,/ 1+'8.

3. Q"er4 0or !isti,5 De2t,o? e,a3e? sa!? SU)Isa! i, that /e2tG. 4. )atrix -"er4 to /is2!a4 the Co1? the sa!ar4 0or that Co1 1ase/ o, /e2art3e,t ,"31er? a,/ the tota! sa!ar4
0or that Co1 0or a!! /e2art3e,ts.

5. Nth To2 Sa!ar4 o0 a!! the e32!o4ees. 6. Retrie#i,5 the Nth row 9RO) a ta1!e. 7. Tree Q"er4. 8. E!i3i,ate /"2!i ates rows i, a ta1!e. 9. Dis2!a4i,5 E6ER* Nth row i, a ta1!e. 10. To2 N rows 9RO) a ta1!e. 11. COUNT@SU) RAN>ES o0 /ata #a!"es i, a o!"3,. 12. 9or e-"a! siEe ra,5es it 3i5ht 1e easier to a! "!ate it with DECODEITRUNCI#a!"e@ra,5eG? .? rate;.? 1?
rate;1? ...G.

13. Co",t /i00ere,t /ata #a!"es i, a o!"3,. 14. Q"er4 to 5et the 2ro/" t o0 a!! the #a!"es o0 a o!"3,. 15. Q"er4 to /is2!a4 o,!4 the /"2!i ate re or/s i, a ta1!e. 16. Q"er4 0or 5etti,5 the 0o!!owi,5 o"t2"t as 3a,4 ,"31er o0 rows i, the ta1!e. 17. 9", tio, 0or 5etti,5 the Ba!a, e 6a!"e. 18. 9", tio, 0or 5etti,5 the E!e3e,t 6a!"e. 19. SELECT Q"er4 0or o",ti,5 No o0 wor/s. 20. 9", tio, to he $ 0or a !ea2 4ear. 21. Q"er4 0or re3o#i,5 a!! ,o,-,"3eri . 22. Q"er4 0or tra,s!ati,5 a o!"3, #a!"es to INITCA(. 23. 9", tio, 0or /is2!a4i,5 R"2ees i, Wor/s.
$1. ? nction for dis0laying % mbers in Words 25. Q"er4 0or /e!eti,5 a!ter,ate e#e, rows 9RO) a ta1!e. 26. Q"er4 0or /e!eti,5 a!ter,ate o// rows 9RO) a ta1!e. 27. (ro e/"re 0or se,/i,5 E3ai!. 28. A!ter,ate Q"er4 0or DECODE 0", tio,. 29. Create ta1!e a//i,5 Co,strai,t to a /ate 0ie!/ to S*SDATE or 8 3o,ths !ater. 30. Q"er4 to !ist a!! the s"22!iers who r s"22!4i,5 a!! the 2arts s"22!ie/ 14 s"22!ier AS2A. 31. Q"er4 to 5et the !ast S",/a4 o0 a,4 3o,th. 32. Q"er4 to 5et a!! those who ha#e ,o hi!/re, the3se!#es. 33. Q"er4 to SELECT !ast N rows 9RO) a ta1!e. 34. SELECT with #aria1!es. 35. Q"er4 to 5et the DB Na3e. 36. >etti,5 the "rre,t /e0a"!t s he3a. 37. Q"er4 to 5et a!! the o!"3, ,a3es o0 a 2arti "!ar ta1!e. 38. S2oo! o,!4 the -"er4 res"!t to a 0i!e i, SQL(LUS. 39. Q"er4 0or 5etti,5 the "rre,t Sessio,ID. 40. Q"er4 to /is2!a4 rows 9RO) 3 to ,. 41. Q"er4 to o",t ,o. O0 o!"3,s i, a ta1!e. 42. (ro e/"re to i, rease the 1"00er !e,5th. 43. I,serti,5 a, J s431o! i, a 6ar har2 o!"3,. 44. Re3o#i,5 Trai!i,5 1!a,$s i, a s2oo!e/ 0i!e. 45. Sa32!es 0or exe "ti,5 D4,a3i SQL State3e,ts. 46. Di00ere, es 1etwee, SQL a,/ )S-A ess.

47. Q"er4 to /is2!a4 a!! the hi!/re,? s"1 hi!/re, o0 a 2are,t. 48. (ro e/"re to rea/@write /ata 0ro3@to a text 0i!e. 49. Q"er4 to /is2!a4 ra,/o3 ,"31er 1etwee, a,4 two 5i#e, ,"31ers. 50. Ti3e /i00ere, e 1etwee, two /ate o!"3,s. 51. Usi,5 INSTR a,/ SUBSTR 52. 6iew 2ro e/"re o/e 53. To o,#ert si5,e/ ,"31er to ,"31er i, ora !e 54. Co!"3,s o0 a ta1!e
&&. &<. &=. &'. &+. <.. <1. <2. <8. <:. <&. <<. De!ete rows o,/itio,a!!4 CLOB to Char Cha,5e Setti,5s Do"1!e -"oti,5 a Si,5!e -"ote/ Stri,5 Ti3e Co,#ersio, Ta1!e o32ariso, R",,i,5 Qo1s Swit hi,5 Co!"3,s Re2!a e a,/ Ro",/ 9irst /ate o0 the 4ear Create Se-"e, e C"rsors 67. C"rre,t Wee$ 68. Create Q"er4 to restri t the "ser to a si,5!e row. 69. Q"er4 to 5et the 0irst i,serte/ re or/ 9RO) a ta1!e. 70. Co, ate,ate a o!"3, #a!"e with 3"!ti2!e rows. 71. Q"er4 to /e!ete a!! the ta1!es at o, e. 72. SQL Q"er4 0or 5etti,5 Or2ha, Re or/s.

1. The 0o!!owi,5 -"er4 retrie#es K2K hi5hest 2ai/ e32!o4ees 9RO) ea h De2art3e,t P S-)-2! de0tno7 em0no7 sal ?R:M em0 e W"-R$ T C S-)-2! 2:.%!Ce1.salD ?R:M em0 e1 W"-R- e.de0tno # e1.de0tno A%D e.sal S e1.sal D :RD-R BI 17' D-S2K Inde> 2. Q"er4 that wi!! /is2!a4 the tota! ,o. o0 e32!o4ees? a,/ o0 that tota! the ,"31er who were hire/ i, 1+'.? 1+'1? 1+'2? a,/ 1+'8. >i#e a22ro2riate o!"3, hea/i,5s. I am loo&ing at the following o t0 t. We need to stic& to this format. !otal 1;9< /////////// //////////// 11 1 1;91 //////////// 1< 1;9$ ///////////// $ 1;9' /////////// 1

S-)-2! 2:.%! CGD7 2:.%!CD-2:D-C!:52"AR Chiredate7 FIIIIFD7F1;9<F7 em0noDD ,1;9<,7 2:.%! CD-2:D- C!:52"AR Chiredate7 FIIIIFD7 F1;91F7 em0noDD ,1;91,7 2:.%! CD-2:D- C!:52"AR Chiredate7 FIIIIFD7 F1;9$F7 em0noDD ,1;9$,7 2:.%! CD-2:D- C!:52"AR Chiredate7 FIIIIFD7 F1;9'F7 em0noDD ,1;9', ?R:M em0K Inde> 8. Q"er4 0or !isti,5 De2t,o? e,a3e? sa!? SU)Isa! i, that /e2tG P S-)-2! a.de0tno7 ename7 sal7 CS-)-2! S.MCsalD ?R:M em0 b W"-R- a.de0tno # b.de0tnoD ?R:M em0 a :RD-R BI a.de0tnoK :.!H.! :

####### D-H!%: ######### 1< '< 1< 1< '< '< '< '< '< $< $< $< Inde>

-%AMSA) S.M CSA)D ####### #### ######### JI%+ 3<<< 118$3 B)AJ$93< 1<;<< 2)ARJ $13< 118$3 V:%-S $;83 118$3 MAR!I% 1$3< 1<;<< A))-% 14<< 1<;<< !.R%-R 13<< 1<;<< VAM-S ;3< 1<;<< WARD $83< 1<;<< SMI!" 9<<< ''<<< S2:!! '<<< ''<<< MI))-R $<<<< ''<<<

:. Create a 3atrix -"er4 to /is2!a4 the Co1? the sa!ar4 0or that Co1 1ase/ o, /e2art3e,t ,"31er? a,/ the tota! sa!ar4 0or that Co1 0or a!! /e2art3e,ts? 5i#i,5 ea h o!"3, a, a22ro2riate hea/i,5. !he o t0 t is as follows / we need to stic& to this format : Vob De0t 1< ////////// /////////////// A%A)IS! 2)-RJ 1'<< MA%A+-R $13< HR-SID-%! 3<<< SA)-SMA% De0t $< ///////////// 4<<< 1;<< $;83 De0t '< !otal ///////////// ;3< $93< 34<< ///////// 4<<< 113< 9$83 3<<< 34<<

S-)-2! 6ob ,Vob,7 S.M CD-2:D- Cde0tno7 1<7 salDD ,De0t 1<,7 S.M CD-2:D- Cde0tno7 $<7 salDD ,De0t $<,7 S.M CD-2:D- Cde0tno7 '<7 salDD ,De0t '<,7 S.M CsalD ,!otal, ?R:M em0 +R:.H BI 6ob K Inde> &. : th To2 Sa!ar4 o0 a!! the e32!o4ees P

S-)-2! D-H!%:7 -%AM-7 SA) ?R:M -MH A W"-R' # CS-)-2! 2:.%!CB.SA)D ?R:M -MH B W"-R- A.SA) S B.SA)D :RD-R BI SA) D-S2K Inde> <. Retrie#i,5 the &th row 9RO) a ta1!e P S-)-2! D-H!%:7 -%AM-7 SA) ?R:M -MH W"-R- R:WID # CS-)-2! R:WID ?R:M -MH W"-R- R:W%.M S# 3 MI%.S S-)-2! R:WID ?R:M -MH W"-R- R:W%.M S 3D Inde> =. Tree Q"er4 P %ame % ll? !y0e /////////////////////////////////////////////////////////////////// S.B %:! %.)) BAR2"AR$C1D S.H-R BAR2"AR$C1D

HRI2-

%.MB-RC47$D

S-)-2! s b7 s 0er ?R:M 0arts 2:%%-2! BI HRI:R s b # s 0er S!AR! WI!" s b # F01FK Inde> '. E!i3i,ate /"2!i ates rows i, a ta1!e P D-)-!- ?R:M table5name A W"-R- R:WID T C S-)-2! minCR:WIDD ?R:M table5name B W"-R- A.col # B.colDK Inde> +. Dis2!a4i,5 E6ER* :th row i, a ta1!e P II0 a ta1!e has 1: rows? :?'?12 rows wi!! 1e se!e te/G S-)-2! G ?R:M em0 W"-R- CR:WID7<D I% CS-)-2! R:WID7 M:DCR:W%.M71D ?R:M em0DK Inde> 1.. To2 N rows 9RO) a ta1!e P IDis2!a4s to2 + sa!arie/ 2eo2!eG S-)-2! ename7 de0tno7 sal ?R:M CS-)-2! G ?R:M em0 :RD-R BI sal D-S2D W"-R- R:W%.M S 1<K Inde> 11. 7ow /oes o,e o",t@s"3 RAN>ES o0 /ata #a!"es i, a o!"3,% A #a!"e x wi!! 1e 1etwee, #a!"es 4 a,/ E i0 >REATESTIx? 4G W LEASTIx? EG. S-)-2! f$7 2:.%!CD-2:D-CgreatestCf173;D7 leastCf171<<D7 17 <DD ,Range 4</1<<,7 2:.%!CD-2:D-CgreatestCf17'<D7 leastCf17 3;D7 17 <DD ,Range '</3;,7 2:.%!CD-2:D-CgreatestCf17$;D7 leastCf17 <D7 17 <DD ,Range <</$;, ?R:M my5table +R:.H BI f$K Inde> 12. 9or e-"a! siEe ra,5es it 3i5th 1e easier to a! "!ate it with DECODEITRUNCI#a!"e@ra,5eG? .? rate;.? 1? rate;1? ...G. S-)-2! ename ,%ame,7 sal ,Salary,7 D-2:D-C !R.%2CsalL1<<<7 <D7 <7 <.<7 17 <.17 $7 <.$7 '7 <.'D ,!a> rate, ?R:M em0K 18. 7ow /oes o,e o",t /i00ere,t /ata #a!"es i, a o!"3,% 2:) %AMDA!A!IH//////////////////////////////////////// D%: %.MB-R S-E 2"AR S-)-2! dno7 S.MCD-2:D-Cse>7FMF717<DD MA)-7 S.MCD-2:D-Cse>7F?F717<DD ?-MA)-7

2:.%!CD-2:D-Cse>7FMF717F?F71DD !:!A) ?R:M t1 +R:.H BI dnoK Inde> 1:. Q"er4 to 5et the 2ro/" t o0 a!! the #a!"es o0 a o!"3, P S-)-2! -EHCS.MC)%Ccol1DDD ?R:M srin K Inde> 1&. Q"er4 to /is2!a4 o,!4 the /"2!i ate re or/s i, a ta1!eP S-)-2! n m ?R:M satyam +R:.H BI n m "ABI%+ 2:.%!CGD T 1K Inde> 1<. Q"er4 0or 5etti,5 the 0o!!owi,5 o"t2"t as 3a,4 ,"31er o0 rows i, the ta1!e P G GG GGG GGGG GGGGG S-)-2! RHADCD-2:D-Ctem07tem07FGFD7R:W%.M7FGFD ?R:M srin 1K Inde> 1=. 9", tio, 0or 5etti,5 the Ba!a, e 6a!"e P ?.%2!I:% ?5BA)A%2-5BA).C05b siness5gro 05id n mber7 050ayroll5action5id n mber7 05balance5name *archar$7 05dimension5name *archar$D R-!.R% %.MB-R IS l5bal n mberK l5defined5bal5id n mberK l5assignment5action5id n mberK B-+I% S-)-2! assignment5action5id I%!: l5assignment5action5id ?R:M 0ay5assignment5actions W"-Rassignment5id # :05assignment5id A%D 0ayroll5action5id # 050ayroll5action5idK S-)-2! defined5balance5id I%!: l5defined5bal5id ?R:M 0ay5balance5ty0es 0bt7 0ay5defined5balances 0db7 0ay5balance5dimensions 0bd W"-R0bt.b siness5gro 05id # 05b siness5gro 05id A%D .HH-RC0bt.balance5nameD # .HH-RC05balance5nameD A%D 0bt.b siness5gro 05id # 0db.b siness5gro 05id A%D 0bt.balance5ty0e5id # 0db.balance5ty0e5id A%D .HH-RC0bd.dimension5nameD # .HH-RC05dimension5nameD A%D 0db.balance5dimension5id # 0bd.balance5dimension5idK

l5bal :# 0ay5balance50&g.get5*al eCl5defined5bal5id7l5assignment5action5idDK R-!.R% Cl5balDK e>ce0tion W"-% no5data5fo nd !"-% R-!.R% <K -%DK Inde> 1'. 9", tio, 0or 5etti,5 the E!e3e,t 6a!"e P ?.%2!I:% f5element5*al eC 05classification5name in *archar$7 05element5name in *archar$7 05b siness5gro 05id in n mber7 05in0 t5*al e5name in *archar$7 050ayroll5action5id in n mber7 05assignment5id in n mber D R-!.R% n mber IS l5element5*al e n mberC117$D defa lt <K l5in0 t5*al e5id 0ay5in0 t5*al es5f.in0 t5*al e5idNty0eK l5element5ty0e5id 0ay5element5ty0es5f.element5ty0e5idNty0eK B-+I% S-)-2! DIS!I%2! element5ty0e5id I%!: l5element5ty0e5id ?R:M 0ay5element5ty0es5f 0et7 0ay5element5classifications 0ec W"-R- 0et.classification5id # 0ec.classification5id A%D 00erCclassification5nameD # 00erC05classification5nameD A%D 00erCelement5nameD # 00erC05element5nameD A%D 0et.b siness5gro 05id # 05b siness5gro 05idK S-)-2! in0 t5*al e5id I%!: l5in0 t5*al e5id ?R:M 0ay5in0 t5*al es5f W"-R- 00erCnameD # 00erC05in0 t5*al e5nameD A%D element5ty0e5id # l5element5ty0e5idK S-)-2! %B)C0rr*.res lt5*al e7<D I%!: l5element5*al e ?R:M 0ay5r n5res lt5*al es 0rr*7 0ay5r n5res lts 0rr7 0ay5assignment5actions 0aa W"-R- 0rr*.r n5res lt5id # 0rr.r n5res lt5id A%D 0rr.assignment5A2!I:%5ID # 0aa.assignment5action5id A%D 0aa.assignment5id # 05assignment5id A%D in0 t5*al e5id # l5in0 t5*al e5id A%D 0aa.0ayroll5action5id # 050ayroll5action5idK R-!.R% Cl5element5*al eDK e>ce0tion W"-% no5data5fo nd !"-% R-!.R% <K -%DK Inde> 1+. SELECT Q"er4 0or o",ti,5 No o0 wor/s P S-)-2! ename7 %B)C)-%+!"CR-H)A2-C!RA%S)A!-C.HH-RCR!RIMCenameDD7FAB2D-?+"IVJ)M%:H(RS!.BWEIUFF F7F [FD7F F7FFDDR171D word5length

?R:M em0K Ex2!a,atio, : !RA%S)A!-C.HH-RCR!RIMCenameDD7FAB2D-?+"IVJ)M%:H(RS!.BWEIUFF F7F [FD // !his will translate all the characters ?R:M A-D incl ding a si,5!e -"ote to a s2a e. It will also translate a s2a e to a _. R-H)A2-C!RA%S)A!-C.HH-RCR!RIMCenameDD7FAB2D-?+"IVJ)M%:H(RS!.BWEIUFF F7F F7FFD // !his will re0lace e#er4 s2a e with ,othi,5 in the abo*e res lt. )-%+!"CR-H)A2-C!RA%S)A!-C.HH-RCR!RIMCenameDD7FAB2D-?+"IVJ)M%:H(RS!.BWEIUFF F7F [FD7F F7FFDDR1 // !his will gi*e the co nt of _ characters in the abo*e res lt. Inde> 2.. 9", tio, to he $ 0or a !ea2 4ear P 2R-A!- :R R-H)A2- ?.%2!I:% is5lea05year C05date I% DA!-D R-!.R% BAR2"AR$ AS *5test DA!-K B-+I% *5test :# !:5DA!- CF$;/?eb/F \\ !:52"AR C05date7FIIIIFD7FDD/Mon/IIIIFDK R-!.R% FIFK -E2-H!I:% W"-% :!"-RS !"-% R-!.R% F%FK -%D is5lea05yearK S()T S-)-2! hiredate7 !:52"AR Chiredate7 FDayFD wee&day ?R:M em0 W"-R- is5lea05year ChiredateD # FIFK Inde> 21. Q"er4 0or re3o#i,5 a!! ,o,-,"3eri P S-)-2! !RA%S)A!-C):W-RCssnD7Fabcdefghi6&lmno0=rst *w>yM/ F7FFD ?R:M D.A)K Inde> 22. Q"er4 0or tra,s!ati,5 a o!"3, #a!"es to INITCA( P S-)-2! !RA%S)A!-CI%I!2AHCtem0D7 S.BS!RCtem07 I%S!RCtem07FFFFDR171D7 ):W-RCS.BS!RCtem07 I%S!RCtem07FFFFDR1DDD ?R:M srin 1K Inde> 28. 9", tio, 0or /is2!a4i,5 R"2ees i, Wor/s P 2R-A!- :R R-H)A2- ?.%2!I:% R.H--S5I%5W:RDSCamt I% %.MB-RD R-!.R% 2"AR IS amo nt %.MB-RC1<7$DK *5length I%!-+-R :# <K *5n m$ BAR2"AR$ C3<D :# %.))K *5amo nt BAR2"AR$ C3<DK *5word BAR2"AR$ C1<<<D :# %.))K *5word1 BAR2"AR$ C1<<<D :# %.))K !IH- myarray IS !AB)- :? BAR2"AR$ C$33DK *5str myarray :# myarray CF tho sand F7 F la&h F7 F crore F7 F arab F7 [FD7F

F &harab F7 F shan&h FDK B-+I% amo nt :# amtK I? CCamo nt # <D :R Camo nt IS %.))DD !"-% *5word :# FMeroFK -)SI? C!:52"AR Camo ntD )IJ- FN.NFD !"-% I? CS.BS!R Camo nt7 I%S!R Camo nt7 F.FD R 1D T <D !"-% *5n m$ :# S.BS!R Camo nt7 I%S!R Camo nt7 F.FD R 1DK I? C)-%+!" C*5n m$D S $D !"-% *5n m$ :# *5n m$ G 1<K -%D I?K *5word1 :# F A%D F \\ C!:52"AR C!:5DA!- CS.BS!R C*5n m$7 )-%+!" C*5n m$D / 17$D7 FVFD7 FVSHF DD\\ F 0aise FK *5amo nt :# S.BS!RCamo nt717I%S!R Camo nt7 F.FD/1DK *5word :# !:52"AR C!:5DA!- CS.BS!R C*5amo nt7 )-%+!" C*5amo ntD / $7'D7 FVFD7 FVs0F D \\ *5wordK *5amo nt :# S.BS!R C*5amo nt7 17 )-%+!" C*5amo ntD / 'DK ?:R i in 1 .. *5str.2:.%! )::H -EI! W"-% C*5amo nt IS %.))DK *5word :# !:52"AR C!:5DA!- CS.BS!R C*5amo nt7 )-%+!" C*5amo ntD / 17$D7 FVFD7 FVs0F D \\ *5str CiD \\ *5wordK *5amo nt :# S.BS!R C*5amo nt7 17 )-%+!" C*5amo ntD / $DK -%D )::HK -%D I?K -)S*5word :# !:52"AR C!:5DA!- CS.BS!R Camo nt7 )-%+!" Camo ntD / $7'D7 FVFD7 FVs0F DK amo nt :# S.BS!R Camo nt7 17 )-%+!" Camo ntD / 'DK ?:R i in 1 .. *5str.2:.%! )::H -EI! W"-% Camo nt IS %.))DK *5word :# !:52"AR C!:5DA!- CS.BS!R Camo nt7 )-%+!" Camo ntD / 17$D7 FVFD7 FVs0F D \\ *5str CiD \\ *5wordK amo nt :# S.BS!R Camo nt7 17 )-%+!" Camo ntD / $DK -%D )::HK -%D I?K *5word :# *5word \\ F F \\ *5word1 \\ F only FK *5word :# R-H)A2- CR!RIM C*5wordD7 F F7 F FDK *5word :# R-H)A2- CR!RIM C*5wordD7 F/F7 F FDK R-!.R% I%I!2AH C*5wordDK -%DK Inde> 2:. 9", tio, 0or /is2!a4i,5 N"31ers i, Wor/s: S-)-2! !:52"ARC !:5DA!-C S.BS!RC !:52"ARC3'8'191D71D7F6FD7FVs0FD ?R:M D.A)K :nly 0 to integers from 1 to 3'8'191 Inde> 2&. Q"er4 0or /e!eti,5 a!ter,ate e#e, rows 9RO) a ta1!e P D-)-!?R:M srin W"-R- CR:WID7<D I% CS-)-2! R:WID7 M:DCR:W%.M7$D ?R:M srin DK Inde> 2<. Q"er4 0or /e!eti,5 a!ter,ate o// rows 9RO) a ta1!e P D-)-!-

?R:M srin W"-R- CR:WID71D I% CS-)-2! R:WID7 M:DCR:W%.M7$D ?R:M srin DK Inde> 2=. (ro e/"re 0or se,/i,5 E3ai! P 2R-A!- :R R-H)A2- HR:2-D.R- Send5Mail IS sender BAR2"AR$C3<D :# Fsender[something.comFK reci0ient BAR2"AR$C3<D :# Freci0ient[something.comFK s b6ect BAR2"AR$C1<<D :# F!est MessageFK message BAR2"AR$C1<<<D :# F!his is a sam0le mail ....FK l*5mailhost BAR2"AR$C'<D :# F":!%!<<$FK l5mail5conn tl5smt0.connectionK l*5crlf BAR2"AR$C$D:# 2"RC 1' D \\ 2"RC 1< DK B-+I% l5mail5conn :# tl5smt0.o0en5connection Cl*5mailhost7 9<DK tl5smt0.helo C l5mail5conn7 l*5mailhostDK tl5smt0.mail C l5mail5conn7 senderDK tl5smt0.rc0t C l5mail5conn7 reci0ientDK tl5smt0.o0en5data Cl5mail5connDK tl5smt0.write5data C l5mail5conn7 F?R:M: F \\ sender \\ l*5crlfDK tl5smt0.write5data C l5mail5conn7 F!o: F \\ reci0ient \\ l*5crlfDK tl5smt0.write5data C l5mail5conn7 FS b6ect:F \\ s b6ect \\ l*5crlfDK tl5smt0.write5data C l5mail5conn7 l*5crlf \\ messageDK tl5smt0.close5dataCl5mail5connDK tl5smt0.= itCl5mail5connDK -E2-H!I:% W"-% :!"-RS !"-% DBMS5:.!H.!.H.!5)I%-CF-rrorFDK -%DK L Inde> 2'. A!ter,ate Q"er4 0or DECODE 0", tio, P S-)-2! case W"-% se> # FmF !"-% FmaleF W"-% se> # FfF !"-% FfemaleF -)S- F n&nownF -%D ?R:M mytableK Inde> 2+. Create ta1!e a//i,5 Co,strai,t to a /ate 0ie!/ to S*SDATE or 8 3o,ths !aterP 2R-A!- !AB)- srin Cdt1 date D-?A.)! SISDA!-7 dt$ date7 2:%S!RAI%! chec&5dt$ 2"-2J CCdt$ T# dt1D A%D Cdt$ S# ADD5M:%!"SCSISDA!-7'DDDK Inde> 8.. Q"er4 to !ist a!! the s"22!iers who s"22!4 a!! the 2arts s"22!ie/ 14 s"22!ier AS2A P S-)-2! DIS!I%2! a.S.HH ?R:M :RD-RS a W"-R- a.s 00 W# FS$F A%D a.0arts I% CS-)-2! DIS!I%2! HAR!S ?R:M :RD-RS W"-R- s 00 # FS$FD +R:.H BI a.S.HH "ABI%+ 2:.%!CDIS!I%2! a.HAR!SD T# CS-)-2! 2:.%!CDIS!I%2! HAR!SD ?R:M :RD-RS W"-R- s 00 # FS$FDK

!able : orders S.HH HAR!S //////////////////// /////// S1 H1 S1 H$ S1 H' S1 H1 S1 H3 S1 H4 S$ H1 S$ H$ S' H$ S1 H$ S1 H1 S1 H3 Inde> 81. Q"er4 to 5et the !ast S",/a4 o0 a,4 3o,th P S-)-2! %-E!5DAIC)AS!5DAIC!:5DA!-CF$4/1</$<<1F7FDD/MM/IIIIFDD / 87Fs ndayFD ?R:M D.A)K Inde> 82. Q"er4 to 5et a!! those who ha#e ,o hi!/re, the3se!#es P table data : id name 0arent5id /////////////////////////////// 1 a %.)) / the to0 le*el entry $ b 1 / a child of 1 ' c 1 1 d $ / a child of $ 3 e $ 4 f ' 8 g ' 9 h 1 ; i 9 1< 6 ; S-)-2! ID ?R:M MI5!ABlW"-R- HAR-%!5ID IS %:! %.)) MI%.S S-)-2! HAR-%!5ID ?R:M MI5!ABl-K Inde> 88. Q"er4 to SELECT !ast N rows 9RO) a ta1!e P S-)-2! em0no ?R:M em0 W"-R- R:WID in CS-)-2! R:WID ?R:M em0 MI%.S S-)-2! R:WID ?R:M em0 W"-R- R:W%.M S# CS-)-2! 2:.%!CGD/3 ?R:M em0DDK Inde> 8:. SELECT with #aria1!esP 2R-A!- :R R-H)A2- HR:2-D.R- dis0 AS >!able%ame *archar$C$3D:#Fem0FK >?ield%ame *archar$C$3D:#FenameFK

>Bal e %.MB-RK >( ery *archar$C1<<DK name *archar$C1<D :# F2)ARJFK B-+I% >( ery :# FS-)-2! SA) ?R:M F \\ >!able%ame \\ F W"-R- F \\ >?ield%ame \\ F # FFF \\ name \\ FFFFK DBMS5:.!H.!.H.!5)I%-C>( eryDK -E-2.!- IMM-DIA!- >( ery I%!: >Bal eK DBMS5:.!H.!.H.!5)I%-C>Bal eDK -%DK Inde> 8&. Q"er4 to 5et the DB Na3eP S-)-2! name ?R:M *YdatabaseK Inde> 8<. >etti,5 the "rre,t /e0a"!t s he3a P S-)-2! SIS52:%!-E!CF.S-R-%BF7F2.RR-%!5S2"-MAFD ?R:M D.A)K Inde> 8=. Q"er4 to 5et a!! the o!"3, ,a3es o0 a 2arti "!ar ta1!e P S-)-2! col mn5name ?R:M all5tab5col mns W"-R- !AB)-5%AM- # F:RD-RSFK Inde> 8'. 7ow /o I s2oo! o,!4 the -"er4 res"!t to a 0i!e i, SQL(LUS P Hlace the following lines of code in a file and e>ec te the file in S()H).S : set heading off set feedbac& off set colse0 F F set termo t off set *erify off s0ool c:Osrini.t>t S-)-2! em0no7ename ?R:M em0K LG Write yo r ( ery here GL s0ool off L Inde> 8+. Q"er4 0or 5etti,5 the "rre,t Sessio,ID P S-)-2! SIS52:%!-E!CF.S-R-%BF7FS-SSI:%IDFD Session5ID ?R:M D.A)K Inde> :.. Q"er4 to /is2!a4 rows 9RO) 3 to , P To /is2!a4 rows & to = P S-)-2! D-H!%:7 -%AM-7 SA) ?R:M -MH W"-R- R:WID I% CS-)-2! R:WID ?R:M -MH W"-R- R:W%.M S# 8 MI%.S

S-)-2! R:WID ?R:M -MH W"-R- R:W%.M S 3DK OR S-)-2! ename ?R:M em0 +R:.H BI R:W%.M7 ename "ABI%+ R:W%.M T 1 and R:W%.M S 'K Inde> :1. Q"er4 to o",t ,o. O0 o!"3,s i, a ta1!eP S-)-2! 2:.%!Ccol mn5nameD ?R:M ser5tab5col mns W"-R- table5name # FMI!AB)-FK Inde> :2. (ro e/"re to i, rease the 1"00er !e,5th P /13s;o"t2"t.e,a1!eI:...GY LGallows the o t0 t b ffer to be increased to the s0ecified n mber of bytes GL D-2)ARB-+I% /13s;o"t2"t.e,a1!eI:...GY ?:R i I% 1..1<< )::H DBMS5:.!H.!.H.!5)I%-CiDK -%D )::HK -%DK L Inde> :8. I,serti,5 a, J s431o! i, a 6ar har2 o!"3, P Set the following to some other character. By defa lt it is &. set define FZF Inde> ::. 7ow /o 4o" re3o#e Trai!i,5 1!a,$s i, a s2oo!e/ 0i!e P Cha,5e the E,#iro,3e,t O2tio,s Li$e this P set tri3s2oo! o, set tri3o"t o, Inde> :&. Sa32!es 0or exe "ti,5 D4,a3i SQL State3e,ts P Sa32!e P1 2R-A!- :R R-H)A2- HR:2-D.R- 2%!CH5!AB)-5%AM- I% BAR2"AR$D AS S=lString BAR2"AR$C$<<DK tot n mberK B-+I% S=lString:#FS-)-2! 2:.%!CGD ?R:M F\\ H5!AB)-5%AM-K -E-2.!- IMM-DIA!- S=lString I%!: totK DBMS5:.!H.!.H.!5)I%-CF!otal %o.:f Records In F \\ H5!AB)-5%AM- \\ F AR-#F \\ totDK -%DK Sa32!e P2

D-2)ARs=l5stmt BAR2"AR$C$<<DK 0ls=l5bloc& BAR2"AR$C3<<DK em05id %.MB-RC1D :# 8344K salary %.MB-RC87$DK de0t5id %.MB-RC$D :# 3<K de0t5name BAR2"AR$C11D :# @H-RS:%%-)@K location BAR2"AR$C1'D :# @DA))AS@K em05rec em0NR:W!IH-K B-+I% -E-2.!- IMM-DIA!- F2R-A!- !AB)- bon s Cid %.MB-R7 amt %.MB-RDFK s=l5stmt :# FI%S-R! I%!: de0t BA).-S C:17 :$7 :'DFK -E-2.!- IMM-DIA!- s=l5stmt .SI%+ de0t5id7 de0t5name7 locationK s=l5stmt :# FS-)-2! G ?R:M em0 W"-R- em0no # :idFK -E-2.!- IMM-DIA!- s=l5stmt I%!: em05rec .SI%+ em05idK 0ls=l5bloc& :# FB-+I% em050&g.raise5salaryC:id7 :amtDK -%DKFK -E-2.!- IMM-DIA!- 0ls=l5bloc& .SI%+ 88997 3<<K s=l5stmt :# F.HDA!- em0 S-! sal # $<<< W"-R- em0no # :1 R-!.R%I%+ sal I%!: :$FK -E-2.!- IMM-DIA!- s=l5stmt .SI%+ em05id R-!.R%I%+ I%!: salaryK -E-2.!- IMM-DIA!- FD-)-!- ?R:M de0t W"-R- de0tno # :n mF .SI%+ de0t5idK -E-2.!- IMM-DIA!- @A)!-R S-SSI:% S-! S()5!RA2- !R.-@K -%DK Sa32!e 8 2R-A!- :R R-H)A2- HR:2-D.R- D-HAR!M-%!SC%: I% D-H!.D-H!%:N!IH-D AS *5c rsor integerK *5dname charC$<DK *5rows integerK B-+I% *5c rsor :# DBMS5S().:H-%52.RS:RK DBMS5S().HARS-C*5c rsor7 Fselect dname from de0t where de0tno T :>F7 DBMS5S().B8DK DBMS5S().BI%D5BARIAB)-C*5c rsor7 F:>F7 noDK DBMS5S().D-?I%-52:).M%52"ARC*5c rsor7 17 *5dname7 $<DK *5rows :# DBMS5S().-E-2.!-C*5c rsorDK )::H I? DBMS5S().?-!2"5R:WSC*5c rsorD # < !"-% -EI!K -%D I?K DBMS5S().2:).M%5BA).-52"ARC*5c rsor7 17 *5dnameDK DBMS5:.!H.!.H.!5)I%-CFDe0tartment name: F\\*5dnameDK -%D )::HK DBMS5S().2):S-52.RS:RC*5c rsorDK -E2-H!I:% W"-% :!"-RS !"-% DBMS5S().2):S-52.RS:RC*5c rsorDK raise5a00lication5errorC/$<<<<7 F.n&nown ->ce0tion Raised: F\\s=lcode\\F F\\s=lerrmDK -%DK Inde> :<.Di00ere, es 1etwee, SQL a,/ )S-A ess P

Di00ere, e 1P :racle : select name from table1 where name li&e F&NFK Access: select name from table1 where name li&e F&GFK Di00ere, e 2P Access: S-)-2! !:H $ name ?R:M !able1K :racle : will not wor& there is no s ch !:H &ey word.

Inde> :=. Q"er4 to /is2!a4 a!! the hi!/re,? s"1 hi!/re, o0 a 2are,t P S-)-2! organiMation5id7name ?R:M hr5all5organiMation5 nits W"-R- organiMation5id in C S-)-2! :R+A%IUA!I:%5ID52"I)D ?R:M H-R5:R+5S!R.2!.R-5-)-M-%!S 2:%%-2! BI HRI:R :R+A%IUA!I:%5ID52"I)D # :R+A%IUA!I:%5ID5HAR-%! S!AR! WI!" :R+A%IUA!I:%5ID52"I)D # CS-)-2! organiMation5id ?R:M hr5all5organiMation5 nits W"-R- name # F-B+ 2or0orate +ro 0FDDK Inde> :'. (ro e/"re to rea/@write /ata 0ro3 a text 0i!e P 2R-A!- :R R-H)A2- HR:2-D.R- read5data AS c50ath *archar$C1<<D :# FL srLtm0FK c5file5name *archar$C$<D :# F-J+S-H<1.2SBFK *5file5id tl5file.file5ty0eK *5b ffer *archar$C1<$$D :# !his is a sam0le te>t@K B-+I% *5file5id :# .!)5?I)-.?:H-%Cc50ath7c5file5name7FwFDK .!)5?I)-.H.!5)I%-C*5file5id7 *5b fferDK .!)5?I)-.?2):S-C*5file5idDK *5file5id :# .!)5?I)-.?:H-%Cc50ath7c5file5name7FrFDK .!)5?I)-.+-!5)I%-C*5file5id7 *5b fferDK DBMS5:.!H.!.H.!5)I%-C*5b fferDK .!)5?I)-.?2):S-C*5file5idDK -%DK L Inde> :+. Q"er4 to /is2!a4 ra,/o3 ,"31er 1etwee, a,4 two 5i#e, ,"31ers P S-)-2! DBMS5RA%D:M.BA).- C17$D ?R:M D.A)K Inde> &.. 7ow a, I 5et the ti3e /i00ere, e 1etwee, two /ate o!"3,s P S-)-2! ?)::RCCdate1/date$DG$1G4<G4<DL'4<<D \\ F ":.RS F \\ ?)::RCCCCdate1/date$DG$1G4<G4<D / ?)::RCCCdate1/date$DG$1G4<G4<DL'4<<DG'4<<DL4<D \\ F MI%.!-S F \\ R:.%DCCCCdate1/date$DG$1G4<G4<D / ?)::RCCCdate1/date$DG$1G4<G4<DL'4<<DG'4<< / C?)::RCCCCdate1/date$DG$1G4<G4<D / ?)::RCCCdate1/date$DG$1G4<G4<DL'4<<DG'4<<DL4<DG4<DDD \\ F S-2S F time5difference ?R:M my5tableK Inde> &1. Usi,5 INSTR a,/ SUBSTR I ha*e this string in a col mn named location

):! 9 2:%2' RR .sing instr and s bstr7 I want to ta&e whate*er *al e follows ):! and 0 t it into a different col mn and whate*er *al e follows 2:%2 and 0 t it into a different col mn select s bstrCF):! 9 2:%2' RRF717instrCF):! 9 2:%2' RRF7F2:%2FD/1D from d alK select s bstrCF):! 9 2:%2' RRF7/ClengthCF):! 9 2:%2' RRFD/CinstrCF):! 9 2:%2' RRF7F2:%2FDR'DDD from d al Inde> &2. 6iew 2ro e/"re o/e select te>t from all5so rce where name # FEF order by lineK select te>t from ser5so rce where name # FEF select te>t from ser5so rce where ty0e # F0roced reF and name#F0roced re5nameFK select name7te>t from dba5so rce where name#F r50roced reF and owner#FscottFK Inde> &8. To o,#ert si5,e/ ,"31er to ,"31er i, ora !e select to5n mberCF/;;;7;;;.;;F7 Fs;;;7;;;.;;FD from d alK select to5n mberCFR<71$'.13F7 Fs;;;7;;;7;;;.;;FD from d alK select to5n mberCFR;;;7;;;.;;F7 Fs;;;7;;;.;;FD from d alK Inde> &:. Co!"3,s o0 a ta1!e select col select col select col select col Inde> &&. De!ete rows o,/itio,a!!4 I ha*e a table ha*e a7b7c field7 a7b sho ld be ni= e7 and lea*e ma>CcD row in. "ow can I delete other rows? delete from FtableF where Ca7b7cD not in Cselect a7b7ma>CcD from FtableF gro 0 by a7bDK Inde> &<. CLOB to Char 1D !his f nction hel0s if yo r clob col mn *al e not e>ceed 1<<< bytes C*archar$ limitD.if clob col mnFs data e>ceeds 1<<< limit7 yo ha*e to follow different a00roach. create or re0lace f nction lob5to5charCclob5col clobD ret rn *archar$ IS b ffer *archar$C1<<<DK amt BI%ARI5I%!-+-R :# 1<<<K 0os I%!-+-R :# 1K mn5name from ser5tab5col mns where !AB)-5%AM- # F-MHF mn5name from all5tab5col mns where !AB)-5%AM- # F-MHF mn5name from dba5tab5col mns where !AB)-5%AM- # F-MHF mn5name from cols where !AB)-5%AM- # F-MHF /;;;7;;;.;; 1$'.13 ;;;7;;;.;;

l clobK bfils bfileK l5*ar *archar$C1<<<D:#FFK begin )::H if dbms5lob.getlengthCclob5colDS#1<<< !"-% dbms5lob.read Cclob5col7 amt7 0os7 b fferDK l5*ar :# l5*ar\\b fferK 0os:#0osRamtK -)Sl5*ar:# F2annot con*ert to *archar$..->ceeding *archar$ field limitFK e>itK -%D I?K -%D )::HK ret rn l5*arK -E2-H!I:% W"-% %:5DA!A5?:.%D !"-% ret rn l5*arK -%DK $D 2R-A!- +):BA) !-MH:RARI !AB)- tem05tabCid n mber7*archar5col *archar$C1<<<DDK S()T *ar r refc rsor S()T e>ec lob0&g.lob5to5charC:rDK S()T 0rint r create or re0lace 0ac&age lob0&g is ty0e ref1 is ref c rsorK n n mber:#<K HR:2-D.R- lob5to5charCr*ar I% :.! lob0&g.ref1D K endK L create or re0lace 0ac&age body lob0&g is HR:2-D.R- lob5to5charCr*ar I% :.! lob0&g.ref1D IS b ffer *archar$C1<<<DK amt BI%ARI5I%!-+-R :# 1<<<K 0os I%!-+-R :# 1K l clobK r lob0&g.ref1K bfils bfileK l5*ar *archar$C1<<<D:#FFK 2.RS:R 21 IS S-)-2! G ?R:M clob5tabK // change clob5tab to yo r5table5name begin n:#nR1K ?:R crec I% c1 )::H amt:#1<<<K 0os:#1K B-+I% )::H //change crec.clob5col to crec.yo r5col mn5name dbms5lob.read Ccrec.clob5col7 amt7 0os7 b fferDK //change ne>t line if yo create tem0orary table with different name insert into tem05tab *al es Cn7b fferDK 0os:#0osRamtK -%D )::HK

-E2-H!I:% W"-% %:5DA!A5?:.%D !"-% %.))K -%DK -%D )::HK //change ne>t line if yo create tem0orary table with different name o0en r*ar for select *char from tem05tab where id#nK -%DK -%DK Inde> &=. Cha,5e Setti,5s :0en file oracle5homeO0l s'$Oglogin.s=l and add this set linesiMe 1<< set 0agewidth $< and sa*e the file and e>it from s=l and reload then it will set it. Inde> &'. Do"1!e -"oti,5 a Si,5!e -"ote/ Stri,5 declare // we need one here to get a single = ote into the *ariable *5str *archar$ C$<D :# F:FFreillyFFsFK begin DBMS5:.!H.!.H.!5)I%- C Foriginal single = oted *5str# F \\ *5str DK *5str :# re0laceC*5str7 FFFF7 FFFFFFDK DBMS5:.!H.!.H.!5)I%- C Fafter do ble = oted *5str# F \\ *5str DK endK S()T L original single = oted *5str# :FreillyFs after do ble = oted *5str# :FFreillyFFs Inde> &+. Ti3e Co,#ersio, 2R-A!- :R R-H)A2- ?.%2!I:% to5hms Ci5days I% n mberD R-!.R% *archar$ IS B-+I% R-!.R% !:52"AR C!R.%2 Ci5daysDD &`1$1&`1$1 F days F &`1$1&`1$1 !:52"AR C!R.%2 CSISDA!-D R M:D Ci5days7 1D7 F""$1:MI:SSFDK -%D to5hmsK select to5hmsCto5dateCF18/Van/$<<$ 1':$<:$<F7 Fdd/Mon/yyyy hh$1:mi:ssFD / to5dateCF11/Van/$<<$ 11:<3:<3F7 Fdd/Mon/yyyy hh$1:mi:ssFDD from d alK Inde> <.. Ta1!e o32ariso, !he table in both the schemas sho ld ha*e e>actly the same str ct re. !he data in it co ld be same or different a/b and b/a select G from a.a min s select G from b.a and select G from b.a min s select G from a.a

Inde> <1. R",,i,5 Qo1s select G from ser56obsK e>ec dbms56ob.remo*eC6ob5noDK Inde> <2. Swit hi,5 Co!"3,s .0date tblname Set col mn1 # col mn$7 2ol mn$ # col mn1K Inde> <8. Re2!a e a,/ Ro",/ I ha*e the n mber e.g. 4'7;9$'981<1$;9' and I want to ro nd it to 4'7;9 and at the same time change the 7 to a . select ro ndCre0laceCF4'7;9$'981<1$;9'F7F7F7F.FD7$D from d alK Inde> <:. 9irst /ate o0 the 4ear select tr ncCsysdate7 FyFD from d alK <1/6an/$<<$ last year this month thro gh a select statement select add5monthsCsysdate7 /1$D from d alK <3/AHR/<1 Inde> <&. Create Se-"e, e create se= ence sh increment by 1 start with <K Inde>

<<. C"rsors c rsor is someting li&e 0ointers in 2 lang age. fetch the data sing c rsor.C wiM...store it somewhere tem0orarilyD. can do any mani0 lation to the data that is fetched by the c rsor. li&e trim7 0add7 concat or *alidate. all this are done in tem0orary areas called as conte>t area or the c rsor area. can insert this data again in some other table or do anything wantWW...li&e setting 0 some flags etc. . can dis0lay the contents of c rsor sing the dbms5o t0 t only. . can create an anonymo s 0ls=l bloc& or a stored 0roced re. the ma6or ad*antage of c rsors is that yo can fetch more thatn one row and can loo0 thro gh the res ltset and do the man 0 lations in a sec re manner. set ser*ero t0 t onK declare c rsor c1 is select G from em0K begin for *ar in c1 loo0 e>it when c1Nnotfo ndK dbms5o t0 t.0 t5lineCFthe em0loyeeF &`1$1&`1$1 *ar.ename &`1$1&`1$1Fdraws a salary of F&`1$1&`1$1 *ar.salDK end loo0K endK

Inde> <=. C"rre,t Wee$ select ne>t5dayCsysdate/87FS.%DAIFD7 ne>t5dayCsysdate7FSA!.RDAIFD from d alK %-E!5DAIC %-E!5DAIC ///////// ///////// <8/AHR/<$ 1'/AHR/<$ Inde> I,ter#iew Q"estio,s 0or Ora !e? DBA? De#e!o2er Ca,/i/ates PL&SQL Q'e%ti$n%( 1. Des ri1e the /i00ere, e 1etwee, a 2ro e/"re? 0", tio, a,/ a,o,43o"s 2!@s-! 1!o $. )e*el: )ow Ex2e te/ a,swer P 2andidate sho ld mention se of D-2)AR- statement7 a f nction m st ret rn a *al e while a 0roced re doesn@t ha*e to. 2. What is a 3"tati,5 ta1!e error a,/ how a, 4o" 5et aro",/ it% )e*el: Intermediate Ex2e te/ a,swerP !his ha00ens with triggers. It occ rs beca se the trigger is trying to 0date a row it is c rrently sing. !he s al fi> in*ol*es either se of *iews or tem0orary tables so the database is selecting from one while 0dating the other. 8. Des ri1e the "se o0 UROWT*(E a,/ UT*(E i, (L@SQL )e*el: )ow Ex2e te/ a,swerP NR:W!IH- allows yo to associate a *ariable with an entire table row. !he N!IH- associates a *ariable with a single col mn ty0e. :. What 2a $a5es Ii0 a,4G has Ora !e 2ro#i/e/ 0or "se 14 /e#e!o2ers% )e*el: Intermediate to high Ex2e te/ a,swerP :racle 0ro*ides the DBMS5 series of 0ac&ages. !here are many which de*elo0ers sho ld be aware of s ch as DBMS5S()7 DBMS5HIH-7 DBMS5!RA%SA2!I:%7 DBMS5):2J7 DBMS5A)-R!7 DBMS5:.!H.!7 DBMS5V:B7 DBMS5.!I)I!I7 DBMS5DD)7 .!)5?I)-. If they can mention a few of these and describe how they sed them7 e*en better. If they incl de the S() ro tines 0ro*ided by :racle7 great7 b t not really what was as&ed. &. Des ri1e the "se o0 (L@SQL ta1!es )e*el: Intermediate Ex2e te/ a,swerP H)LS() tables are scalar arrays that can be referenced by a binary integer. !hey can be sed to hold *al es for se in later = eries or calc lations. In :racle 9 they will be able to be of the NR:W!IH- designation7 or R-2:RD. <. Whe, is a /e !are state3e,t ,ee/e/% )e*el: )ow !he D-2)AR- statement is sed in H)LS() anonymo s bloc&s s ch as with stand alone7 non/stored H)LS() 0roced res. It m st come first in a H)LS() stand alone file if it is sed. =. I, what or/er sho"!/ a o2e,@0et h@!oo2 set o0 o33a,/s i, a (L@SQL 1!o $ 1e i32!e3e,te/ i0 4o" "se the UNOT9OUND "rsor #aria1!e i, the exit whe, state3e,t% Wh4% )e*el: Intermediate Ex2e te/ a,swerP :H-% then ?-!2" then )::H followed by the e>it when. If not s0ecified in this order will res lt in the final ret rn being done twice beca se of the way the N%:!?:.%D is handled by H)LS(). '. What are SQLCODE a,/ SQLERR) a,/ wh4 are the4 i32orta,t 0or (L@SQL /e#e!o2ers% )e*el: Intermediate Ex2e te/ a,swerP S()2:D- ret rns the *al e of the error n mber for the last error enco ntered. !he S()-RRM ret rns the act al error message for the last error enco ntered. !hey can be sed in e>ce0tion handling to re0ort7 or7 store in an error log table7 the error that occ rred in the code. !hese are es0ecially sef l for the W"-% :!"-RS e>ce0tion.

+. 7ow a, 4o" 0i,/ withi, a (L@SQL 1!o $? i0 a "rsor is o2e,% )e*el: )ow Ex2e te/ a,swerP .se the NIS:H-% c rsor stat s *ariable. 1.. 7ow a, 4o" 5e,erate /e1"55i,5 o"t2"t 0ro3 (L@SQL% )e*el:Intermediate to high Ex2e te/ a,swerP .se the DBMS5:.!H.! 0ac&age. Another 0ossible method is to 6 st se the S":W -RR:R command7 b t this only shows errors. !he DBMS5:.!H.! 0ac&age can be sed to show intermediate res lts from loo0s and the stat s of *ariables as the 0roced re is e>ec ted. !he new 0ac&age .!)5?I)- can also be sed. 11. What are the t42es o0 tri55ers% )e*el:Intermediate to high Ex2e te/ a,swerP !here are 1$ ty0es of triggers in H)LS() that consist of combinations of the B-?:R-7 A?!-R7 R:W7 !AB)-7 I%S-R!7 .HDA!-7 D-)-!- and A)) &ey words: B-?:R- A)) R:W I%S-R! A?!-R A)) R:W I%S-R! B-?:R- I%S-R! A?!-R I%S-R! etc. DBA 1. >i#e o,e 3etho/ 0or tra,s0erri,5 a ta1!e 0ro3 o,e s he3a to a,otherP )e*el:Intermediate Ex2e te/ a,swerP!here are se*eral 0ossible methods7 e>0ort/im0ort7 2R-A!- !AB)-... AS S-)-2!7 or 2:HI. 2. What is the 2"r2ose o0 the I)(ORT o2tio, I>NORE% What is itHs /e0a"!t setti,5% )e*el: )ow Ex2e te/ a,swerP !he IMH:R! I+%:R- o0tion tells im0ort to ignore ,already e>ists, errors. If it is not s0ecified the tables that already e>ist will be s&i00ed. If it is s0ecified7 the error is ignored and the tables data will be inserted. !he defa lt *al e is %. 8. *o" ha#e a ro!!1a $ se53e,t i, a #ersio, =.2 /ata1ase that has ex2a,/e/ 1e4o,/ o2ti3a!? how a, it 1e restore/ to o2ti3a!% )e*el: )ow Ex2e te/ a,swerP .se the A)!-R !AB)-SHA2- ..... S"RI%J command.

:. I0 the DE9AULT a,/ TE)(ORAR* ta1!es2a e !a"ses are !e0t o"t o0 a CREATE USER o33a,/ what ha22e,s% Is this 1a/ or 5oo/% Wh4% )e*el: )ow Ex2e te/ a,swerP!he ser is assigned the SIS!-M tables0ace as a defa lt and tem0orary tables0ace. !his is bad beca se it ca ses ser ob6ects and tem0orary segments to be 0laced into the SIS!-M tables0ace res lting in fragmentation and im0ro0er table 0lacement Conly data dictionary ob6ects and the system rollbac& segment sho ld be in SIS!-MD. &. What are so3e o0 the Ora !e 2ro#i/e/ 2a $a5es that DBAs sho"!/ 1e aware o0% )e*el: Intermediate to "igh Ex2e te/ a,swerP :racle 0ro*ides a n mber of 0ac&ages in the form of the DBMS5 0ac&ages owned by the SIS ser. !he 0ac&ages sed by DBAs may incl de: DBMS5S"AR-D5H::)7 DBMS5.!I)I!I7 DBMS5S()7 DBMS5DD)7 DBMS5S-SSI:%7 DBMS5:.!H.! and DBMS5S%AHS":!. !hey may also try to answer with the .!)G.S() or 2A!G.S() series of S() 0roced res. !hese can be *iewed as e>tra credit b t aren@t 0art of the answer. <. What ha22e,s i0 the o,strai,t ,a3e is !e0t o"t o0 a o,strai,t !a"se% )e*el: )ow Ex2e te/ a,swerP!he :racle system will se the defa lt name of SIS52>>>> where >>>> is a system generated n mber. !his is bad since it ma&es trac&ing which table the constraint belongs to or what the constraint does harder. =. What ha22e,s i0 a ta1!es2a e !a"se is !e0t o00 o0 a 2ri3ar4 $e4 o,strai,t !a"se% )e*el: )ow Ex2e te/ a,swerP !his res lts in the inde> that is a tomatically generated being 0laced in then sers defa lt tables0ace. Since this will s ally be the same tables0ace as the table is being created in7 this can ca se serio s 0erformance 0roblems. '. What is the 2ro2er 3etho/ 0or /isa1!i,5 a,/ re-e,a1!i,5 a 2ri3ar4 $e4 o,strai,t% )e*el: Intermediate Ex2e te/ a,swerP Io se the A)!-R !AB)- command for both. "owe*er7 for the enable cla se yo m st s0ecify the .SI%+ I%D-E and !AB)-SHA2- cla se for 0rimary &eys.

+. What ha22e,s i0 a 2ri3ar4 $e4 o,strai,t is /isa1!e/ a,/ the, e,a1!e/ witho"t 0"!!4 s2e i04i,5 the i,/ex !a"se% )e*el: Intermediate Ex2e te/ a,swerP !he inde> is created in the ser@s defa lt tables0ace and all siMing information is lost. :racle doesn@t store this information as a 0art of the constraint definition7 b t only as 0art of the inde> definition7 when the constraint was disabled the inde> was dro00ed and the information is gone. 1.. IO, UNIFG Whe, sho"!/ 3ore tha, o,e DB writer 2ro ess 1e "se/% 7ow 3a,4 sho"!/ 1e "se/% )e*el: "igh Ex2e te/ a,swerPIf the .%IE system being sed is ca0able of asynchrono s I: then only one is re= ired7 if the system is not ca0able of asynchrono s I: then 0 to twice the n mber of dis&s sed by :racle n mber of DB writers sho ld be s0ecified by se of the db5writers initialiMation 0arameter. 11. *o" are "si,5 hot 1a $"2 witho"t 1ei,5 i, ar hi#e!o5 3o/e? a, 4o" re o#er i, the e#e,t o0 a 0ai!"re% Wh4 or wh4 ,ot% )e*el: "igh Ex2e te/ a,swerPIo can@t se hot bac& 0 witho t being in archi*elog mode. So no7 yo co ldn@t reco*er. 12. What a"ses the Ks,a2shot too o!/K error% 7ow a, this 1e 2re#e,te/ or 3iti5ate/% )e*el: Intermediate Ex2e te/ a,swerP !his is ca sed by large or long r nning transactions that ha*e either wra00ed onto their own rollbac& s0ace or ha*e had another transaction write on 0art of their rollbac& s0ace. !his can be 0re*ented or mitigated by brea&ing the transaction into a set of smaller transactions or increasing the siMe of the rollbac& segments and their e>tents. 18. 7ow a, 4o" te!! i0 a /ata1ase o1Ce t is i,#a!i/% )e*el: )ow Ex2e te/ a,swerP By chec&ing the stat s col mn of the DBA57 A))5 or .S-R5:BV-2!S *iews7 de0ending 0on whether yo own or only ha*e 0ermission on the *iew or are sing a DBA acco nt. 1:. A "ser is 5etti,5 a, ORA-..+:2 error 4et 4o" $,ow 4o" ha#e 5ra,te/ the3 2er3issio, o, the ta1!e? what e!se sho"!/ 4o" he $% )e*el: )ow Ex2e te/ a,swerP Io need to chec& that the ser has s0ecified the f ll name of the ob6ect Cselect em0id from scott.em0K instead of select em0id from em0KD or has a synonym that 0oints to the ob6ect Ccreate synonym em0 for scott.em0KD 1&. A /e#e!o2er is tr4i,5 to reate a #iew a,/ the /ata1ase wo,Ht !et hi3. 7e has the KDE6ELO(ERK ro!e whi h has the KCREATE 6IEWK s4ste3 2ri#i!e5e a,/ SELECT 5ra,ts o, the ta1!es he is "si,5? what is the 2ro1!e3% )e*el: Intermediate Ex2e te/ a,swerP Io need to *erify the de*elo0er has direct grants on all tables sed in the *iew. Io can@t create a stored ob6ect with grants gi*en thro gh *iews. 1<. I0 4o" ha#e a, exa32!e ta1!e? what is the 1est wa4 to 5et siEi,5 /ata 0or the 2ro/" tio, ta1!e i32!e3e,tatio,% )e*el: Intermediate Ex2e te/ a,swerP !he best way is to analyMe the table and then se the data 0ro*ided in the DBA5!AB)-S *iew to get the a*erage row length and other 0ertinent data for the calc lation. !he = ic& and dirty way is to loo& at the n mber of bloc&s the table is act ally sing and ratio the n mber of rows in the table to its n mber of bloc&s against the n mber of e>0ected rows. 1=. 7ow a, 4o" 0i,/ o"t how 3a,4 "sers are "rre,t!4 !o55e/ i,to the /ata1ase% 7ow a, 4o" 0i,/ their o2erati,5 s4ste3 i/% )e*el: high Ex2e te/ a,swerP !here are se*eral ways. :ne is to loo& at the *Ysession or *Y0rocess *iews. Another way is to chec& the c rrent5logins 0arameter in the *Ysysstat *iew. Another if yo are on .%IE is to do a ,0s /ef\gre0 oracle\wc /l@ command7 b t this only wor&s against a single instance installation. 1'. A "ser se!e ts 0ro3 a se-"e, e a,/ 5ets 1a $ two #a!"es? his se!e t isP SELECT 2$;se-.,ext#a! 9RO) /"a!Y What is the 2ro1!e3% )e*el: Intermediate Ex2e te/ a,swerP Somehow two *al es ha*e been inserted into the d al table. !his table is a single row7 single col mn table that sho ld only ha*e one *al e in it. 1+. 7ow a, 4o" /eter3i,e i0 a, i,/ex ,ee/s to 1e /ro22e/ a,/ re1"i!t%

)e*el: Intermediate Ex2e te/ a,swerP R n the A%A)IU- I%D-E command on the inde> to *alidate its str ct re and then calc late the ratio of )?5B)J5)-%L)?5B)J5)-%RBR5B)J5)-% and if it isn@t near 1.< Ci.e. greater than <.8 or soD then the inde> sho ld be reb ilt. :r if the ratio BR5B)J5)-%L )?5B)J5)-%RBR5B)J5)-% is nearing <.'. SQL@ SQL(!"s 1. 7ow a, #aria1!es 1e 2asse/ to a SQL ro"ti,e% )e*el: )ow Ex2e te/ a,swerP By se of the & symbol. ?or 0assing in *ariables the n mbers 1/9 can be sed C&17 &$7...7&9D to 0ass the *al es after the command into the S()H).S session. !o be 0rom0ted for a s0ecific *ariable7 0lace the am0ersanded *ariable in the code itself: ,select G from dba5tables where owner#&owner5nameK, . .se of do ble am0ersands tells S()H).S to res bstit te the *al e for each s bse= ent se of the *ariable7 a single am0ersand will ca se a re0rom0t for the *al e nless an A22-H! statement is sed to get the *al e from the ser. 2. *o" wa,t to i, !"/e a arria5e ret"r,@!i,e0ee/ i, 4o"r o"t2"t 0ro3 a SQL s ri2t? how a, 4o" /o this% )e*el: Intermediate to high Ex2e te/ a,swerP !he best method is to se the 2"RCD f nction C2"RC1<D is a ret rnLlinefeedD and the concatenation f nction ,\\,. Another method7 altho gh it is hard to doc ment and isn@t always 0ortable is to se the ret rnLlinefeed as a 0art of a = oted string. 8. 7ow a, 4o" a!! a (L@SQL 2ro e/"re 0ro3 SQL% )e*el: Intermediate Ex2e te/ a,swerP By se of the -E-2.!- Cshort form -E-2D command. :. 7ow /o 4o" exe "te a host o2erati,5 s4ste3 o33a,/ 0ro3 withi, SQL% )e*el: )ow Ex2e te/ a,swerP By se of the e>clamation 0oint ,W, Cin .%IE and some other :SD or the ":S! C":D command. &. *o" wa,t to "se SQL to 1"i!/ SQL? what is this a!!e/ a,/ 5i#e a, exa32!e )e*el: Intermediate to high Ex2e te/ a,swerP !his is called dynamic S(). An e>am0le wo ld be: set lines ;< 0ages < termo t off feedbac& off *erify off s0ool dro05all.s=l select cdro0 ser c\\ sername\\@ cascadeK@ from dba5 sers where sername not in C,SIS@7@SIS!-M@DK s0ool off -ssentially yo are loo&ing to see that they &now to incl de a command Cin this case DR:H .S-R...2AS2AD-KD and that yo need to concatenate sing the c\\@ the *al es selected from the database. <. What SQL(!"s o33a,/ is "se/ to 0or3at o"t2"t 0ro3 a se!e t% )e*el: low Ex2e te/ a,swerP !his is best done with the 2:).M% command. =. *o" wa,t to 5ro"2 the 0o!!owi,5 set o0 se!e t ret"r,s? what a, 4o" 5ro"2 o,% Ma>Cs m5of5costD7 minCs m5of5costD7 co ntCitem5noD7 item5no )e*el: Intermediate Ex2e te/ a,swerP!he only col mn that can be gro 0ed on is the ,item5no, col mn7 the rest ha*e aggregate f nctions associated with them. '. What s2e ia! Ora !e 0eat"re a!!ows 4o" to s2e i04 how the ost 1ase/ s4ste3 treats a S() statement? )e*el: Intermediate to high ->0ected answer: !he 2:S! based system allows the se of "I%!s to control the o0timiMer 0ath selection. If they can gi*e some e>am0le hints s ch as ?IRS! R:WS7 A)) R:WS7 .SI%+ I%D-E7 S!AR7 e*en better. +. *o" wa,t to /eter3i,e the !o atio, o0 i/e,ti a! rows i, a ta1!e 1e0ore atte32ti,5 to 2!a e a ",i-"e i,/ex o, the ta1!e? how a, this 1e /o,e% )e*el: "igh Ex2e te/ a,swerP :racle tables always ha*e one g aranteed ni= e col mn7 the rowid col mn. If yo se a minLma> f nction against yo r rowid and then select against the 0ro0osed 0rimary &ey yo can s= eeMe o t the rowids of the d 0licate rows 0retty = ic&. ?or e>am0le: select rowid from em0 e where e.rowid T Cselect minC>.rowidD from em0 > where >.em05no # e.em05noDK In the sit ation where m lti0le col mns ma&e 0 the 0ro0osed &ey7 they m st all be sed in the where cla se.

1.. What is a Cartesia, 2ro/" t% )e*el: )ow Ex2e te/ a,swerP A 2artesian 0rod ct is the res lt of an nrestricted 6oin of two or more tables. !he res lt set of a three table 2artesian 0rod ct will ha*e > G y G M n mber of rows where >7 y7 M corres0ond to the n mber of rows in each table in*ol*ed in the 6oin. 11. *o" are Coi,i,5 a !o a! a,/ a re3ote ta1!e? the ,etwor$ 3a,a5er o32!ai,s a1o"t the tra00i i,#o!#e/? how a, 4o" re/" e the ,etwor$ tra00i % )e*el: "igh Ex2e te/ a,swerPH sh the 0rocessing of the remote data to the remote instance by sing a *iew to 0re/select the information for the 6oin. !his will res lt in only the data re= ired for the 6oin being sent across. 12. What is the /e0a"!t or/eri,5 o0 a, ORDER B* !a"se i, a SELECT state3e,t% )e*el: )ow Ex2e te/ a,swerP Ascending 18. What is t$2ro0 a,/ how is it "se/% )e*el: Intermediate to high Ex2e te/ a,swerP !he t&0rof tool is a t ning tool sed to determine c0 and e>ec tion times for S() statements. Io se it by first setting timed5statistics to tr e in the initialiMation file and then t rning on tracing for either the entire database *ia the s=l5trace 0arameter or for the session sing the A)!-R S-SSI:% command. :nce the trace file is generated yo r n the t&0rof tool against the trace file and then loo& at the o t0 t from the t&0rof tool. !his can also be sed to generate e>0lain 0lan o t0 t. 1:. What is ex2!ai, 2!a, a,/ how is it "se/% )e*el: Intermediate to high Ex2e te/ a,swerP !he -EH)AI% H)A% command is a tool to t ne S() statements. !o se it yo m st ha*e an e>0lain5table generated in the ser yo are r nning the e>0lain 0lan for. !his is created sing the tl>0lan.s=l scri0t. :nce the e>0lain 0lan table e>ists yo r n the e>0lain 0lan command gi*ing as its arg ment the S() statement to be e>0lained. !he e>0lain50lan table is then = eried to see the e>ec tion 0lan of the statement. ->0lain 0lans can also be r n sing t&0rof. 1&. 7ow /o 4o" set the ,"31er o0 !i,es o, a 2a5e o0 o"t2"t% The wi/th% )e*el: )ow Ex2e te/ a,swerP !he S-! command in S()H).S is sed to control the n mber of lines generated 0er 0age and the width of those lines7 for e>am0le S-! HA+-SIU- 4< )I%-SIU- 9< will generate re0orts that are 4< lines long with a line width of 9< characters. !he HA+-SIU- and )I%-SIU- o0tions can be shortened to HA+-S and )I%-S. 1<. 7ow /o 4o" 2re#e,t o"t2"t 0ro3 o3i,5 to the s ree,% )e*el: )ow Ex2e te/ a,swerP !he S-! o0tion !-RM:.! controls o t0 t to the screen. Setting !-RM:.! :?? t rns off screen o t0 t. !his o0tion can be shortened to !-RM. 1=. 7ow /o 4o" 2re#e,t Ora !e 0ro3 5i#i,5 4o" i,0or3atio,a! 3essa5es /"ri,5 a,/ a0ter a SQL state3e,t exe "tio,% )e*el: )ow Ex2e te/ a,swerP !he S-! o0tions ?--DBA2J and B-RI?I can be set to :??. 1'. 7ow /o 4o" 5e,erate 0i!e o"t2"t 0ro3 SQL% )e*el: )ow Ex2e te/ a,swerP By se of the SH::) command T'ning Q'e%ti$n%( 1. A ta1!es2a e has a ta1!e with 8. exte,ts i, it. Is this 1a/% Wh4 or wh4 ,ot. )e*el: Intermediate ->0ected answer: M lti0le e>tents in and of themsel*es aren@t bad. "owe*er if yo also ha*e chained rows this can h rt 0erformance. 2. 7ow /o 4o" set "2 ta1!es2a es /"ri,5 a, Ora !e i,sta!!atio,% )e*el: )ow ->0ected answer: Io sho ld always attem0t to se the :racle ?le>ible Architect re standard or another 0artitioning scheme to ens re 0ro0er se0aration of SIS!-M7 R:))BA2J7 R-D: ):+7 DA!A7 !-MH:RARI and I%D-E segments. 8. *o" see 3"!ti2!e 0ra53e,ts i, the S*STE) ta1!es2a e? what sho"!/ 4o" he $ 0irst% )e*el: )ow ->0ected answer: -ns re that sers don@t ha*e the SIS!-M tables0ace as their !-MH:RARI or D-?A.)! tables0ace assignment by chec&ing the DBA5.S-RS *iew.

:. What are so3e i,/i atio,s that 4o" ,ee/ to i, rease the S7ARED;(OOL;SIDE 2ara3eter% )e*el: Intermediate ->0ected answer: Hoor data dictionary or library cache hit ratios7 getting error :RA/<1<'1. Another indication is steadily decreasing 0erformance with all other t ning 0arameters the same. &. What is the 5e,era! 5"i/e!i,e 0or siEi,5 /1;1!o $;siEe a,/ /1;3"!ti;1!o $;rea/ 0or a, a22!i atio, that /oes 3a,4 0"!! ta1!e s a,s% )e*el: "igh ->0ected answer: :racle almost always reads in 41& ch n&s. !he two sho ld ha*e a 0rod ct e= al to 41 or a m lti0le of 41. <. What is the 0astest -"er4 3etho/ 0or a ta1!e% )e*el: Intermediate ->0ected answer: ?etch by rowid =. Ex2!ai, the "se o0 TK(RO9% What i,itia!iEatio, 2ara3eter sho"!/ 1e t"r,e/ o, to 5et 0"!! TK(RO9 o"t2"t% )e*el: "igh ->0ected answer: !he t&0rof tool is a t ning tool sed to determine c0 and e>ec tion times for S() statements. Io se it by first setting timed5statistics to tr e in the initialiMation file and then t rning on tracing for either the entire database *ia the s=l5trace 0arameter or for the session sing the A)!-R S-SSI:% command. :nce the trace file is generated yo r n the t&0rof tool against the trace file and then loo& at the o t0 t from the t&0rof tool. !his can also be sed to generate e>0lain 0lan o t0 t. '. Whe, !oo$i,5 at #Os4sstat 4o" see that sorts I/is$G is hi5h. Is this 1a/ or 5oo/% I0 1a/ -7ow /o 4o" orre t it% )e*el: Intermediate ->0ected answer: If yo get e>cessi*e dis& sorts this is bad. !his indicates yo need to t ne the sort area 0arameters in the initialiMation files. !he ma6or sort are 0arameter is the S:R!5AR-A5SIUe 0arameter. +. Whe, sho"!/ 4o" i, rease o24 !at hes% What 2ara3eters o,tro! o24 !at hes% )e*el: high ->0ected answer: When yo get e>cessi*e contention for the co0y latches as shown by the ,redo co0y, latch hit ratio. Io can increase co0y latches *ia the initialiMation 0arameter ):+5SIM.)!A%-:.S52:HI-S to twice the n mber of 2H.s on yo r system. 1.. Where a, 4o" 5et a !ist o0 a!! i,itia!iEatio, 2ara3eters 0or 4o"r i,sta, e% 7ow a1o"t a, i,/i atio, i0 the4 are /e0a"!t setti,5s or ha#e 1ee, ha,5e/% )e*el: )ow ->0ected answer: Io can loo& in the initSsidT.ora file for an indication of man ally set 0arameters. ?or all 0arameters7 their *al e and whether or not the c rrent *al e is the defa lt *al e7 loo& in the *Y0arameter *iew. 11. Des ri1e hit ratio as it 2ertai,s to the /ata1ase 1"00ers. What is the /i00ere, e 1etwee, i,sta,ta,eo"s a,/ "3"!ati#e hit ratio a,/ whi h sho"!/ 1e "se/ 0or t",i,5% )e*el: Intermediate ->0ected answer: !he hit ratio is a meas re of how many times the database was able to read a *al e from the b ffers *erses how many times it had to re/read a data *al e from the dis&s. A *al e greater than 9</;<N is good7 less co ld indicate 0roblems. If yo sim0ly ta&e the ratio of e>isting 0arameters this will be a c m lati*e *al e since the database started. If yo do a com0arison between 0airs of readings based on some arbitrary time s0an7 this is the instantaneo s ratio for that time s0an. +enerally s0ea&ing an instantaneo s reading gi*es more *al able data since it will tell yo what yo r instance is doing for the time it was generated o*er. 12. Dis "ss row hai,i,5? how /oes it ha22e,% 7ow a, 4o" re/" e it% 7ow /o 4o" orre t it% )e*el: high ->0ected answer: Row chaining occ rs when a BAR2"AR$ *al e is 0dated and the length of the new *al e is longer than the old *al e and won@t fit in the remaining bloc& s0ace. !his res lts in the row chaining to another bloc&. It can be red ced by setting the storage 0arameters on the table to a00ro0riate *al es. It can be corrected by e>0ort and im0ort of the effected table. 18. Whe, !oo$i,5 at the estat e#e,ts re2ort 4o" see that 4o" are 5etti,5 1"s4 1"00er waits. Is this 1a/% 7ow a, 4o" 0i,/ what is a"si,5 it% )e*el: high ->0ected answer: B ffer b sy waits co ld indicate contention in redo7 rollbac& or data bloc&s. Io need to chec& the *Ywaitstat *iew to see what areas are ca sing the 0roblem. !he *al e of the ,co nt, col mn tells where the 0roblem is7 the ,class, col mn tells yo with what. .%D: is rollbac& segments7 DA!A is data base b ffers. 1:. I0 4o" see o,te,tio, 0or !i1rar4 a hes how a, 4o" 0ix it% )e*el: Intermediate ->0ected answer: Increase the siMe of the shared 0ool.

1&. I0 4o" see statisti s that /ea! with K",/oK what are the4 rea!!4 ta!$i,5 a1o"t% )e*el: Intermediate ->0ected answer: Rollbac& segments and associated str ct res. 1<. I0 a ta1!es2a e has a /e0a"!t 2 ti, rease o0 Eero what wi!! this a"se Ii, re!atio,shi2 to the s3o, 2ro essG% )e*el: "igh ->0ected answer: !he SM:% 0rocess won@t a tomatically coalesce its free s0ace fragments. 1=. I0 a ta1!es2a e shows ex essi#e 0ra53e,tatio, what are so3e 3etho/s to /e0ra53e,t the ta1!es2a e% I=.1?=.2 a,/ =.8 o,!4G )e*el: "igh ->0ected answer: In :racle 8.< to 8.$ !he se of the Falter session set e*ents Fimmediate trace name coalesce le*el ts`FK@ command is the easiest way to defragment contig o s free s0ace fragmentation. !he ts` 0arameter corres0onds to the ts` *al e fo nd in the tsY SIS table. In *ersion 8.' the calter tables0ace SnameT coalesceK@ is best. If the free s0ace isn@t contig o s then e>0ort7 dro0 and im0ort of the tables0ace contents may be the only way to reclaim non/ contig o s free s0ace. 1'. 7ow a, 4o" te!! i0 a ta1!es2a e has ex essi#e 0ra53e,tatio,% )e*el: Intermediate If a select against the dba5free5s0ace table shows that the co nt of a tables0aces e>tents is greater than the co nt of its data files7 then it is fragmented. 1+. *o" see the 0o!!owi,5 o, a stat"s re2ortP re/o !o5 s2a e re-"ests 28 re/o !o5 s2a e wait ti3e . Is this so3ethi,5 to worr4 a1o"t% What i0 re/o !o5 s2a e wait ti3e is hi5h% 7ow a, 4o" 0ix this% )e*el: Intermediate ->0ected answer: Since the wait time is Mero7 no. If the wait time was high it might indicate a need for more or larger redo logs. 2.. What a, a"se a hi5h #a!"e 0or re "rsi#e a!!s% 7ow a, this 1e 0ixe/% )e*el: "igh ->0ected answer: A high *al e for rec rsi*e calls is ca se by im0ro0er c rsor sage7 e>cessi*e dynamic s0ace management actions7 and or e>cessi*e statement re/0arses. Io need to determine the ca se and correct it By either relin&ing a00lications to hold c rsors7 se 0ro0er s0ace management techni= es C0ro0er storage and siMingD or ens re re0eat = eries are 0laced in 0ac&ages for 0ro0er re se. 21. I0 4o" see a 2i, hit ratio o0 !ess tha, ..' i, the estat !i1rar4 a he re2ort is this a 2ro1!e3% I0 so? how /o 4o" 0ix it% )e*el: Intermediate ->0ected answer: !his indicate that the shared 0ool may be too small. Increase the shared 0ool siMe. 22. I0 4o" see the #a!"e 0or re!oa/s is hi5h i, the estat !i1rar4 a he re2ort is this a 3atter 0or o, er,% )e*el: Intermediate ->0ected answer: Ies7 yo sho ld stri*e for Mero reloads if 0ossible. If yo see e>cessi*e reloads then increase the siMe of the shared 0ool. 28. *o" !oo$ at the /1a;ro!!1a $;se5s #iew a,/ see that there is a !ar5e ,"31er o0 shri,$s a,/ the4 are o0 re!ati#e!4 s3a!! siEe? is this a 2ro1!e3% 7ow a, it 1e 0ixe/ i0 it is a 2ro1!e3% )e*el: "igh ->0ected answer: A large n mber of small shrin&s indicates a need to increase the siMe of the rollbac& segment e>tents. Ideally yo sho ld ha*e no shrin&s or a small n mber of large shrin&s. !o fi> this 6 st increase the siMe of the e>tents and ad6 st o0timal accordingly. 2:. *o" !oo$ at the /1a;ro!!1a $;se5s #iew a,/ see that 4o" ha#e a !ar5e ,"31er o0 wra2s is this a 2ro1!e3% )e*el: "igh ->0ected answer: A large n mber of wra0s indicates that yo r e>tent siMe for yo r rollbac& segments are 0robably too small. Increase the siMe of yo r e>tents to red ce the n mber of wra0s. Io can loo& at the a*erage transaction siMe in the same *iew to get the information on transaction siMe. 2&. I, a s4ste3 with a, a#era5e o0 :. o, "rre,t "sers 4o" 5et the 0o!!owi,5 0ro3 a -"er4 o, ro!!1a $ exte,tsP ROLLBACK CUR EFTENTS --------------------- -------------------------R.1 11 R.2 ' R.8 12 R.: +

S*STE) : *o" ha#e roo3 0or ea h to 5row 14 2. 3ore exte,ts ea h. Is there a 2ro1!e3% Sho"!/ 4o" ta$e a,4 a tio,% )e*el: Intermediate ->0ected answer: %o there is not a 0roblem. Io ha*e 1< e>tents showing and an a*erage of 1< conc rrent sers. Since there is 0lenty of room to grow no action is needed. 2<. *o" see 3"!ti2!e exte,ts i, the te32orar4 ta1!es2a e. Is this a 2ro1!e3% )e*el: Intermediate ->0ected answer: As long as they are all the same siMe this isn@t a 0roblem. In fact7 it can e*en im0ro*e 0erformance since :racle won@t ha*e to create a new e>tent when a ser needs one. In%tallati$n&)$n*ig'rati$n 1. De0i,e O9A. )e*el: )ow ->0ected answer: :?A stands for :0timal ?le>ible Architect re. It is a method of 0lacing directories and files in an :racle system so that yo get the ma>im m fle>ibility for f t re t ning and file 0lacement. 2. 7ow /o 4o" set "2 4o"r ta1!es2a e o, i,sta!!atio,% )e*el: )ow ->0ected answer: !he answer here sho ld show an nderstanding of se0aration of redo and rollbac&7 data and inde>es and isolation os SIS!-M tables from other tables. An e>am0le wo ld be to s0ecify that at least 8 dis&s sho ld be sed for an :racle installation so that yo can 0lace SIS!-M tables0ace on one7 redo logs on two Cmirrored redo logsD the !-MH:RARI tables0ace on another7 R:))BA2J tables0ace on another and still ha*e two for DA!A and I%D-E-S. !hey sho ld indicate how they will handle archi*e logs and e>0orts as well. As long as they ha*e a logical 0lan for combining or f rther se0aration more or less dis&s can be s0ecified. 8. What sho"!/ 1e /o,e 2rior to i,sta!!i,5 Ora !e I0or the OS a,/ the /is$sG% )e*el: )ow ->0ected Answer: ad6 st &ernel 0arameters or :S t ning 0arameters in accordance with installation g ide. Be s re eno gh contig o s dis& s0ace is a*ailable. :. *o" ha#e i,sta!!e/ Ora !e a,/ 4o" are ,ow setti,5 "2 the a t"a! i,sta, e. *o" ha#e 1ee, waiti,5 a, ho"r 0or the i,itia!iEatio, s ri2t to 0i,ish? what sho"!/ 4o" he $ 0irst to /eter3i,e i0 there is a 2ro1!e3% )e*el: Intermediate to high ->0ected Answer: 2hec& to ma&e s re that the archi*er isn@t st c&. If archi*e logging is t rned on d ring install a large n mber of logs will be created. !his can fill 0 yo r archi*e log destination ca sing :racle to sto0 to wait for more s0ace. &. Whe, o,0i5"ri,5 SQLNET o, the ser#er what 0i!es 3"st 1e set "2% )e*el: Intermediate ->0ected answer: I%I!IA)IUA!I:% file7 !%S%AM-S.:RA file7 S()%-!.:RA file <. Whe, o,0i5"ri,5 SQLNET o, the !ie,t what 0i!es ,ee/ to 1e set "2% )e*el: Intermediate ->0ected answer: S()%-!.:RA7 !%S%AM-S.:RA =. What 3"st 1e i,sta!!e/ with ODBC o, the !ie,t i, or/er 0or it to wor$ with Ora !e% )e*el: Intermediate ->0ected answer: S()%-! and HR:!:2:) Cfor e>am0le: !2HIH ada0terD layers of the trans0ort 0rograms. '. *o" ha#e C"st starte/ a ,ew i,sta, e with a !ar5e S>A o, a 1"s4 existi,5 ser#er. (er0or3a, e is terri1!e? what sho"!/ 4o" he $ 0or% )e*el: Intermediate ->0ected answer: !he first thing to chec& with a large S+A is that it isn@t being swa00ed o t. ;. What :S ser sho ld be sed for the first 0art of an :racle installation Con .%IED? )e*el: low ->0ected answer: Io m st se root first. 1.. Whe, sho"!/ the /e0a"!t #a!"es 0or Ora !e i,itia!iEatio, 2ara3eters 1e "se/ as is% )e*el: )ow ->0ected answer: %e*er 11. 7ow 3a,4 o,tro! 0i!es sho"!/ 4o" ha#e% Where sho"!/ the4 1e !o ate/% )e*el: )ow ->0ected answer: At least $ on se0arate dis& s0indles. Be s re they say on se0arate dis&s7 not 6 st file systems. 12. 7ow 3a,4 re/o !o5s sho"!/ 4o" ha#e a,/ how sho"!/ the4 1e o,0i5"re/ 0or 3axi3"3 re o#era1i!it4%

)e*el: Intermediate ->0ected answer: Io sho ld ha*e at least three gro 0s of two redo logs with the two logs each on a se0arate dis& s0indle Cmirrored by :racleD. !he redo logs sho ld not be on raw de*ices on .%IE if it can be a*oided. 18. *o" ha#e a si32!e a22!i atio, with ,o KhotK ta1!es Ii.e. ",i0or3 IO a,/ a ess re-"ire3e,tsG. 7ow 3a,4 /is$s sho"!/ 4o" ha#e ass"3i,5 sta,/ar/ !a4o"t 0or S*STE)? USER? TE)( a,/ ROLLBACK ta1!es2a es% ->0ected answer: At least 87 see dis& config ration answer abo*e. Data )o/e!er 1. Des ri1e thir/ ,or3a! 0or3% )e*el: )ow ->0ected answer: Something li&e: In third normal form all attrib tes in an entity are related to the 0rimary &ey and only to the 0rimary &ey 2. Is the 0o!!owi,5 state3e,t tr"e or 0a!seP KA!! re!atio,a! /ata1ases 3"st 1e i, thir/ ,or3a! 0or3K Wh4 or wh4 ,ot% )e*el: Intermediate ->0ected answer: ?alse. While '%? is good for logical design most databases7 if they ha*e more than 6 st a few tables7 will not 0erform well sing f ll '%?. .s ally some entities will be denormaliMed in the logical to 0hysical transfer 0rocess. 8. What is a, ERD% )e*el: )ow ->0ected answer: An -RD is an -ntity/Relationshi0/Diagram. It is sed to show the entities and relationshi0s for a database logical model. :. Wh4 are re "rsi#e re!atio,shi2s 1a/% 7ow /o 4o" reso!#e the3% )e*el: Intermediate A rec rsi*e relationshi0 Cone where a table relates to itselfD is bad when it is a hard relationshi0 Ci.e. neither side is a ,may, both are ,m st,D as this can res lt in it not being 0ossible to 0 t in a to0 or 0erha0s a bottom of the table Cfor e>am0le in the -MH):I-- table yo co ldn@t 0 t in the HR-SID-%! of the com0any beca se he has no boss7 or the 6 nior 6anitor beca se he has no s bordinatesD. !hese ty0e of relationshi0s are s ally resol*ed by adding a small intersection entity. &. What /oes a har/ o,e-to-o,e re!atio,shi2 3ea, Io,e where the re!atio,shi2 o, 1oth e,/s is K3"stKG% )e*el: )ow to intermediate ->0ected answer: !his means the two entities sho ld 0robably be made into one entity. <. 7ow sho"!/ a 3a,4-to-3a,4 re!atio,shi2 1e ha,/!e/% )e*el: Intermediate ->0ected answer: By adding an intersection entity table =. What is a, arti0i ia! I/eri#e/G 2ri3ar4 $e4% Whe, sho"!/ a, arti0i ia! Ior /eri#e/G 2ri3ar4 $e4 1e "se/% )e*el: Intermediate ->0ected answer: A deri*ed &ey comes from a se= ence. .s ally it is sed when a concatenated &ey becomes too c mbersome to se as a foreign &ey. '. Whe, sho"!/ 4o" o,si/er /e,or3a!iEatio,% )e*el: Intermediate ->0ected answer: Whene*er 0erformance analysis indicates it wo ld be beneficial to do so witho t com0romising data integrity. UNI+ 1. 7ow a, 4o" /eter3i,e the s2a e !e0t i, a 0i!e s4ste3% )e*el: )ow ->0ected answer: !here are se*eral commands to do this: d 7 df7 or bdf 2. 7ow a, 4o" /eter3i,e the ,"31er o0 SQLNET "sers !o55e/ i, to the UNIF s4ste3% )e*el: Intermediate ->0ected answer: S()%-! sers will show 0 with a 0rocess ni= e name that begins with oracleSSIDT7 if yo do a 0s /ef\gre0 oracleSSIDT\wc /l yo can get a co nt of the n mber of sers. 8. What o33a,/ is "se/ to t42e 0i!es to the s ree,%

)e*el: )ow ->0ected answer: cat7 more7 0g :. What o33a,/ is "se/ to re3o#e a 0i!e% )e*el: )ow ->0ected answer: rm &. Ca, 4o" re3o#e a, o2e, 0i!e ",/er UNIF% )e*el: )ow ->0ected answer: yes <. 7ow /o 4o" reate a /e isio, tree i, a she!! s ri2t% )e*el: intermediate ->0ected answer: de0ending on shell7 s ally a case/esac or an if/endif or fi str ct re =. What is the 2"r2ose o0 the 5re2 o33a,/% )e*el: )ow ->0ected answer: gre0 is a string search command that 0arses the s0ecified string from the s0ecified file or files '. The s4ste3 has a 2ro5ra3 that a!wa4s i, !"/es the wor/ ,o o32 i, its ,a3e? how a, 4o" /eter3i,e the ,"31er o0 2ro esses that are "si,5 this 2ro5ra3% )e*el: intermediate ->0ected answer: 0s /ef\gre0 Gnocom0G\wc /l +. What is a, i,o/e% )e*el: Intermediate ->0ected answer: an inode is a file stat s indicator. It is stored in both dis& and memory and tracts file stat s. !here is one inode for each file on the system. 1.. The s4ste3 a/3i,istrator te!!s 4o" that the s4ste3 has,Ht 1ee, re1oote/ i, < 3o,ths? sho"!/ he 1e 2ro"/ o0 this% )e*el: "igh ->0ected answer: Maybe. Some .%IE systems don@t clean 0 well after themsel*es. Inode 0roblems and dead ser 0rocesses can acc m late ca sing 0ossible 0erformance and corr 0tion 0roblems. Most .%IE systems sho ld ha*e a sched led 0eriodic reboot so file systems can be chec&ed and cleaned and dead or Mombie 0rocesses cleared o t. 11. What is re/ire tio, a,/ how is it "se/% )e*el: Intermediate ->0ected answer: redirection is the 0rocess by which in0 t or o t0 t to or from a 0rocess is redirected to another 0rocess. !his can be done sing the 0i0e symbol ,\,7 the greater than symbol ,T, or the ,tee, command. !his is one of the strengths of .%IE allowing the o t0 t from one command to be redirected directly into the in0 t of another command. 12. 7ow a, 4o" 0i,/ /ea/ 2ro esses% )e*el: Intermediate ->0ected answer: 0s /ef\gre0 Mombie // or // who /d de0ending on the system. 18. 7ow a, 4o" 0i,/ a!! the 2ro esses o, 4o"r s4ste3% )e*el: )ow ->0ected answer: .se the 0s command 1:. 7ow a, 4o" 0i,/ 4o"r i/ o, a s4ste3% )e*el: )ow ->0ected answer: .se the ,who am i, command. 1&. What is the 0i,5er o33a,/% )e*el: )ow ->0ected answer: !he finger command ses data in the 0asswd file to gi*e information on system sers. 1<. What is the easiest 3etho/ to reate a 0i!e o, UNIF% )e*el: )ow ->0ected answer: .se the to ch command 1=. What /oes VV /o% )e*el: Intermediate ->0ected answer: !he ,TT, redirection symbol a00ends the o t0 t from the command s0ecified into the file s0ecified. !he file m st already ha*e been created.

1'. I0 4o" are,Ht s"re what o33a,/ /oes a 2arti "!ar UNIF 0", tio, what is the 1est wa4 to /eter3i,e the o33a,/% ->0ected answer: !he .%IE man /& S*al eT command will search the man 0ages for the *al e s0ecified. Re*iew the res lts from the command to find the command of interest. Oracle Tr$',le%#$$ting 1. 7ow a, 4o" /eter3i,e i0 a, Ora !e i,sta, e is "2 0ro3 the o2erati,5 s4ste3 !e#e!% )e*el: )ow ->0ected answer: !here are se*eral base :racle 0rocesses that will be r nning on m lti/ ser o0erating systems7 these will be smon7 0mon7 dbwr and lgwr. Any answer that has them sing their o0erating system 0rocess showing feat re to chec& for these is acce0table. ?or e>am0le7 on .%IE a 0s /ef\gre0 dbwr will show what instances are 0. 2. Users 0ro3 the (C !ie,ts are 5etti,5 3essa5es i,/i ati,5 P )e*el: )ow :RA/<4111: C2nct err7 canFt get err t>t. See Ser*r Msgs & 2odes Man alD What co ld the 0roblem be? Ex2e te/ a,swerP !he instance name is 0robably incorrect in their connection string. 8. Users 0ro3 the (C !ie,ts are 5etti,5 the 0o!!owi,5 error sta $P Le#e!P Low ERRORP ORA-.1.8:P ORACLE ,ot a#ai!a1!e ORA-.=81'P s3s5etP o2e, error whe, o2e,i,5 s5a/e0./10 0i!e. 7(-UF ErrorP 2P No s" h 0i!e or /ire tor4 What is the 2ro1a1!e a"se% ->0ected answer: !he :racle instance is sh tdown that they are trying to access7 restart the instance. :. 7ow a, 4o" /eter3i,e i0 the SQLNET 2ro ess is r",,i,5 0or SQLNET 61% 7ow a1o"t 62% )e*el: )ow ->0ected answer: ?or S()%-! B1 chec& for the e>istence of the orasr* 0rocess. Io can se the command ,tc0ctl stat s, to get a f ll stat s of the B1 !2HIH ser*er7 other 0rotocols ha*e similar command formats. ?or S()%-! B$ chec& for the 0resence of the )IS!-%-R 0rocessCsD or yo can iss e the command ,lsnrctl stat s,. &. What 0i!e wi!! 5i#e 4o" Ora !e i,sta, e stat"s i,0or3atio,% Where is it !o ate/% )e*el: )ow ->0ected answer: !he alertSSIDT.ora log. It is located in the directory s0ecified by the bac&gro nd5d m05dest 0arameter in the *Y0arameter table. <. Users are,Ht 1ei,5 a!!owe/ o, the s4ste3. The 0o!!owi,5 3essa5e is re ei#e/P )e*el: Intermediate :RA/<<$38 archi*er is st c&. 2onnect internal only7 ntil freed What is the 0roblem? ->0ected answer: !he archi*e destination is 0robably f ll7 bac& 0 the archi*e logs and remo*e them and the archi*er will re/start. =. Where wo"!/ 4o" !oo$ to 0i,/ o"t i0 a re/o !o5 was orr"2te/ ass"3i,5 4o" are "si,5 Ora !e 3irrore/ re/o !o5s% )e*el: Intermediate ->0ected answer: !here is no message that comes to the S()DBA or SRBM+R 0rograms d ring start 0 in this sit ation7 yo m st chec& the alertSSIDT.log file for this information. '. *o" atte32t to a// a /ata0i!e a,/ 5etP )e*el: Intermediate :RA/<1119: cannot add anymore datafiles: limit of 1< e>ceeded What is the 0roblem and how can yo fi> it? ->0ected answer: When the database was created the db5files 0arameter in the initialiMation file was set to 1<. Io can sh tdown and reset this to a higher *al e7 0 to the *al e of MAE5DA!A?I)-S as s0ecified at database creation. If the MAE5DA!A?I)-S is set to low7 yo will ha*e to reb ild the control file to increase it before 0roceeding. +. *o" !oo$ at 4o"r 0ra53e,tatio, re2ort a,/ see that s3o, has,Ht oa!es e/ a,4 o0 4o" ta1!es2a es? e#e, tho"5h 4o" $,ow se#era! ha#e !ar5e h",$s o0 o,ti5"o"s 0ree exte,ts. What is the 2ro1!e3% )e*el: "igh ->0ected answer: 2hec& the dba5tables0aces *iew for the *al e of 0ct5increase for the tables0aces. If 0ct5increase is Mero7 smon will not coalesce their free s0ace. 1.. *o"r "sers 5et the 0o!!owi,5 errorP )e*el: Intermediate :RA/<<<33 ma>im m n mber of DM) loc&s e>ceeded What is the 0roblem and how do yo fi> it?

->0ected answer: !he n mber of DM) )oc&s is set by the initialiMation 0arameter DM)5):2JS. If this *al e is set to low Cwhich it is by defa ltD yo will get this error. Increase the *al e of DM)5):2JS. If yo are s re that this is 6 st a tem0orary 0roblem7 yo can ha*e them wait and then try again later and the error sho ld clear. 11. *o" 5et a a!! 0ro3 4o" 1a $"2 DBA whi!e 4o" are o, #a atio,. 7e has orr"2te/ a!! o0 the o,tro! 0i!es whi!e 2!a4i,5 with the ALTER DATABASE BACKU( CONTROL9ILE o33a,/. What /o 4o" /o% )e*el: "igh ->0ected answer: As long as all datafiles are safe and he was s ccessf l with the BA2J.H controlfile command yo can do the following: 2:%%-2! I%!-R%A) S!AR!.H M:.%! C!a&e any read/only tables0aces offline before ne>t ste0 A)!-R DA!ABAS- DA!A?I)- .... :??)I%-KD R-2:B-R DA!ABAS- .SI%+ BA2J.H 2:%!R:)?I)A)!-R DA!ABAS- :H-% R-S-!):+SK Cbring read/only tables0aces bac& onlineD Sh tdown and bac& 0 the system7 then restart If they ha*e a recent o t0 t file from the A)!-R DA!ABAS- BA2J.H 2:%!R:) ?I)- !: !RA2-K command7 they can se that to reco*er as well. If no bac& 0 of the control file is a*ailable then the following will be re= ired: 2:%%-2! I%!-R%A) S!AR!.H %:M:.%! 2R-A!- 2:%!R:) ?I)- .....K "owe*er7 they will need to &now all of the datafiles7 logfiles7 and settings for MAE):+?I)-S7 MAE):+M-MB-RS7 MAE):+"IS!:RI7 MAEDA!A?I)-S for the database to se the command. :racle 2once0ts and Architect re Database Str ct res. 1.What are the com0onents of Hhysical database str ct re of :racle Database? :RA2)- database is com0rised of three ty0es of files. :ne or more Data files7 two are more redo )og files7 and one or more 2ontrol files. $.What are the com0onents of )ogical database str ct re of :RA2)- database? !able s0aces and the DatabaseFs Schema :b6ects. '. What is a !able s0ace? A database is di*ided into )ogical Storage .nit called table s0aces. A table s0ace is sed to gro 0ed related logical str ct res together. 1. What is SIS!-M table s0ace and when is it 2reated? -*ery :RA2)- database contains a table s0ace named SIS!-M7 which is a tomatically created when the database is created. !he SIS!-M table S0ace always contains the data dictionary tables for the entire database. 3. ->0lain the relationshi0 among Database7 !able s0ace and Data file? -ach databases logically di*ided into one or more table S0aces one or more data files are e>0licitly created for each table s0ace. 4. What is schema? A schema is collection of database ob6ects of a .ser. 8. What are Schema :b6ects? Schema ob6ects are the logical str ct res that directly refer to the databaseFs data. Schema ob6ects incl de tables7 *iews7 se= ences7 synonyms7 inde>es7 cl sters7 database triggers7 0roced res7 f nctions 0ac&ages and Database lin&s. 9. 2an ob6ects of the same Schema reside in different table s0aces? Ies. ;. 2an a !able s0ace hold ob6ects from different Schemes? Ies.

1<. What is !able? A table is the basic nit of data storage in an :RA2)- database. !he tables of a database hold all of the accessible data. !able data is stored in rows and col mns. 11. What is a Biew?

ser

A *iew is a *irt al table. -*ery *iew has a ( ery attached to it. C!he ( ery is a S-)-2! statement that identifies the col mns and rows of the tableCsD the *iew ses.D 1$. Do Biew contain Data? Biews do not contain or store data. 1'. 2an a Biew based on another Biew? Ies. 11. What are the ad*antages of Biews? Hro*ide an additional le*el of table sec rity7 by restricting access to a 0redetermined set of rows and col mns of a table. "ide data com0le>ity. Sim0lify commands for the ser. Store com0le> = eries. Hresent the data in a different 0ers0ecti*e from that of the base table. 13. What is a Se= ence? A se= ence generates a serial list of ni= e n mbers for n merical col mns of a databaseFs tables. 14. What is a Synonym? A synonym is an alias for a table7 *iew7 se= ence or 0rogram nit. 18. What are the ty0es of Synonyms? !here are two ty0es of Synonyms Hri*ate and H blic. 19. What is a Hri*ate Synonyms? A Hri*ate Synonyms can be accessed only by the owner. 1;. What is a H blic Synonyms? Any ser on the database can access a H blic synonym. $<. What are synonyms sed for? Synonyms are sed to: Mas& the real name and owner of an ob6ect. Hro*ide 0 blic access to an ob6ect Hro*ide location trans0arency for tables7 *iews or 0rogram nits of a remote database. Sim0lify the S() statements for database sers. $1. What is an Inde>? An Inde> is an o0tional str ct re associated with a table to ha*e direct access to rows7 which can be created to increase the 0erformance of data retrie*al. Inde> can be created on ones or more col mns of a table. $$. "ow is Inde>es .0date? Inde>es are a tomatically maintained and sed by :RA2)-. 2hanges to table data are a tomatically incor0orated into all rele*ant inde>es. $'. What are 2l sters?

2l sters are gro 0s of one or more tables 0hysically stores together to share common col mns and are often sed together. $1. What is cl ster Jey? !he related col mn of the tables in a cl ster is called the 2l ster Jey. $3. What is Inde> 2l ster? A 2l ster with an inde> on the 2l ster Jey. $4. What is "ash 2l ster? A row is stored in a hash cl ster based on the res lt of a00lying a hash f nction to the rowFs cl ster &ey *al e. All rows with the same hash &ey *al e are stores together on dis&. $8. When can "ash 2l ster sed? "ash cl sters are better choice when a table is often = eried with e= ality = eries. ?or s ch = eries the s0ecified cl ster &ey *al e is hashed. !he res lting hash &ey *al e 0oints directly to the area on dis& that stores the s0ecified rows. $9. What is Database )in&? A database lin& is a named ob6ect that describes a ,0ath, from one database to another. $;. What are the ty0es of Database )in&s? Hri*ate Database )in&7 H blic Database )in& & %etwor& Database )in&. '<. What is Hri*ate Database )in&? Hri*ate database lin& is created on behalf of a s0ecific ser. A 0ri*ate database lin& can be sed only when the owner of the lin& s0ecifies a global ob6ect name in a S() statement or in the definition of the ownerFs *iews or 0roced res. '1. What is H blic Database )in&? H blic database lin& is created for the s0ecial ser gro 0 H.B)I2. A 0 blic database lin& can be sed when any ser in the associated database s0ecifies a global ob6ect name in a S() statement or ob6ect definition. '$. What is %etwor& Database lin&? %etwor& database lin& is created and managed by a networ& domain ser*ice. A networ& database lin& can be sed when any ser of any database in the networ& s0ecifies a global ob6ect name in a S() statement or ob6ect definition. ''. What is Data Bloc&? :RA2)- databaseFs data is stored in data bloc&s. :ne data bloc& corres0onds to a s0ecific n mber of bytes of 0hysical database s0ace on dis&. '1. "ow to define Data Bloc& siMe? A data bloc& siMe is s0ecified for each :RA2)- database when the database is created. A database sers and allocated free database s0ace in :RA2)- data bloc&s. Bloc& siMe is s0ecified in I%I!.:RA file and can@t be changed latter. '3. What is Row 2haining? In 2irc mstances7 all of the data for a row in a table may not be able to fit in the same data bloc&. When this occ rs7 the data for the row is stored in a chain of data bloc& Cone or moreD reser*ed for that segment. '4. What is an ->tent? An ->tent is a s0ecific n mber of contig o s data bloc&s7 obtained in a single allocation7 and sed to store a s0ecific ty0e of information. '8. What is a Segment?

A segment is a set of e>tents allocated for a certain logical str ct re. '9. What are the different ty0es of Segments? Data Segment7 Inde> Segment7 Rollbac& Segment and !em0orary Segment. ';. What is a Data Segment? -ach %on/cl stered table has a data segment. All of the tableFs data is stored in the e>tents of its data segment. -ach cl ster has a data segment. !he data of e*ery table in the cl ster is stored in the cl sterFs data segment. 1<. What is an Inde> Segment? -ach Inde> has an Inde> segment that stores all of its data. 11. What is Rollbac& Segment? A Database contains one or more Rollbac& Segments to tem0orarily store , ndo, information. 1$. What are the ses of Rollbac& Segment? Rollbac& Segments are sed: !o generate read/consistent database information d ring database reco*ery to rollbac& ncommitted transactions for sers. 1'. What is a !em0orary Segment? !em0orary segments are created by :RA2)- when a S() statement needs a tem0orary wor& area to com0lete e>ec tion. When the statement finishes e>ec tion7 the tem0orary segment e>tents are released to the system for f t re se. 11. What is a Data ?ile? -*ery :RA2)- database has one or more 0hysical data files. A databaseFs data files contain all the database data. !he data of logical database str ct res s ch as tables and inde>es is 0hysically stored in the data files allocated for a database. 13. What are the 2haracteristics of Data ?iles? A data file can be associated with only one database. :nce created a data file canFt change siMe. :ne or more data files form a logical nit of database storage called a table s0ace. 14. What is a Redo )og? !he set of Redo )og files for a database is collecti*ely &nown as the databaseFs redo log. 18. What is the f nction of Redo )og? !he Hrimary f nction of the redo log is to record all changes made to data. 19. What is the se of Redo )og Information? !he Information in a redo log file is sed only to reco*er the database from a system or media fail re 0re*ents database data from being written to a databaseFs data files. 1;. What does a 2ontrol file 2ontain? A 2ontrol file records the 0hysical str ct re of the database. It contains the following information. Database %ame %ames and locations of a databaseFs files and redo log files. !ime stam0 of database creation. 3<. What is the se of 2ontrol ?ile? When an instance of an :RA2)- database is started7 its control file is sed to identify the database and redo log files that m st be o0ened for database o0eration to 0roceed. It is also sed in database reco*ery.

31. What is a Data Dictionary? !he data dictionary of an :RA2)- database is a set of tables and *iews that are sed as a read/only reference abo t the database. It stores information abo t both the logical and 0hysical str ct re of the database7 the *alid sers of an :RA2)database7 integrity constraints defined for tables in the database and s0ace allocated for a schema ob6ect and how m ch of it is being sed. 3$. What is an Integrity 2onstrains? An integrity constraint is a declarati*e way to define a b siness r le for a col mn of a table. 3'. 2an an Integrity 2onstraint be enforced on a table if some e>isting table data does not satisfy the constraint? %o. 31. Describe the different ty0e of Integrity 2onstraints s 00orted by :RA2)-? %:! %.)) 2onstraint / Disallows % lls in a tableFs col mn. .%I(.- 2onstraint / Disallows d 0licate *al es in a col mn or set of col mns. HRIMARI J-I 2onstraint / Disallows d 0licate *al es and % lls in a col mn or set of col mns. ?:R-I+% J-I 2onstrain / Re= ire each *al e in a col mn or set of col mns match a *al e in a related tableFs .%I(.- or HRIMARI J-I. 2"-2J 2onstraint / Disallows *al es that do not satisfy the logical e>0ression of the constraint. 33. What is difference between .%I(.- constraint and HRIMARI J-I constraint? A col mn defined as .%I(.- can contain % lls while a col mn defined as HRIMARI J-I canFt contain % lls. 34. Describe Referential Integrity? A r le defined on a col mn Cor set of col mnsD in one table that allows the insert or 0date of a row only if the *al e for the col mn or set of col mns Cthe de0endent *al eD matches a *al e in a col mn of a related table Cthe referenced *al eD. It also s0ecifies the ty0e of data mani0 lation allowed on referenced data and the action to be 0erformed on de0endent data as a res lt of any action on referenced data. 38. What are the Referential actions s 00orted by ?:R-I+% J-I integrity constraint? .HDA!- and D-)-!- Restrict / A referential integrity r le that disallows the 0date or deletion of referenced data. D-)-!- 2ascade / When a referenced row is deleted all associated de0endent rows are deleted. 39. What is self/referential integrity constraint? If a foreign &ey reference a 0arent &ey of the same table is called self/referential integrity constraint. 3;. What are the )imitations of a 2"-2J 2onstraint? !he condition m st be a Boolean e>0ression e*al ated sing the *al es in the row being inserted or 0dated and canFt contain s b = eries7 se= ence7 the SISDA!-7 .ID7 .S-R or .S-R-%B S() f nctions7 or the 0se do col mns )-B-) or R:W%.M. 4<. What is the ma>im m n mber of 2"-2J constraints that can be defined on a col mn? %o )imit. SIS!-M AR2"I!-2!.R-: 41. What constit te an :RA2)- Instance? S+A and :RA2)- bac&gro nd 0rocesses constit te an :RA2)- instance. CorD 2ombination of memory str ct re and bac&gro nd 0rocess. 4$. What is S+A? !he System +lobal Area CS+AD is a shared memory region allocated by :RA2)- that contains data and control information for one :RA2)- instance. 4'. What are the com0onents of S+A? Database b ffers7 Redo )og B ffer the Shared Hool and 2 rsors. 41. What do Database B ffers contain?

Database b ffers store the most recently sed bloc&s of database data. It can also contain modified data that has not yet been 0ermanently written to dis&. 43. What do Redo )og B ffers contain? Redo )og B ffer stores redo entries a log of changes made to the database. 44. What is Shared Hool? Shared Hool is a 0ortion of the S+A that contains shared memory constr cts s ch as shared S() areas. 48. What is Shared S() Area? A Shared S() area is re= ired to 0rocess e*ery ni= e S() statement s bmitted to a database and contains information s ch as the 0arse tree and e>ec tion 0lan for the corres0onding statement. 49. What is 2 rsor? A 2 rsor is a handle Ca name or 0ointerD for the memory associated with a s0ecific statement. 4;. What is H+A? Hrogram +lobal Area CH+AD is a memory b ffer that contains data and control information for a ser*er 0rocess. 8<. What is .ser Hrocess? A ser 0rocess is created and maintained to e>ec te the software code of an a00lication 0rogram. It is a shadow 0rocess created a tomatically to facilitate comm nication between the ser and the ser*er 0rocess. 81. What is Ser*er Hrocess? Ser*er Hrocess handles re= ests from connected ser 0rocess. A ser*er 0rocess is in charge of comm nicating with the ser 0rocess and interacting with :RA2)- carry o t re= ests of the associated ser 0rocess. 8$. What are the two ty0es of Ser*er 2onfig rations? Dedicated Ser*er 2onfig ration and M lti/threaded Ser*er 2onfig ration. 8'. What is Dedicated Ser*er 2onfig ration? In a Dedicated Ser*er 2onfig ration a Ser*er Hrocess handles re= ests for a Single .ser Hrocess. 81. What is a M lti/threaded Ser*er 2onfig ration? In a M lti/threaded Ser*er 2onfig ration many ser 0rocesses share a gro 0 of ser*er 0rocess. 83. What is a Harallel Ser*er o0tion in :RA2)-? A config ration for loosely co 0led systems where m lti0le instance share a single 0hysical database is called Harallel Ser*er. 84. %ame the :RA2)- Bac&gro nd Hrocess? DBWR / Database Writer. )+WR / )og Writer 2JH! / 2hec& Hoint SM:% / System Monitor HM:% / Hrocess Monitor AR2" / Archi*er R-2: / Reco*er Dnnn / Dis0atcher7 and )2Jn / )oc& Snnn / Ser*er. 88. What Does DBWR do? Database writer writes modified bloc&s from the database b ffer cache to the data files. 89.When Does DBWR write to the database? DBWR writes when more data needs to be read into the S+A and too few database b ffers are free. !he least recently sed data is written to the data files first. DBWR also writes when 2hec&0oint occ rs. 8;. What does )+WR do? )og Writer C)+WRD writes redo log entries generated in the redo log b ffer of the S+A to on/line Redo )og ?ile. 9<. When does )+WR write to the database? )+WR writes redo log entries into an on/line redo log file when transactions commit and the log b ffer files are f ll. 91. What is the f nction of chec&0oint C2JH!D? !he 2hec&0oint C2JH!D 0rocess is res0onsible for signaling DBWR at chec&0oints and 0dating all the data files and control files of the database.

9$. What are the f nctions of SM:%? System Monitor CSM:%D 0erforms instance reco*ery at instance start/ 0. In a m lti0le instance system Cone that ses the Harallel Ser*erD7 SM:% of one instance can also 0erform instance reco*ery for other instance that ha*e failed SM:% also cleans 0 tem0orary segments that are no longer in se and reco*ers dead transactions s&i00ed d ring crash and instance reco*ery beca se of file/read or off/line errors. !hese transactions are e*ent ally reco*ered by SM:% when the table s0ace or file is bro ght bac& on/line SM:% also coalesces free e>tents within the database to ma&e free s0ace contig o s and easier to allocate. 9'. What are f nctions of HM:%? Hrocess Monitor CHM:%D 0erforms 0rocess reco*ery when a ser 0rocess fails HM:% is res0onsible for cleaning 0 the cache and ?reeing reso rces that the 0rocess was sing HM:% also chec&s on dis0atcher and ser*er 0rocesses and restarts them if they ha*e failed. 91. What is the f nction of AR2"? Archi*er CAR2"D co0ies the on/line redo log files to archi*al storage when they are f ll. AR2" is acti*e only when a databaseFs redo log is sed in AR2"IB-):+ mode. 93. What is f nction of R-2:? R-2:*er CR-2:D is sed to resol*e distrib ted transactions that are 0ending d e to a networ& or system fail re in a distrib ted database. At timed inter*als7the local R-2: attem0ts to connect to remote databases and a tomatically com0lete the commit or rollbac& of the local 0ortion of any 0ending distrib ted transactions. 94. What is the f nction of Dis0atcher CDnnnD? Dis0atcher CDnnnD 0rocess is res0onsible for ro ting re= ests from connected ser 0rocesses to a*ailable shared ser*er 0rocesses and ret rning the res0onses bac& to the a00ro0riate ser 0rocesses. 98. "ow many Dis0atcher Hrocesses are created? Atleast one Dis0atcher 0rocess is created for e*ery comm nication 0rotocol in se. 99. What is the f nction of )oc& C)2JnD Hrocess? )oc& C)2JnD is sed for inter/instance loc&ing when the :RA2)- Harallel Ser*er o0tion is sed. 9;. What is the ma>im m n mber of )oc& Hrocesses sed? !ho gh a single )2J 0rocess is s fficient for most Harallel Ser*er systems .0 to !en )oc&s C)2J<7....)2J;D are sed for inter/instance loc&ing. DA!A A22-SS ;<. Define !ransaction? A !ransaction is a logical nit of wor& that com0rises one or more S() statements e>ec ted by a single ser. ;1. When does a !ransaction end? When it is committed or Roll bac&ed. ;$. What does 2:MMI! do? 2:MMI! ma&es 0ermanent the changes res lting from all S() statements in the transaction. !he changes made by the S() statements of a transaction become *isible to other ser sessions transactions that start only after transaction is committed. ;'. What does R:))BA2J do? R:))BA2J retracts any of the changes res lting from the S() statements in the transaction. ;1. What is SAB- H:I%!? ?or long transactions that contain many S() statements7 intermediate mar&ers or sa*e 0oints can be declared which can be sed to di*ide a transaction into smaller 0arts. !his allows the o0tion of later rolling bac& all wor& 0erformed from the c rrent 0oint in the transaction to a declared sa*e 0oint within the transaction. ;3. What is Read/:nly !ransaction? A Read/:nly transaction ens res that the res lts of each = ery e>ec ted in the transaction are consistent with res0ect to the same 0oint in time. ;4. What is the f nction of :0timiMer? !he goal of the o0timiMer is to choose the most efficient way to e>ec te a S() statement.

;8. What is ->ec tion Hlan? !he combination of the ste0s the o0timiMer chooses to e>ec te a statement is called an e>ec tion 0lan. ;9. What are the different a00roaches sed by :0timiMer in choosing an e>ec tion 0lan? R le/based and 2ost/based. ;;. What are the factors that affect :H!IMIU-R in choosing an :0timiMation a00roach? !he :H!IMIU-R5M:D- initialiMation 0arameter Statistics in the Data Dictionary the :H!IMIU-R5+:A) 0arameter of the A)!-R S-SSI:% command hints in the statement. 1<<. What are the *al es that can be s0ecified for :H!IMIU-R M:D- Harameter? 2:S! and R.)-. 1<1. Will the :0timiMer always se 2:S!/based a00roach if :H!IMIU-R5M:D- is set to ,2ostF? Hresence of statistics in the data dictionary for at least one of the tables accessed by the S() statements is necessary for the :H!IMIU-R to se 2:S!/based a00roach. :therwise :H!IMIU-R chooses R.)-/based a00roach. 1<$. What is the effect of setting the *al e of :H!IMIU-R5M:D- to FR.)-F? !his *al e ca ses the o0timiMer to choose the r le5based a00roach for all S() statements iss ed to the instance regardless of the 0resence of statistics. 1<'. What are the *al es that can be s0ecified for :H!IMIU-R5+:A) 0arameter of the A)!-R S-SSI:% 2ommand? 2"::S-7 A))5R:WS7 ?IRS!5R:WS and R.)-. 1<1. What is the effect of setting the *al e ,2"::S-, for :H!IMIU-R5+:A)7 0arameter of the A)!-R S-SSI:% 2ommand? !he :0timiMer chooses 2ost5based a00roach and o0timiMes with the goal of best thro gh0 t if statistics for at least one of the tables accessed by the S() statement e>ist in the data dictionary. :therwise the :H!IMIU-R chooses R.)-5based a00roach. 1<3. What is the effect of setting the *al e ,A))5R:WS, for :H!IMIU-R5+:A) 0arameter of the A)!-R S-SSI:% command? !his *al e ca ses the o0timiMer to the cost/based a00roach for all S() statements in the session regardless of the 0resence of statistics and to o0timiMe with a goal of best thro gh0 t. 1<4. What is the effect of setting the *al e F?IRS!5R:WSF for :H!IMIU-R5+:A) 0arameter of the A)!-R S-SSI:% command? !his *al e ca ses the o0timiMer to se the cost/based a00roach for all S() statements in the session regardless of the 0resence of statistics and to o0timiMe with a goal of best res0onse time. 1<8. What is the effect of setting the FR.)-F for :H!IMI-R5+:A) 0arameter of the A)!-R S-SSI:% 2ommand? !his *al e ca ses the o0timiMer to choose the r le/based a00roach for all S() statements in a session regardless of the 0resence of statistics. 1<9. What is R.)-/based a00roach to o0timiMation? 2hoosing an e>ec ting 0lan based on the access 0aths a*ailable and the ran&s of these access 0aths. 1<;. What is 2:S!/based a00roach to o0timiMation? 2onsidering a*ailable access 0aths and determining the most efficient e>ec tion 0lan based on statistics in the data dictionary for the tables accessed by the statement and their associated cl sters and inde>es. HR:+RAMMA!I2 2:%S!R.2!S 11<. What are the different ty0es of H)LS() 0rogram nits that can be defined and stored in :RA2)- database? Hroced res and ? nctions7 Hac&ages and Database !riggers. 111. What is a Hroced re? A Hroced re consist of a set of S() and H)LS() statements that are gro 0ed together as a nit to sol*e a s0ecific 0roblem or 0erform a set of related tas&s. 11$. What is difference between Hroced res and ? nctions? A ? nction ret rns a *al e to the caller where as a Hroced re does not. 11'. What is a Hac&age? A Hac&age is a collection of related 0roced res7 f nctions7 *ariables and other 0ac&age constr cts together as a nit in the database. 111. What are the ad*antages of ha*ing a Hac&age?

Increased f nctionality Cfor e>am0le7 global 0ac&age *ariables can be declared and sed by any 0roced re in the 0ac&ageD and 0erformance Cfor e>am0le all ob6ects of the 0ac&age are 0arsed com0iled7 and loaded into memory onceD 113. What is Database !rigger? A Database !rigger is 0roced re Cset of S() and H)LS() statementsD that is a tomatically e>ec ted as a res lt of an insert in7 0date to7 or delete from a table. 114. What are the ses of Database !rigger? Database triggers can be sed to a tomatic data generation7 a dit data modifications7 enforce com0le> Integrity constraints7 and c stomiMe com0le> sec rity a thoriMations. 118. What are the differences between Database !rigger and Integrity constraints? A declarati*e integrity constraint is a statement abo t the database that is always tr e. A constraint a00lies to e>isting data in the table and any statement that mani0 lates the table. A trigger does not a00ly to data loaded before the definition of the trigger7 therefore7 it does not g arantee all data in a table conforms to the r les established by an associated trigger. A trigger can be sed to enforce transitional constraints where as a declarati*e integrity constraint cannot be sed. DA!ABAS- S-2.RI!I 119. What are Roles? Roles are named gro 0s of related 0ri*ileges that are granted to sers or other roles. 11;. What are the ses of Roles? R-D.2-D +RA%!I%+ :? HRIBI)-+-S / Rather than e>0licitly granting the same set of 0ri*ileges to many sers a database administrator can grant the 0ri*ileges for a gro 0 of related sers granted to a role and then grant only the role to each member of the gro 0. DI%AMI2 HRIBI)-+- MA%A+-M-%! / When the 0ri*ileges of a gro 0 m st change7 only the 0ri*ileges of the role need to be modified. !he sec rity domains of all sers granted the gro 0Fs role a tomatically reflect the changes made to the role. S-)-2!IB- ABAI)ABI)I!I :? HRIBI)-+-S / !he roles granted to a ser can be selecti*ely enable Ca*ailable for seD or disabled Cnot a*ailable for seD. !his allows s0ecific control of a serFs 0ri*ileges in any gi*en sit ation. AHH)I2A!I:% AWAR-%-SS / A database a00lication can be designed to a tomatically enable and disable selecti*e roles when a ser attem0ts to se the a00lication. 1$<. "ow to 0re*ent na thoriMed se of 0ri*ileges granted to a Role? By creating a Role with a 0assword. 1$1. What is defa lt table s0ace? !he !able s0ace to contain schema ob6ects created witho t s0ecifying a table s0ace name. 1$$. What is !able s0ace ( ota? !he collecti*e amo nt of dis& s0ace a*ailable to the ob6ects in a schema on a 0artic lar table s0ace. 1$'. What is a 0rofile? -ach database ser is assigned a Hrofile that s0ecifies limitations on *ario s system reso rces a*ailable to the ser. 1$1. What are the system reso rces that can be controlled thro gh Hrofile? !he n mber of conc rrent sessions the ser can establish the 2H. 0rocessing time a*ailable to the serFs session the 2H. 0rocessing time a*ailable to a single call to :RA2)- made by a S() statement the amo nt of logical IL: a*ailable to the serFs session the amo nt of logical IL: a*ailable to a single call to :RA2)- made by a S() statement the allowed amo nt of idle time for the serFs session the allowed amo nt of connect time for the serFs session. 1$3. What is A diting? Monitoring of ser access to aid in the in*estigation of database se. 1$4. What are the different )e*els of A diting? Statement A diting7 Hri*ilege A diting and :b6ect A diting. 1$8. What is Statement A diting?

Statement a diting is the a diting of the 0owerf l system 0ri*ileges witho t regard to s0ecifically named ob6ects. 1$9. What is Hri*ilege A diting? Hri*ilege a diting is the a diting of the se of 0owerf l system 0ri*ileges witho t regard to s0ecifically named ob6ects. 1$;. What is :b6ect A diting? :b6ect a diting is the a diting of accesses to s0ecific schema ob6ects witho t regard to ser. DIS!RIB.!-D HR:2-SSI%+ A%D DIS!RIB.!-D DA!ABAS-S 1'<. What is distrib ted database? A distrib ted database is a networ& of databases managed by m lti0le database ser*ers that a00ears to a ser as single logical database. !he data of all databases in the distrib ted database can be sim ltaneo sly accessed and modified. 1'1. What is !wo/Hhase 2ommit? !wo/0hase commit is mechanism that g arantees a distrib ted transaction either commits on all in*ol*ed nodes or rolls bac& on all in*ol*ed nodes to maintain data consistency across the global distrib ted database. It has two 0hases7 a Hre0are Hhase and a 2ommit Hhase. 1'$. Describe two 0hases of !wo/0hase commit? Hre0are 0hase / !he global coordinator Cinitiating nodeD as& a 0artici0ants to 0re0are rollbac& the transaction7 e*en if there is a fail reD Cto 0romise to commit or

2ommit / Hhase / If all 0artici0ants res0ond to the coordinator that they are 0re0ared7 the coordinator as&s all nodes to commit the transaction7 if all 0artici0ants cannot 0re0are7 the coordinator as&s all nodes to roll bac& the transaction. 1''. What is the mechanism 0ro*ided by :RA2)- for table re0lication? Sna0shots and S%AHS":! ):+s 1'1. What is a S%AHS":!? Sna0shots are read/only co0ies of a master table located on a remote node which is 0eriodically refreshed to reflect changes made to the master table. 1'3. What is a S%AHS":! ):+? A sna0shot log is a table in the master database that is associated with the master table. :RA2)- ses a sna0shot log to trac& the rows that ha*e been 0dated in the master table. Sna0shot logs are sed in 0dating the sna0shots based on the master table. 1'4. What is a S() G %-!? S() G%-! is :racle@s mechanism for interfacing with the comm nication 0rotocols sed by the networ&s that facilitate distrib ted 0rocessing and distrib ted databases. It is sed in 2lint/Ser*er and Ser*er/Ser*er comm nications. DA!ABAS- :H-RA!I:%7 BA2J.H A%D R-2:B-RI 1'8. What are the ste0s in*ol*ed in Database Start 0? Start an instance7 Mo nt the Database and :0en the Database. 1'9. What are the ste0s in*ol*ed in Database Sh tdown? 2lose the Database7 Dismo nt the Database and Sh tdown the Instance. 1';. What is Restricted Mode of Instance Start 0? An instance can be started in Cor later altered to be inD restricted mode so that when the database is o0en connections are limited only to those whose ser acco nts ha*e been granted the R-S!RI2!-D S-SSI:% system 0ri*ilege. 11<. What are the different modes of mo nting a Database with the Harallel Ser*er? ->cl si*e Mode If the first instance that mo nts a database does so in e>cl si*e mode7 only that Instance can mo nt the database. Harallel Mode If the first instance that mo nts a database is started in 0arallel mode7 other instances that are started in 0arallel mode can also mo nt the database. 111. What is ? ll Bac& 0? A f ll bac& 0 is an o0erating system bac& 0 of all data files7 on/line redo log files and control file that constit te :RA2)- database and the 0arameter. 11$. 2an ? ll Bac& 0 be 0erformed when the database is o0en?

%o. 11'. What is Hartial Bac& 0? A Hartial Bac& 0 is any o0erating system bac& 0 short of a f ll bac& 07 ta&en while the database is o0en or sh t down. 111.Whatis:n/lineRedo)og? !he :n/line Redo )og is a set of tow or more on/line redo files that record all committed changes made to the database. Whene*er a transaction is committed7 the corres0onding redo entries tem0orarily stores in redo log b ffers of the S+A are written to an on/line redo log file by the bac&gro nd 0rocess )+WR. !he on/line redo log files are sed in cyclical fashion. 113. What is mirrored on/line Redo )og? A mirrored on/line redo log consists of co0ies of on/line redo log files 0hysically located on se0arate dis&s7 changes made to one member of the gro 0 are made to all members. 114. What is Archi*ed Redo )og? Archi*ed Redo )og consists of Redo )og files that ha*e archi*ed before being re sed.

118. What are the ad*antages of o0erating a database in AR2"IB-):+ mode o*er o0erating it in %: AR2"IB-):+ mode? 2om0lete database reco*ery from dis& fail re is 0ossible only in AR2"IB-):+ mode. :nline database bac& 0 is 0ossible only in AR2"IB-):+ mode. 119. What is )og Switch? !he 0oint at which :RA2)- ends writing to one online redo log file and begins writing to another is called a log switch. 11;. What are the ste0s in*ol*ed in Instance Reco*ery? R5olling forward to reco*er data that has not been recorded in data files yet has been recorded in the on/line redo log7 incl ding the contents of rollbac& segments. Rolling bac& transactions that ha*e been e>0licitly rolled bac& or ha*e not been committed as indicated by the rollbac& segments regenerated in ste0 a. Releasing any reso rces Cloc&sD held by transactions in 0rocess at the time of the fail re. Resol*ing any 0ending distrib ted transactions ndergoing a two/0hase commit at the time of the instance fail re. Data Base Administration Introd ction to DBA 1. What is a Database instance? ->0lain A database instance CSer*erD is a set of memory str ct re and bac&gro nd 0rocesses that access a set of database files. !he 0rocess can be shared by all sers. !he memory str ct re that are sed to store most = eried data from database. !his hel0s 0 to im0ro*e database 0erformance by decreasing the amo nt of IL: 0erformed against data file. $. What is Harallel Ser*er? M lti0le instances accessing the same database C:nly In M lti/2H. en*ironmentsD '. What is a Schema? !he set of ob6ects owned by ser acco nt is called the schema. 1. What is an Inde>? "ow it is im0lemented in :racle Database? An inde> is a database str ct re sed by the ser*er to ha*e direct access of a row in a table. An inde> is a tomatically created when a ni= e of 0rimary &ey constraint cla se is s0ecified in create table comman CBer 8.<D 3. What are cl sters?

+ro 0 of tables 0hysically stored together beca se they share common col mns and are often sed together is called 2l ster. 4. What is a cl ster Jey? !he related col mns of the tables are called the cl ster &ey. !he cl ster &ey is inde>ed sing a cl ster inde> and its *al e is stored only once for m lti0le tables in the cl ster. 8. What is the basic element of Base config ration of an oracle Database? It consists of :ne or more data files. :ne or more control files. !wo or more redo log files. !he Database contains M lti0le sersLschemas :ne or more rollbac& segments :ne or more table s0aces Data dictionary tables .ser ob6ects Ctable7 inde>es7 *iews etc.7D !he ser*er that access the database consists of S+A CDatabase b ffer7 Dictionary 2ache B ffers7 Redo log b ffers7 Shared S() 0oolD SM:% CSystem M:%itoD HM:% CHrocess M:%itorD )+WR C)o+ WriteD DBWR CData Base WriteD AR2" CAR2"i*erD 2JH! C2hec& HointD R-2: Dis0atcher .ser Hrocess with associated H+S 9. What is a deadloc&? ->0lain. !wo 0rocesses waiting to 0date the rows of a table7 which are loc&ed7 by the other 0rocess then deadloc& arises. In a database en*ironment this will often ha00en beca se of not iss ing 0ro0er rowloc& commands. Hoor design of front/end a00lication may ca se this sit ation and the 0erformance of ser*er will red ce drastically. !hese loc&s will be released a tomatically when a commitLrollbac& o0eration 0erformed or any one of this 0rocesses being &illed e>ternally. M-M:RI MA%A+-M-%! ;. What is S+A? "ow it is different from Ber 4.< and Ber 8.<? !he System +lobal Area in a :racle database is the area in memory to facilitates the transfer of information between sers. It holds the most recently re= ested str ct ral information between sers. It holds the most recently re= ested str ct ral information abo t the database. !he str ct re is Database b ffers7 Dictionary cache7 Redo )og B ffer and Shared S() 0ool C*er 8.< onlyD area. 1<. What is a Shared S() 0ool? !he data dictionary cache is stored in an area in S+A called the Shared S() Hool. !his will allow sharing of 0arsed S() statements among conc rrent sers. 11. What is mean by Hrogram +lobal Area CH+AD? It is area in memory that is sed by a Single :racle .ser Hrocess. 1$. What is a data segment? Data segment are the 0hysical areas within a database bloc& in which the data associated with tables and cl sters are stored.

1'. What are the factors ca sing the re0arsing of S() statements in S+A? D e to ins fficient Shared S() 0ool siMe. Monitor the ratio of the reloads ta&es 0lace while e>ec ting S() statements. If the ratio is greater than 1 then increase the S"AR-D5H::)5SIU-. ):+I2A) & H"ISI2A) AR2"I!-2!.R- :? DA!ABAS-. 11. What is Database B ffers? Database b ffers are cache in the S+A sed to hold the data bloc&s that are read from the data segments in the database s ch as tables7 inde>es and cl sters DB5B):2J5B.??-RS 0arameter in I%I!.:RA decides the siMe. 13. What is dictionary cache? Dictionary cache is information abo t the database ob6ects stored in a data dictionary table. 14. What is meant by rec rsi*e hints? % mber of times 0rocesses re0eatedly = ery the dictionary table is called rec rsi*e hints. It is d e to the data dictionary cache is too small. By increasing the S"AR-D5H::)5SIU- 0arameter we can o0timiMe the siMe of Data Dictionary 2ache. 18. What is meant by redo log b ffer? 2hanges made to entries are written to the on/line redo log files. So that they can be sed in roll forward o0erations d ring database reco*eries. Before writing them into the redo log files7 they will first bro ght to redo log b ffers in S+A and )+WR will write into files fre= ently. ):+5B.??-R 0arameter will decide the siMe. 19. "ow will yo swa0 ob6ects into a different table s0ace for an e>isting database? ->0ort the ser Herform im0ort sing the command im0 systemLmanager definitions into newfile.s=l. Dro0 necessary ob6ects. R n the scri0t newfile.s=l after altering the tables0aces. Im0ort from the bac& 0 for the necessary ob6ects. 1;. )ist the :0tional ?le>ible Architect re C:?AD of :racle database? :r how can we organiMe the table s0aces in :racle database to ha*e ma>im m 0erformance? SIS!-M / Data dictionary tables. DA!A / Standard o0erational tables. DA!A$/ Static tables sed for standard o0erations I%D-E-S / Inde>es for Standard o0erational tables. I%D-E-S1 / Inde>es of static tables sed for standard o0erations. !::)S / !ools table. !::)S1 / Inde>es for tools table. RBS / Standard :0erations Rollbac& Segments7 RBS17 RBS$ / AdditionalLS0ecial Rollbac& segments. !-MH / !em0orary 0 r0ose table s0ace !-MH5.S-R / !em0orary table s0ace for sers. .S-RS / .ser table s0ace. $<. "ow will yo force database to se 0artic lar rollbac& segment? S-! !RA%SA2!I:% .S- R:))BA2J S-+M-%! rbs5name. $1. What is meant by free e>tent? A free e>tent is a collection of contin o s free bloc&s in table s0ace. When a segment is dro00ed its e>tents are reallocated and are mar&ed as free. $$. "ow free e>tents are managed in Ber 4.< and Ber 8.<? file#e>0ort.dm0 inde>file#newrite.s=l. !his will create all

?ree e>tents cannot be merged together in Ber 4.<. ?ree e>tents are 0eriodically coalesces with the neighboring free e>tent in Ber 8.< $'.Which 0arameter in Storage cla se will red ce no. of rows 0er bloc&? H2!?R-- 0arameter Row siMe also red ces no of rows 0er bloc&. $1. What is the significance of ha*ing storage cla se? We can 0lan the storage for a table as how m ch initial e>tents are re= ired7 how m ch can be e>tended ne>t7 how m ch N sho ld lea*e free for managing row 0dations etc.7 $3. "ow does S0ace allocation table 0lace within a bloc&? -ach bloc& contains entries as follows ?i>ied bloc& header Bariable bloc& header Row "eader7row date Cm lti0le rows may e>istsD H2!-R-- CN of free s0ace for row 0dation in f t reD $4. What is the role of H2!?R-- 0arameter is Storage cla se? !his is sed to reser*e certain amo nt of s0ace in a bloc& for e>0ansion of rows. $8. What is the :H!IMA) 0arameter? It is sed to set the o0timal length of a rollbac& segment. $9. What is the f nctionality of SIS!-M table s0ace? !o manage the database le*el transactions s ch as modifications of the data dictionary table that record information abo t the free s0ace sage. $;. "ow will yo create m lti0le rollbac& segments in a database? 2reate a database that im0licitly creates a SIS!-M Rollbac& Segment in a SIS!-M table s0ace. 2reate a Second Rollbac& Segment name R< in the SIS!-M table s0ace. Ma&e new rollbac& segment a*ailable CAfter sh tdown7 modify init.ora file and Start databaseD 2reate other tables0aces CRBSD for rollbac& segments. Deacti*ate Rollbac& Segment R< and acti*ate the newly created rollbac& segments. '<. "ow the s0ace tilisation ta&es 0lace within rollbac& segments? It will try to fit the transaction in a cyclic fashion to all e>isting e>tents. :nce it fo nd an e>tent is in se then it forced to ac= ire a new e>tent C%o. of e>tents is based on the o0timal siMeD '1. Why = ery fails sometimes? Rollbac& segment dynamically e>tent to handle larger transactions entry loads. A single transaction may wi0eo t all a*ailable free s0ace in the Rollbac& Segment !ables0ace. !his 0re*ents other ser sing Rollbac& segments. '$. "ow will yo monitor the s0ace allocation? By = ering DBA5S-+M-%! tableL*iew. ''. "ow will yo monitor rollbac& segment stat s? ( erying the DBA5R:))BA2J5S-+S *iew

I% .S/ Rollbac& Segment is on/line. ABAI)AB)- / Rollbac& Segment a*ailable b t not on/line. :??/)I%- / Rollbac& Segment off/line I%BA)ID / Rollbac& Segment Dro00ed. %--DS R-2:B-RI / 2ontains data b t need reco*ery or corr 0ted. HAR!)I ABAI)AB)- / 2ontains data from an nresol*ed transaction in*ol*ing a distrib ted database. '1. )ist the se= ence of e*ents when a large transaction that e>ceeds beyond its o0timal *al e when an entry wra0s and ca ses the rollbac& segment to e>0and into another e>tend. !ransaction Begins. An entry is made in the R-S header for new transactions entry !ransaction ac= ires bloc&s in an e>tent of RBS !he entry attem0ts to wra0 into second e>tent. %one is a*ailable7 so that the RBS m st e>tent. !he RBS chec&s to see if it is 0art of its :H!IMA) siMe. RBS chooses its oldest inacti*e segment. :ldest inacti*e segment is eliminated. RBS e>tents !he Data dictionary table for s0ace management is 0dated. !ransaction 2om0letes. '3. "ow can we 0lan storage for *ery large tables? )imit the n mber of e>tents in the table Se0arate !able from its inde>es. Allocate s fficient tem0orary storage. '4. "ow will yo estimate the s0ace re= ired by a non/cl stered table? 2alc 2alc 2alc 2alc 2alc 2alc late the total header siMe late the a*ailable data s0ace 0er data bloc& late the combined col mn lengths of the a*erage row late the total a*erage row siMe. late the a*erage n mber rows that can fit in a bloc& late the n mber of bloc&s and bytes re= ired for the table.

After arri*ing the calc lation7 add 1< N additional s0ace to calc late the initial e>tent siMe for a wor&ing table. '8. It is 0ossible to se raw de*ices as data files and what are the ad*antages o*er file. System files? Ies. !he ad*antages o*er file system files. IL: will be im0ro*ed beca se :racle is bye/0assing the &ernnel which writing into dis&. Dis& 2orr 0tion will be *ery less. '9. What is a 2ontrol file? DatabaseFs o*erall 0hysical architect re is maintained in a file called control file. It will be sed to maintain internal consistency and g ide reco*ery o0erations. M lti0le co0ies of control files are ad*isable. ';. "ow to im0lement the m lti0le control files for an e>isting database? Sh tdown the database 2o0y one of the e>isting control files to new location -dit 2onfig ora file by adding new control file.name Restart the database. 1<. What is meant by Redo )og file mirrorring ? "ow it can be achie*ed? Hrocess of ha*ing a co0y of redo log files is called mirroring.

!his can be achie*ed by creating gro 0 of log files together7 so that )+WR will a tomatically writes them to all the members of the c rrent on/line redo log gro 0. If any one gro 0 fails then database a tomatically switch o*er to ne>t gro 0. It degrades 0erformance. 11. What is ad*antage of ha*ing dis& shadowingL mirroring? Shadow set of dis&s sa*e as a bac& 0 in the e*ent of dis& fail re. In most :0erating System if any dis& fail re occ rs it a tomatically switcho*er to 0lace of failed dis&. Im0ro*ed 0erformance beca se most :S s 00ort *ol me shadowing can direct file IL: re= est to se the shadow set of files instead of the main set of files. !his red ces IL: load on the main set of dis&s. 1$. What is se of Rollbac& Segments In Database? !hey allow the database to maintain read consistency between m lti0le transactions. 1'. What is a Rollbac& segment entry? It is the set of before image data bloc&s that contain rows that are modified by a transaction. -ach Rollbac& Segment entry m st be com0leted within one rollbac& segment. A single rollbac& segment can ha*e m lti0le rollbac& segment entries. 11. What is hit ratio? It is a meas re of well the data cache b ffer is handling re= ests for data. "it Ratio # C)ogical Reads / Hhysical Reads / "its MissesDL )ogical Reads. 13. When will be a segment released? When Segment is dro00ed. When Shrin& CRBS onlyD When tr ncated C!R.%2A!- sed with dro0 storage o0tionD 14. What are disad*antages of ha*ing raw de*ices? We sho ld de0end on e>0ortLim0ort tility for bac& 0Lreco*ery Cf lly reliableD !he tar command cannot be sed for 0hysical file bac& 07 instead we can se dd command7 which is less fle>ible and has limited reco*eries. 18. )ist the factors that can affect the acc racy of the estimations? !he s0ace sed transaction entries and deleted records do not become free immediately after com0letion d e to delayed cleano t. !railing n lls and length bytes are not stored. Inserts of7 0dates to and deletes of rows as well as col mns larger than a single data bloc&7 can ca se fragmentation a chained row 0ieces. DA!ABAS- S-2.RI!I & ADMI%IS!RA!I:% 19. What is ser Acco nt in :racle database? A ser acco nt is not a 0hysical str ct re in Database b t it is ha*ing im0ortant relationshi0 to the ob6ects in the database and will be ha*ing certain 0ri*ileges. 1;. "ow will yo enforce sec rity sing stored 0roced res ? DonFt grant ser access directly to tables within the a00lication. Instead grant the ability to access the 0roced res that access the tables. When 0roced re e>ec ted it will e>ec te the 0ri*ilege of 0roced res owner. .sers cannot access tables e>ce0t *ia the 0roced re.

3<. What are the dictionary tables sed to monitor a database s0aces ? DBA5?R--5SHA2DBA5S-+M-%!S DBA5DA!A5?I)-S. 31. What are the res0onsibilities of a Database Administrator ? Installing and 0grading the :racle Ser*er and a00lication tools. Allocating system storage and 0lanning f t re storage re= irements for the database system. Managing 0rimary database str ct res Ctables0acesD Managing 0rimary ob6ects Ctable7*iews7inde>esD -nrolling sers and maintaining system sec rity. -ns ring com0liance with :ralce license agreement 2ontrolling and monitoring ser access to the database. Monitoring and o0timising the 0erformance of the database. Hlanning for bac& 0 and reco*ery of database information. Maintain archi*ed data on ta0e Bac&ing 0 and restoring the database. 2ontacting :racle 2or0oration for technical s 00ort. 3$. What are the roles and ser acco nts created a tomatically with the database ? DBA / role 2ontains all database system 0ri*ileges. SIS ser acco nt / !he DBA role will be assigned to this acco nt. All of the basetables and *iews for the databaseFs dictionary are store in this schema and are mani0 lated only by :RA2)-. SIS!-M ser acco nt / It has all the system 0ri*ileges for the database and additional tables and *iews that dis0lay administrati*e information and internal tables and *iews sed by oracle tools are created sing this sername. 31. What are the database administrators tilities a*aliable ? S() G DBA / !his allows DBA to monitor and control an :RA2)- database. S() G )oader / It loads data from standard o0erating system files C?lat filesD into :RA2)- database tables. ->0ort C-EHD and Im0ort Cim0D tilities allow yo to mo*e e>isting data in :RA2)- format to and from :RA2)database. 33. What are the minim m 0arameters sho ld e>ist in the 0arameter file Cinit.oraD ? DB %AM- / M st set to a te>t string of no more than 9 characters and it will be stored inside the datafiles7 redo log files and control files and control file while database creation. DB5D:MAI% / It is string that s0ecifies the networ& domain where the database is created. !he global database name is identified by setting these 0arameters CDB5%AM- & DB5D:MAI%D 2:%!:R) ?I)-S / )ist of control filenames of the database. If name is not mentioned then defa lt name will be sed. DB5B):2J5B.??-RS / !o determine the no of b ffers in the b ffer cache in S+A. HR:2-SS-S / !o determine n mber of o0erating system 0rocesses that can be connected conc rrently. !he *al e sho ld be 3 Cbac&gro nd 0rocessD and additional 1 for each ser. to :RA2)-

R:))BA2J5S-+M-%!S / )ist of rollbac& segments an :RA2)- instance ac= ires at database start 0. Also o0tionally )I2-%S-5MAE5S-SSI:%S7)I2-%S-5S-SSI:%5WAR%I%+ and )I2-%S-5MAE5.S-RS.

34. What is a trace file and how is it created ? -ach ser*er and bac&gro nd 0rocess can write an associated trace file. When an internal error is detected by a 0rocess or ser 0rocess7 it d m0s information abo t the error to its trace. !his can be sed for t ning the database. 38. What are roles ? "ow can we im0lement roles ? Roles are the easiest way to grant and manage common 0ri*ileges needed by different gro 0s of database sers.

2reating roles and assigning 0ro*ies to roles. Assign each role to gro 0 of sers. !his will sim0lify the 6ob of assigning 0ri*ileges to indi*id al sers. 39. What are the ste0s to switch a databaseFs archi*ing mode between mode ? 1. Sh tdown the database instance. $. Bac& 0 the databse '. Herform any o0erating system s0ecific ste0s Co0tionalD 1. Start 0 a new instance and mo nt b t do not o0en the databse. 3. Switch the databseFs archi*ing mode. 3;. "ow can yo enable a tomatic archi*ing ? Sh t the database Bac& 0 the database ModifyLIncl de ):+5AR2"IB-5S!AR!5!R.- in init.ora file. Start 0 the databse. 4<. "ow can we s0ecify the Archi*ed log file name format and destination ? By setting the following *al es in init.ora file. ):+5AR2"IB-5?:RMA! # arch NSLsL!Ltarc CNS / )og se= ence n mber and is Mero left 0aded7 Ns / )og se= ence n mber not 0added. N! / !hread n mber lef/Mero/0aded and Nt / !hread n mber not 0addedD. !he file name created is arch <<<1 are if NS is sed. ):+5AR2"IB-5D-S! # 0ath. 41. What is the se of A%A)IU- command ? !o 0erform one of these f nction on an inde>7table7 or cl ster: / to collect statisties abo t ob6ect sed by the o0timiMer and store them in the data / to delete statistics abo t the ob6ect sed by ob6ect from the data dictionary. / to *alidate the str ct re of the ob6ect. / to identify migrated and chained rows of the table or cl ster. MA%A+I%+ DIS!RIB.!-D DA!ABAS-S. 4$. "ow can we red ce the networ& traffic ? / Re0lictaion of data in distrib ted en*ironment. / .sing sna0shots to re0licate data. / .sing remote 0roced re calls. 4'. What is sna0shots ? Sna0shot is an ob6ect sed to dynamically re0licate data between distrib te database at s0ecified time inter*als. In *er 8.< they are read only. 41. What are the *ario s ty0e of sna0shots ? Sim0le and 2om0le>. 43. Differentiate sim0le and com0le>7 sna0shots ? / A sim0le sna0shot is based on a = ery that does not contains +R:.H BI cla ses7 2:%%-2! BI cla ses7 V:I%s7 s b/= ery or snashot of o0erations. / A com0le> sna0shots contain atleast any one of the abo*e. 44. What dynamic data re0lication ? .0dating or Inserting records in remote database thro gh database triggers. It may fail if remote database is ha*ing any 0roblem. 48. "ow can yo -nforce Refrencial Integrity in sna0shots ? !ime the references to occ r when master tables are not in se. dictionary. %: AR2"IB-):+ and AR2"IB-):+

Heform the reference the man ally immdiately loc&ing the master tables. We can 6oin tables in sno0shots by creating a com0le> sna0shots that will based on the master tables. 49. What are the o0tions a*ailable to refresh sna0shots ? 2:MH)-!- / !ables are com0letly regenerated sing the sna0shotFs = ery and the master tables e*ery time the sna0shot referenced. ?AS! / If sim0le sna0shot sed then a sna0shot log can be sed to send the changes to the sna0shot tables. ?:R2- / Defa lt *al e. If 0ossible it 0erforms a ?AS! refreshK :therwise it will 0erform a com0lete refresh. 4;. what is sna0shot log ? It is a table that maintains a record of modifications to the master table in a sna0shot. It is stored in the same database as master table and is only a*ailable for sim0le sna0shots. It sho ld be created before creating sna0shots. 8<. When will the data in the sna0shot log be sed ? We m st be able to create a after row trigger on table Ci.e.7 it sho ld be not be already a*ailable D After gi*ing table 0ri*ileges. We cannot s0ecify sna0shot log name beca se oracle ses the name of the master table in the name of the database ob6ects that s 00ort its sna0shot log. !he master table name sho ld be less than or e= al to $' characters. C!he table name created will be M):+S5tablename7 and trigger name will be !):+S nameD. 8$. What are the benefits of distrib ted o0tions in databases ? Database on other ser*ers can be 0dated and those transactions can be gro 0ed together with others in a logical nit. Database ses a two 0hase commit. MA%A+I%+ BA2J.H & R-2:B-RI 8'. What are the different methods of bac&ing 0 oracle database ? / )ogical Bac& 0s / 2old Bac& 0s / "ot Bac& 0s CArchi*e logD 81. What is a logical bac& 0 ? )ogical bac& 0 in*ol*es reading a set of databse records and writing them into a file. ->0ort tility is sed for ta&ing bac& 0 and Im0ort tility is sed to reco*er from bac& 0. 83. What is cold bac& 0 ? What are the elements of it ? 2old bac& 0 is ta&ing bac& 0 of all 0hysical files after normal sh tdown of database. We need to ta&e. / All Data files. / All 2ontrol files. / All on/line redo log files. / !he init.ora file C:0tionalD 84. What are the different &ind of e>0ort bac& 0s ? ? ll bac& / 2om0lete database Incremental / :nly affected tables from last incremental dateLf ll bac& 0 date. 2 m lati*e bac& 0 / :nly affected table from the last c m lati*e dateLf ll bac& 0 date. 88. What is hot bac& 0 and how it can be ta&en ? !a&ing bac& 0 of archi*e log files when database is o0en. ?or this the AR2"IB-):+ mode sho ld be enabled. !he following files need to be bac&ed 0. All data files. All Archi*e log7 redo log files. All control files. 89. What is the se of ?I)- o0tion in -EH command ?

!o gi*e the e>0ort file name. 8;. What is the se of 2:MHR-SS o0tion in -EH command ? ?lag to indicate whether e>0ort sho ld com0ress fragmented segments into single e>tents. 9<. What is the se of +RA%! o0tion in -EH command ? A flag to indicate whether grants on databse ob6ects will be e>0orted or not. Bal e is FIF or F%F. 91. What is the se of I%D-E-S o0tion in -EH command ? A flag to indicate whether inde>es on tables will be e>0orted. 9$. What is the se of R:WS o0tion in -EH command ? ?lag to indicate whether table rows sho ld be e>0orted. If F%F only DD) statements for the databse ob6ects will be created. 9'. What is the se of 2:%S!RAI%!S o0tion in -EH command ? A flag to indicate whether constraints on table need to be e>0orted. 91. What is the se of ?.)) o0tion in -EH command ? A flag to indicate whether f ll databse e>0ort sho ld be 0erformed. 93. What is the se of :W%-R o0tion in -EH command ? )ist of table acco nts sho ld be e>0orted. 94. What is the se of !AB)-S o0tion in -EH command ? )ist of tables sho ld be e>0orted. 98. What is the se of R-2:RD )-%+!" o0tion in -EH command ? Record length in bytes. 99. What is the se of I%2!IH- o0tion in -EH command ? !y0e e>0ort sho ld be 0erformed 2:MH)-!-72.M.)A!IB-7I%2R-M-%!A). 9;. What is the se of R-2:RD o0tion in -EH command ? ?or Incremental e>0orts7 the flag indirects whether a record will be stores data dictionary tables recording the e>0ort. ;<. What is the se of HAR?I)- o0tion in -EH command ? %ame of the 0arameter file to be 0assed for e>0ort. ;1. What is the se of HAR?I)- o0tion in -EH command ? %ame of the 0arameter file to be 0assed for e>0ort. ;$. What is the se of A%A)IS- C Ber 8D o0tion in -EH command ? A flag to indicate whether statistical information abo t the e>0orted ob6ects sho ld be written to e>0ort d m0 file. ;'. What is the se of 2:%SIS!-%! CBer 8D o0tion in -EH command ? A flag to indicate whether a read consistent *ersion of all the e>0orted ob6ects sho ld be maintained. ;1. What is se of ):+ CBer 8D o0tion in -EH command ? !he name of the file which log of the e>0ort will be written. ;3.What is the se of ?I)- o0tion in IMH command ?

!he name of the file from which im0ort sho ld be 0erformed. ;4. What is the se of S":W o0tion in IMH command ? A flag to indicate whether file content sho ld be dis0layed or not. ;8. What is the se of I+%:R- o0tion in IMH command ? A flag to indicate whether the im0ort sho ld ignore errors enco nter when iss ing 2R-A!- commands. ;9. What is the se of +RA%! o0tion in IMH command ? A flag to indicate whether grants on database ob6ects will be im0orted. ;;. What is the se of I%D-E-S o0tion in IMH command ? A flag to indicate whether im0ort sho ld im0ort inde> on tables or not. 1<<. What is the se of R:WS o0tion in IMH command ? A flag to indicate whether rows sho ld be im0orted. If this is set to F%F then only DD) for database ob6ects will be e>ect ed. S() H).S S!A!-M-%!S 1. What are the ty0es of S() Statement? Data Definition )ang age: 2R-A!-7 A)!-R7 DR:H7 !R.%2A!-7 R-B:J-7 %: A.DI! & 2:MMI!. Data Mani0 lation )ang age: I%S-R!7 .HDA!-7 D-)-!-7 ):2J !AB)-7 -EH)AI% H)A% & S-)-2!. !ransactional 2ontrol: 2:MMI! & R:))BA2J Session 2ontrol: A)!-RS-SSI:% & S-! R:)System 2ontrol: A)!-R SIS!-M. $. What is a transaction? !ransaction is logical nit between two commits and commit and rollbac&. '. What is difference between !R.%2A!- & D-)-!-? !R.%2A!- commits after deleting entire table i.e.7 can@t be rolled bac&. Database triggers do not fire on !R.%2A!D-)-!- allows the filtered deletion. Deleted records can be rolled bac& or committed. Database triggers fire on D-)-!-. 1. What is a 6oin? ->0lain the different ty0es of 6oins? Voin is a = ery7 which retrie*es related col mns or rows from m lti0le tables. Self Voin / Voining the table with itself. -= i Voin / Voining two tables by e= ating two common col mns. %on/-= i Voin / Voining two tables by e= ating two common col mns. : ter Voin / Voining two tables in s ch a way that = ery can also retri*e rows that do not ha*e corres0onding 6oin *al e in the other table. 3. What is the S b= ery? S b= ery is a = ery whose ret rn *al es are sed in filtering conditions of the main = ery. 4. What is correlated s b/= ery? 2orrelated s b5= ery is a s b5= ery7 which has reference to the main = ery. 8. ->0lain 2onnect by Hrior? Retri*es rows in hierarchical order. e.g. select em0no7 ename from em0 where.

9. Difference between S.BS!R and I%S!R? I%S!R CString17 String $Cn7 CmDD7 I%S!R ret rns the 0osition of the mth occ rrence of the string $ in String1. !he search begins from nth 0osition of string1. S.BS!R CString1 n7mD S.BS!R ret rns a character string of siMe m in string17 starting from nth 0ostion of string1. ;. ->0lain .%I:%7 MI%.S7 .%I:% A))7 I%!-RS-2!? I%!-RS-2! ret rns all distinct rows selected by both = eries. MI%.S / ret rns all distinct rows selected by the first = ery b t not by the second. .%I:% / ret rns all distinct rows selected by either = ery .%I:% A)) / ret rns all rows selected by either = ery7incl ding all d 0licates. 1<. What is R:WID? R:WID is a 0se do col mn attached to each row of a table. It is 19character long7 bloc& no7 row n mber are the com0onents of R:WID. 11. What is the fastest way of accessing a row in a table? .sing R:WID. 2:%S!RAI%!S ////////////////////// 1$. What is an Integrity 2onstraint? Integrity constraint is a r le that restricts *al es to a col mn in a table. 1'. What is Referential Integrity? Maintaining data integrity thro gh a set of r les that restrict the *al es of one or more col mns of the tables based on the *al es of 0rimary &ey or ni= e &ey of the referenced table. 11. What are the sages of SAB-H:I%!S? SAB-H:I%!S are sed to s bdi*ide a transaction into smaller 0arts. It enables rolling bac& 0art of a transaction. Ma>im m of fi*e sa*e 0oints are allowed. 13. What is :% D-)-!- 2AS2AD-? When :% D-)-!- 2AS2AD- is s0ecified :RA2)- maintains referential integrity by a tomatically remo*ing de0endent foreign &ey *al es if a referenced 0rimary or ni= e &ey *al e is remo*ed. 14. What are the data ty0es allowed in a table? 2"AR7 BAR2"AR$7 %.MB-R7 DA!-7 RAW7 ):%+ and ):%+ RAW. 18. What is difference between 2"AR and BAR2"AR$? What is the ma>im m SIU- allowed for each ty0e?

2"AR 0ads blan& s0aces to the ma>im m length. BAR2"AR$ does not 0ad blan& s0aces. ?or 2"AR it is $33 and $<<< for BAR2"AR$. 19. "ow many ):%+ col mns are allowed in a table? Is it 0ossible to se ):%+ col mns in W"-R- cla se or :RD-R BI? :nly one ):%+ col mns is allowed. It is not 0ossible to se ):%+ col mn in W"-R- or :RD-R BI cla se. 1;. What are the 0re re= isites? I. !o modify data ty0e of a col mn? ii. !o add a col mn with %:! %.)) constraint? !o modify the dataty0e of a col mn the col mn m st be em0ty. !o add a col mn with %:! %.)) constrain7 the table m st be em0ty. $<. Where the integrity constrints are stored in Data Dictionary?

!he integrity constraints are stored in .S-R52:%S!RAI%!S. $1. "ow will yo a acti*ateLdeacti*ate integrity constraints? !he integrity constraints can be enabled or disabled by A)!-R !AB)- -%AB)- constraintLDISAB)- constraint. $$. If an ni= e &ey constraint on DA!- col mn is created7 will it *alidate the rows that are inserted with SISDA!- ? It wonFt7 Beca se SISDA!- format contains time attached with it. $'. What is a database lin&? Database )in& is a named 0ath thro gh which a remote database can be accessed. $1. "ow to access the c rrent *al e and ne>t *al e from a se= ence? Is it 0ossible to access the c rrent *al e in a session before accessing ne>t *al e? Se= ence name 2.RRBA)7 Se= ence name %-E!BA). It is not 0ossible. :nly if yo access ne>t *al e in the session7 c rrent *al e can be accessed. $3. What is 2I2)-L%: 2I2)- in a Se= ence? 2I2)- s0ecifies that the se= ence contin es to generate *al es after reaching either ma>im m or minim m *al e. After 0an ascending se= ence reaches its ma>im m *al e7 it generates its minim m *al e. After a descending se= ence reaches its minim m7 it generates its ma>im m. %: 2I2)- s0ecifies that the se= ence cannot generate more *al es after reaching its ma>im m or minim m *al e. $4. What are the ad*antages of BI-W? !o 0rotect some of the col mns of a table from other sers. !o hide com0le>ity of a = ery. !o hide com0le>ity of calc lations. $8. 2an a *iew be 0datedLinsertedLdeleted? If Ies nder what conditions? A Biew can be 0datedLdeletedLinserted if it has only one base table if the *iew is based on col mns from one or more tables then insert7 0date and delete is not 0ossible. $9.If a Biew on a single base table is mani0 lated will the changes be reflected on the base table? If changes are made to the tables which are base tables of a *iew will the changes be reference on the *iew. 9OR)S 8.. BASIC 1.What is an S() G?:RMS? S() Gforms is 1+) tool for de*elo0ing and e>ec tingK :racle based interacti*e a00lication. $. What is the ma>im m siMe of a form? $33 character width and $33 characters )ength. '. %ame the two files that are created when yo generate the form gi*e the file e>tension? I%H CSo rce ?ileD ?RM C->ec table ?ileD 1. "ow do yo control the constraints in forms? Select the se constraint 0ro0erty is :% Bloc& definition screen. B):2J 3. 2ommitted bloc& sometimes refer to a BAS- !AB)-? !r e or ?alse. ?alse. 4. 2an we create two bloc&s with the same name in form '.<?

%o. 8. While s0ecifying masterLdetail relationshi0 between two bloc&s s0ecifying the 6oin condition is a m st? !r e or ?alse. !r e. 9. What is a !rigger? A 0iece of logic that is e>ec ted at or triggered by a S() Gforms e*ent. ;. What are the ty0es of !RI++-RS? 1. %a*igational !riggers. $. !ransaction !riggers. 1<. What are the different ty0es of &ey triggers? ? nction Jey Jey/f nction Jey/others Jey/start 0 11. What is the difference between a ? nction Jey !rigger and Jey ? nction !rigger? ? nction &ey triggers are associated with indi*id al S()G?:RMS f nction &eys Io can attach Jey f nction triggers to 1< &eys or &ey se= ences that normally do not 0erform any S() G ?:RMS o0erations. !hese &eys referred as &ey ?< thro gh &ey ?;. 1$. What does an on/clear/bloc& !rigger fire? It fires 6 st before S() G forms the c rrent bloc&. 1'. "ow do yo tra0 the error in forms '.<? .sing :n/Message or :n/-rror triggers. 11. State the order in which these triggers are e>ec ted? H:S!/?I-)D7 :%/BA)IDA!-/?I-)D7 H:S!/2"A%+- and J-I/%-E!?)D. J-I/%-E!?)D7 H:S!/2"A%+-7 :%/BA)IDA!-/?I-)D7 H:S!/?I-)D. 13. What is the sage of an :%/I%S-R!7:%/D-)-!- and :%/.HDA!- !RI++-RS ? !hese triggers are e>ec tes when inserting7 deleting and 0dating o0erations are change the defa lt f nction of insert7 delete or 0date res0ecti*ely. 0erformed and can be sed to

?or -.g.7 instead of inserting a row in a table an e>isting row can be 0dated in the same table. 14. When will :%/BA)IDA!-/?I-)D trigger e>ec ted? It fires when a *al e in a field has been changed and the field stat s is changed or new and the &ey has been 0ressed. If the field stat s is *alid then any f rther change to the *al e in the field will not fire the on/*alidate/field trigger. 18. A = ery fetched 1< records how many times do a HR-/(.-RI !rigger and H:S!/(.-RI !rigger will get e>ec ted? HR-/(.-RI fires once. H:S!/(.-RI fires 1< times. 19. What is the difference between :%/BA)IDA!-/?I-)D trigger and a H:S!/2"A%+- trigger? When yo changes the ->isting *al e to n ll7 the :n/*alidate field trigger will fire 0ost change trigger will not fire. At the time of e>ec te/= ery 0ost/change trigger will fire7 on/*alidate field trigger will not fire. 1;. What is the difference between an :%/BA)IDA!-/?I-)D trigger and a trigger?

:n/*alidate/field trigger fires7 when the field Balidation stat s %ew or changed. Host/field/trigger whene*er the control lea*ing form the field7 it will fire. $<. What is the difference between a H:S!/?I-)D trigger and a H:S!/2"A%+- trigger? Host/field trigger fires whene*er the control lea*ing from the filed. Host/change trigger fires at the time of e>ec te/= ery 0roced re in*o&ed or filed *alidation stat s changed. $1. When is HR-/(.-RI trigger e>ec ted? When ->ec te/= ery or co nt/= ery Hac&age 0roced res are in*o&ed. $$. +i*e the se= ence in which triggers fired d ring insert o0erations7 when the following ' triggers are defined at the same bloc& le*el? a. :%/I%S-R! b. H:S!/I%S-R! c. HR-/I%S-R! HR-/I%S-R!7 :%/I%S-R! & H:S!/I%S-R!. $'. 2an we se +:/B):2J 0ac&age in a 0re/field trigger ? %o. $1. Is a Jey start 0 trigger fires as res lt of a o0erator 0ressing a &ey e>0licitly? %o. $3. "ow can yo e>ec te the ser defined triggers in forms '.<? ->ec te5!rigger Ctrigger/nameD $4. When does an on/loc& trigger fire? It will fires whene*er S() G ?orms wo ld normally attem0t to loc& a row. $4. What is Host/Bloc& is a . a. %a*igational !rigger. b. Jey trigger c. !ransaction !rigger. %a*igational !rigger. $8. What is the difference between &eystart 0 and 0re/form ? Jey/start 0 trigger fires after s ccessf l na*igation into a form. Hre/form trigger fires before enter into the form. $9. What is the difference between &eystart 0 and 0re/form ? Jey/start 0 triigger fires after s ccessf l na*igation into a form. Hre/form trigger fires before enter into the form. HA2JA+- HR:2-D.R- & ?.%2!I:% ///////////////////////////////////////// $;. What is a Hac&age Hroced re ? A Hac&age 0roecd re is b ilt in H)LS() 0roced re. '<. What are the different ty0es of Hac&age Hroced re ? 1. Restricted 0ac&age 0roced re. $. .nrestricted 0ac&age 0roecd re. '1. What is the difference between restricted and nrestricted 0ac&age 0roced re ? Restricted 0ac&age 0roced re that affects the basic basic f nctions of S() G ?orms. It cannot sed in all triggers e>ec0t &ey triggers.

.nrestricted 0ac&age 0roced re that does not interfere with the basic f nctions of S() G ?orms it can be sed in any triggers. '$. 2lassify the restricted and nrestricted 0roced re from the following. a. 2all b. .ser/->it c. 2all/( ery d. .0 e. ->ec te/( ery f. Message g. ->it/?rom h. Host i. Brea& a. 2all / nrestricted b. .ser ->it / .nrestricted c. 2all5= ery / .nrestricted d. .0 / Restricted e. ->ec te ( ery / Restricted f. Message / Restricted g. ->it5form / Restricted h. Host / Restricted i. Brea& / .nrestricted. ''. 2an we se a restricted 0ac&age 0roced re in :%/BA)IDA!-/?I-)D !rigger ? %o. '1. What SI%2"R:%IU- 0roced re does ? It synchoroniMes the terminal screen with the internal state of the form. '3. What are the nrestricted 0roced res sed to change the 0o0 0 screen 0osition d ring r n time ? Anchor/*iew ResiMe /Biew Mo*e/Biew. '4. What -nter 0ac&age 0roced re does ? -nter Balidate/data in the c rrent *alidation nit. '8. What -RAS- 0ac&age 0roced re does ? -rase remo*es an indicated global *ariable. '9. What is the difference between %AM-5I% and 2:HI ? 2o0y is 0ac&age 0roced re and writes *al es into a field. %ame in is a 0ac&age f nction and ret rns the contents of the *ariable to which yo a00ly. '9. Identify 0ac&age f nction from the following ? 1. -rror/2ode $. Brea& '. 2all 1. -rror/te>t 3. ?orm/fail re 4. ?orm/fatal 8. ->ec te/= ery 9. Anchor5Biew ;. Message5code 1. -rror52ode $. -rror5!e>t '. ?orm5?ail re 1. ?orm5?atal 3. Message52ode

1<. "ow does the command H:S! differs from 2:MMI! ? Host writes data in the form to the database b t does not 0erform database commit 2ommit 0ermenently writes data in the form to the database. 11. What the HA.S- 0ac&age 0roced re does ? Ha se s s0ends 0rocessing ntil the o0erator 0resses a f nction &ey 1$. What 0ac&age 0roced re is sed for calling another form ? 2all C-.g. 2allCformnameD 1'. What 0ac&age 0roced re sed for in*o&e s=l G0l s from s=l Gforms ? "ost C-.g. "ost Cs=l0l sDD 11. -rror52ode is a 0ac&age 0roecd re ? a. !r e b. false ?alse. 13. -EI!5?:RM is a restricted 0ac&age 0roced re ? a. !r e b. ?alse !r e. 14. When the form is r nning in D-B.+ mode7 If yo want to e>amine the *al es of global *ariables and other form *ariables7 What 0ac&age 0roced re command yo wo ld se in yo r trigger te>t ? Brea&. SIS!-M BARIAB)-S 18. )ist the system *ariables related in Bloc& and ?ield? 1. System.bloc&5stat s $. System.c rrent5bloc& '. System.c rrent5field 1. System.c rrent5*al e 3. System.c rsor5bloc& 4. System.c rsor5field 8. System.field5stat s. 19. What is the difference between system.c rrent5field and system.c rsor5field ?

1. System.c rrent5field gi*es name of the field. $. System.c rsor5field gi*es name of the field with bloc& name. 1;. !he *al e recorded in system.last5record *ariable is of ty0e a. % mber b. Boolean c. 2haracter. b. Boolean. .ser ->its : 3<. What is an .ser ->its ? A ser e>it is a s bro tine which are written in 0rogramming lang ages sing 0roG2 0ro G2obol 7 etc.7 that lin& into the S() G forms e>ec table. 31. What are the ty0e of .ser ->its ? :RA2)- Hrecom0liers ser e>its :2I C:RA2)- 2all InterfaceD %on/:RA2-) ser e>its.

Hage : 3$. What do yo mean by a 0age ? Hages are collection of dis0lay information7 s ch as constant te>t and gra0hics. 3'. "ow many 0ages yo can in a single form ? .nlimited. 31. !wo 0o0 0 0ages can a00ear on the screen at a time ? a. !r e b. ?alse a. !r e. 33.What is the significance of HA+- < in forms '.< ? "ide the fields for internal calc lation. 34. Deleting a 0age remo*es information abo t all the fields in that 0age ? a. !r e. b. ?alse a. !r e. Ho0 0 Window : 38. What do yo mean by a 0o0/ 0 window ? Ho0/ 0 windows are screen areas that o*erlay all or a 0ortion of the dis0lay screen when a form is r nning. 39. What are the ty0es of Ho0/ 0 window ? the 0o0/ 0 field editor 0o0/ 0 list of *al es 0o0/ 0 0ages. Alert : 3;. What is an Alert ? An alert is window that a00ears in the middle of the screen o*erlaying a 0ortion of the c rrent dis0lay. 9OR)S :.. <1. +i*e the !y0es of mod les in a form? ?orm Men )ibrary <$. Write the Abbre*iation for the following ?ile ->tension 1. ?MB $. MMB '. H)) ?MB ///// ?orm Mod le Binary. MMB ///// Men Mod le Binary. H)) ////// H)LS() )ibrary Mod le Binary. <'. What are the design facilities a*ailable in forms 1.<? Defa lt Bloc& facility. )ayo t -ditor. Men -ditor. :b6ect )ists. Hro0erty Sheets. H)LS() -ditor. !ables 2ol mns Browser. B ilt/ins Browser.

<1. What is a )ayo t -ditor? !he )ayo t -ditor is a gra0hical design facility for creating and arranging items and gra0hics ob6ects in yo r a00licationFs interface. <3. B):2J <3. What do yo mean by a bloc& in forms1.<? Bloc& is a single mechanism for mani0 lating records. gro 0ing related items into a f nctional nit for storing7dis0laying and boiler0late te>t and

<4. ->0lain ty0es of Bloc& in forms1.<? Base table Bloc&s. 2ontrol Bloc&s. 1. A base table bloc& is one that is associated with a s0ecific database table or *iew. $. A control bloc& is a bloc& that is not associated with a database table. ITE)S <8. )ist the !y0es of Items? !e>t item. 2hart item. 2hec& bo>. Dis0lay item. Image item. )ist item. Radio +ro 0. .ser Area item. <9. What is a %a*igable item? A na*igable item is one that o0erators can na*igate to with the &eyboard d ring defa lt na*igation7 or that :racle forms can na*igate to by e>ec ting a na*igational b ilt/in 0roced re. <;. 2an yo %o. 1<. What is a 2hec& Bo>? A 2hec& Bo> is a two state control that indicates whether a certain condition or *al e is on or off7 tr e or false. !he dis0lay state of a chec& bo> is always either ,chec&ed, or , nchec&ed,. 11. What are the triggers associated with a chec& bo>? :nly When/chec&bo>/acti*ated !rigger associated with a 2hec& bo>. H)LS() Basiscs of H)LS() 1. What is H)LS() ? H)LS() is a 0roced ral lang age that has both interacti*e S() and 0roced ral 0rogramming lang age constr cts s ch as iteration7 conditional branching. $. What is the basic str ct re of H)LS() ? H)LS() ses bloc& str ct re as its basic str ct re. Anonymo s bloc&s or nested bloc&s can be sed in H)LS(). change the color of the 0 sh b tton in design time?

'. What are the com0onents of a H)LS() bloc& ? A set of related declarations and 0roced ral statements is called bloc&. 1. What are the com0onents of a H)LS() Bloc& ?

Declarati*e 0art7 ->ec table 0art and ->ec0tion 0art. Dataty0es H)LS() 3. What are the dataty0es a a*ailable in H)LS() ? Some scalar data ty0es s ch as %.MB-R7 BAR2"AR$7 DA!-7 2"AR7 ):%+7 B::)-A%. Some com0osite data ty0es s ch as R-2:RD & !AB)-. 4. What are N !IH- and N R:W!IH- ? What are the ad*antages of sing these o*er dataty0es? N !IH- 0ro*ides the data ty0e of a *ariable or a database col mn to that *ariable. N R:W!IH- 0ro*ides the record ty0e that re0resents a entire row of a table or *iew or col mns selected in the c rsor. !he ad*antages are : I. %eed not &now abo t *ariableFs data ty0e ii. If the database definition of a col mn in a table changes7 the data ty0e of a *ariable changes accordingly. 8. What is difference between N R:W!IH- and !IH- R-2:RD ? N R:W!IH- is to be sed whene*er = ery ret rns a entire row of a table or *iew. !IH- rec R-2:RD is to be sed whene*er = ery ret rns col mns of different table or *iews and *ariables. -.g. !IH- r5em0 is R-2:RD Ceno em0.em0noN ty0e7ename em0 ename Nty0e DK e5rec em0N R:W!IHc rsor c1 is select em0no7de0tno from em0K e5rec c1 NR:W!IH-. 9. What is H)LS() table ? :b6ects of ty0e !AB)- are called ,H)LS() tables,7 which are modelled as Cb t not the same asD database tables7 H)LS() tables se a 0rimary H)LS() tables can ha*e one col mn and a 0rimary &ey. C"rsors ;. What is a c rsor ? Why 2 rsor is re= ired ? 2 rsor is a named 0ri*ate S() area from where information can be accessed. 2 rsors are re= ired to 0rocess rows indi*id ally for = eries ret rning m lti0le rows. 1<. ->0lain the two ty0e of 2 rsors ? !here are two ty0es of c rsors7 Im0lict 2 rsor and ->0licit 2 rsor. H)LS() ses Im0lict 2 rsors for = eries. .ser defined c rsors are called ->0licit 2 rsors. !hey can be declared and sed. 11. What are the H)LS() Statements sed in c rsor 0rocessing ? D-2)AR- 2.RS:R c rsor name7 :H-% c rsor name7 ?-!2" c rsor name I%!: or Record ty0es7 2):Sc rsor name. 1$. What are the c rsor attrib tes sed in H)LS() ? NIS:H-% / to chec& whether c rsor is o0en or not N R:W2:.%! / n mber of rows featchedL 0datedLdeleted. N ?:.%D / to chec& whether c rsor has fetched any row. !r e if rows are featched. N %:! ?:.%D / to chec& whether c rsor has featched any row. !r e if no rows are featched. !hese attrib tes are 0roceded with S() for Im0lict 2 rsors and with 2 rsor name for ->0lict 2 rsors. 1'. What is a c rsor for loo0 ?

2 rsor for loo0 im0licitly declares NR:W!IH- as loo0 inde>7o0ens a c rsor7 fetches rows of *al es from acti*e set into fields in the record and closes when all the records ha*e been 0rocessed. eg. ?:R em05rec I% 21 )::H salary5total :# salary5total Rem05rec salK -%D )::HK 11. What will ha00en after commit statement ? 2 rsor 21 is Select em0no7 ename from em0K Begin o0en 21K loo0 ?etch 21 into eno.enameK ->it When 21 Nnotfo ndK///// commitK end loo0K endK !he c rsor ha*ing = ery as S-)-2! .... ?:R .HDA!- gets closed after 2:MMI!LR:))BA2J. !he c rsor ha*ing = ery as S-)-2!.... does not get closed e*en after 2:MMI!LR:))BA2J. 13. ->0lain the sage of W"-R- 2.RR-%! :? cla se in c rsors ? W"-R- 2.RR-%! :? cla se in an .HDA!-7D-)-!- statement refers to the latest row fetched from a c rsor. Database !riggers 14. What is a database trigger ? %ame some sages of database trigger ? Database trigger is stored H)LS() 0rogram nit associated with a s0ecific database table. .sages are A dit data modificateions7 )og e*ents trans0arently7 -nforce com0le> b siness r les Deri*e col mn *al es a tomatically7 Im0lement com0le> sec rity a thoriMations. Maintain re0licate tables. 18. "ow many ty0es of database triggers can be s0ecified on a table ? What are they ? Insert Before Row After Row o.&. o.&. o.&. o.&. .0date o.&. o.&. o.&. o.&. Delete o.&. o.&. o.&. o.&.

Before Statement After Statement

If ?:R -A2" R:W cla se is s0ecified7 then the trigger for each Row affected by the statement. If W"-% cla se is s0ecified7 the trigger fires according to the retr ned boolean *al e. 19. Is it 0ossible to se !ransaction control Statements s ch a R:))BA2J or 2:MMI! in Database !rigger ? Why ? It is not 0ossible. As triggers are defined for each table7 if yo affects logical transaction 0rocessing. se 2:MMI! of R:))BA2J in a trigger7 it

1;. What are two *irt al tables a*ailable d ring database trigger e>ec tion ? !he table col mns are referred as :)D.col mn5name and %-W.col mn5name. ?or triggers related to I%S-R! only %-W.col mn5name *al es only a*ailable. ?or triggers related to .HDA!- only :)D.col mn5name %-W.col mn5name *al es only a*ailable. ?or triggers related to D-)-!- only :)D.col mn5name *al es only a*ailable. $<. What ha00ens if a 0roced re that 0dates a col mn of table E is called in a database trigger of the same table ?

M tation of table occ rs. $1. Write the order of 0recedence for *alidation of a col mn in a table ? I. done sing Database triggers. ii. done sing Integarity 2onstraints. I & ii. ->ce0tion : $$. What is an ->ce0tion ? What are ty0es of ->ce0tion ? ->ce0tion is the error handling 0art of H)LS() bloc&. !he ty0es are Hredefined and ser5defined. Some of Hredefined e>ec0tions are. 2.RS:R5A)R-ADI5:H-% D.H5BA)5:%5I%D-E %:5DA!A5?:.%D !::5MA%I5R:WS I%BA)ID52.RS:R I%BA)ID5%.MB-R ):+:%5D-%I-D %:!5):++-D5:% HR:+RAM/-RR:R S!:RA+-5-RR:R !IM-:.!5:%5R-S:.R2BA).-5-RR:R U-R:5DIBID:!"-RS. $'. What is Hragma -E-2H!I:%5I%I! ? ->0lain the sage ? !he HRA+MA -E-2H!I:%5I%I! tells the com0lier to associate an e>ce0tion with an oracle error. !o get an error message of a s0ecific oracle error. e.g. HRA+MA -E2-H!I:%5I%I! Ce>ce0tion name7 oracle error n mberD $1. What is Raise5a00lication5error ? Raise5a00lication5error is a 0roced re of 0ac&age DBMS5S!A%DARD which allows to iss e an ser5defined error messages from stored s b/0rogram or database trigger. $3. What are the ret rn *al es of f nctions S()2:D- and S()-RRM ? S()2:D- ret rns the latest code of the error that has occ red. S()-RRM ret rns the rele*ant error message of the S()2:D-. $4. Where the Hre5defined5e>ce0tions are stored ? In the standard 0ac&age. Hroced res7 ? nctions & Hac&ages K $8. What is a stored 0roced re ? A stored 0roced re is a se= ence of statements that 0erform s0ecific f nction. $9. What is difference between a HR:2-D.R- & ?.%2!I:% ? A ?.%2!I:% is alway ret rns a *al e sing the ret rn statement. A HR:2-D.R- may ret rn one or more *al es thro gh 0arameters or may not ret rn at all. $;. What are ad*antages fo Stored Hroced res L ->tensibility7Mod larity7 Re sability7 Maintainability and one time com0ilation. '<. What are the modes of 0arameters that can be 0assed to a 0roced re ? I%7:.!7I%/:.! 0arameters.

'1. What are the two 0arts of a 0roced re ? Hroced re S0ecification and Hroced re Body. '$. +i*e the str ct re of the 0roced re ? HR:2-D.R- name C0arameter list.....D is local *ariable declarations B-+I% ->ec table statements. ->ce0tion. e>ce0tion handlers endK ''. +i*e the str ct re of the f nction ? ?.%2!I:% name Carg ment list .....D Ret rn dataty0e is local *ariable declarations Begin e>ec table statements ->ce0tion e>ec tion handlers -ndK '1. ->0lain how 0roced res and f nctions are called in a H)LS() bloc& ? ? nction is called as 0art of an e>0ression. sal :# calc late5sal CFa9$$FDK 0roced re is called as a H)LS() statement calc late5bon s CFA9$$FDK '3. What is :*erloading of 0roced res ? !he Same 0roced re name is re0eated with 0arameters of different dataty0es and 0ositions7 *arying n mber of 0arameters is called o*erloading of 0roced res. e.g. DBMS5:.!H.! 0 t5line '4. What is a 0ac&age ? What are the ad*antages of 0ac&ages ? Hac&age is a database ob6ect that gro 0s logically related 0roced res. !he ad*antages of 0ac&ages are Mod larity7 -asier A00licaton Design7 Information. "iding7. re sability and Better Herformance. '8.What are two 0arts of 0ac&age ? !he two 0arts of 0ac&age are HA2JA+- SH-2I?I2A!I:% & HA2JA+- B:DI. Hac&age S0ecification contains declarations that are global to the 0ac&ages and local to the schema. Hac&age Body contains act al 0roced res and local declaration of the 0roced res and c rsor declarations. '9. What is difference between a 2 rsor declared in a 0roced re and 2 rsor declared in a 0ac&age s0ecification ? A c rsor declared in a 0ac&age s0ecification is global and can be accessed by other 0roced res or 0roced res in a 0ac&age. A c rsor declared in a 0roced re is local to the 0roced re that can not be accessed by other 0roced res. ';. "ow 0ac&aged 0roced res and f nctions are called from the following? a. Stored 0roced re or anonymo s bloc& b. an a00lication 0rogram s ch a HR2 G27 HR:G 2:B:) c. S() GH).S 0arameters in different

a. HA2JA+- %AM-.HR:2-D.R- %AM- C0arametersDK *ariable :# HA2JA+- %AM-.?.%2!I:% %AM- Carg mentsDK -E-2 S() -E-2.!b. B-+I% HA2JA+- %AM-.HR:2-D.R- %AM- C0arametersD *ariable :# HA2JA+- %AM-.?.%2!I:% %AMCarg mentsDK -%DK -%D -E-2K c. -E-2.!- HA2JA+- %AM-.HR:2-D.R- if the 0roced res does not ha*e any o tLin/o t 0arameters. A f nction can not be called. 1<. %ame the tables where characteristics of Hac&age7 0roced re and f nctions are stored ? .ser5ob6ects7 .ser5So rce and .ser5error. 9OR)S:.. 1$. what is a dis0lay item? Dis0lay items are similar to te>t items b t store only fetched or assigned *al es. :0erators cannot na*igate to a dis0lay item or edit the *al e it contains. 1'. What is a list item? It is a list of te>t elements. 11. What are the dis0lay styles of list items? Ho0list7 %o te>t Item dis0layed in the list item. !list7 %o element in the list is highlighted. 13. What is a radio +ro 0? Radio gro 0s dis0lay a fi>ed no of o0tions that are m t ally ->cl si*e . .ser can select one o t of n n mber of o0tions. 14. "ow many ma>im m n mber of radio b ttons can yo assign to a radio gro 0? .nlimited no of radio b ttons can be assigned to a radio gro 0 18. can yo change the defa lt *al e of the radio b tton gro 0 at r n time? %o. 19.What triggers are associated with the radio gro 0? :nly when/radio/changed trigger associated with radio gro 0 Bis al Attrib tes. 1;. What is a *is al attrib te? Bis al Attrib tes are the font7 color and 0attern characteristics of ob6ects that o0erators see and intract with in o r a00lication. $<. What are the ty0es of *is al attrib te settings? 2 stom Bis al attrib tes Defa lt *is al attrib tes %amed Bis al attrib tes. Window $1. What is a window?

A window7 byitself 7 can be tho ght of as an em0ty frame. !he frame 0ro*ides a way to intract with the window7 incl ding the ability to scroll7 mo*e7 and resiMe the window. !he content of the window ie. what is dis0layed inside the frame is determined by the can*as Biew or can*as/*iews dis0layed in the window at r n/time. $$. What are the differrent ty0es of windows? Root window7 secondary window. $'. 2an a root window be made modal? %o. $1. )ist the b il/in ro tine for controlling window d ring r n/time? ?ind5window7 get5window50ro0erty7 hide5window7 mo*e5window7 resiMe5window7 set5window50ro0erty7 show5Biew $3. )ist the windows e*ent triggers a*ailable in ?orms 1.<? When/window/acti*ated7 when/window/resiMed $4. What b ilt/in is Set5window50ro0erty 2an*as/Biew $8. What is a can*as/*iew? A can*as/*iew is the bac&gro nd ob6ect on which yo layo t the interface items Cte>t/items7 chec& bo>es7 radio gro 0s7 and so on.D and boiler0late ob6ects that o0erators see and interact with as they r n yo r form. At r n/time7 o0erators can see only those items that ha*e been assiged to a s0ecific can*as. -ach can*as7 in term7 m st be dis0layed in a s0ecfic window. $9. +i*e the e= i*alent term in forms 1.< for the following. Hage7 Hage <? Hage / 2an*as/Biew Hage < / 2an*as/*iew n ll. $;. What are the ty0es of can*as/*iews? 2ontent Biew7 Stac&ed Biew. '<. What is the content *iew and stac&ed *iew? A content *iew is the ,Base, *iew that occ 0ies the entire content 0ane of the window in which it is dis0layed. A stac&ed *iew differs from a content can*as *iew in that it is not the base *iew for the window to which it is assigned '1. )ist the b ilt/in ro tines for the controlling can*as *iews d ring r n/time? ?ind5can*as +et/2an*as50ro0erty +et5*iew50ro0erty "ide5Biew Re0lace5content5*iew Scroll5*iew Set5can*as50ro0erty Set5*iew50ro0erty Show5*iew when/window/closed7 when/window/deacti*ated7

sed for changing the 0ro0erties of the window dynamically?

Alert '$. What is an Alert? An alert is a modal window that dis0lays a message notifies the o0erator of some a00lication condition ''. What are the dis0lay styles of an alert? Sto07 2a tion7 note '1. 2an yo attach an alert to a field? %o '3. What b ilt/in is sed for showing the alert d ring r n/time? Show5alert. '4. 2an yo change the alert messages at r n/time? If yes7 gi*e the name of th b ilt/in to chage the alert messages at r n/time. Ies. Set5alert50ro0erty.

'8. What is the b ilt/in f nction sed for finding the alert? ?ind5alert -ditors '9. )ist the editors a*ailables in forms 1.<? Defa lt editor .ser5defined editors system editors. ';. What b il/in ro tines are sed to dis0lay editor dynamicaly? -dit5te>t item show5editor ):B 1<. What is an )o*? A list of *al es is a single or m lti col mn selection list dis0layed in a 0o0/ 0 window 11. 2an yo attach an lo* to a field at design time? Ies. 1$. 2an yo attach an lo* to a field at r n/time? if yes7 gi*e the b ild/in name. Ies. Set5item50ro0rety

1'. What is the b ilt/in sed for showing lo* at r ntime? Show5lo* 11. What is the b ilt/in +et5lo*50ro0erty Set5lo*50ro0erty Record +ro 0 13. What is a record +ro 0? sed to get and set lo* 0ro0erties d ring r n/time?

A record gro 0 is an internal oracle forms data str ct re that has a simillar col mnLrow frame wor& to a database table 14. What are the different ty0e of a record gro 0? ( ery record gro 0 Static record gro 0 %on = ery record gro 0 18. +i*e b ilt/in ro tine related to a record gro 0s? 2reate5gro 0 C? nctionD 2reate5gro 05from5= eryC? nctionD Delete5gro 0CHroced reD Add5gro 05col mnC? nctionD Add5gro 05rowCHroced reD Delete5gro 05rowCHroced reD Ho0 late5gro 0C? nctionD Ho0 late5gro 05with5= eryC? nctionD Set5gro 052har5cellC0roced reD 19. What is the b ilt5in ro tine sed to co nt the no of rows in a gro 0? +et5gro 0 5row5co nt System Bariables 1;. )ist system *ariables a*ailable in forms 1.<7 and not a*ailable in forms '.<? System.cordination5o0eration System Date5threshold System.effecti*e5Date System.e*ent5window System.s 00ress5wor&ing 3<. System.effecti*e5date system *ariable is read only !r eL?alse ?alse 31. What is a library in ?orms 1.<? A library is a collection of HlLS() 0rogram nits7 incl ding ser named 0roced res7 f nctions & 0ac&ages 3$. Is it 0ossible to attach same library to more than one form? Ies 3'. ->0lain the following file e>tention related to library? .0ll7.lib7.0ld !he library 0ll files is a 0ortable design file com0arable to an fmb form file !he library lib file is a 0lat form s0ecific7 generated library file com0arable to a fm> form file !he 0ld file is !>t format file and can be sed for so rce controlling yo r library files Harameter 31. "ow do yo 0ass the 0arameters from one form to another form? !o 0ass one or more 0arameters to a called form7 the calling form m st 0erform the following ste0s in a trigger or ser named ro tine e>c te the create50arameter5list b ilt5in f nction to 0rogramatically. 2reate a 0arameter list to e>ec te the add 0arameter b ilt5in 0roced re to add one or more 0arameters list. ->ec te the call5form7 %ew5form or r n50rod ct b ilt5in 0roced re and incl de the name or id of the 0arameter list to be 0assed to the called form. 31. What are the b ilt/in ro tines is a*ailable in forms 1.< to create and mani0 late a 0arameter list? Add50arameter 2reate5Harameter5list

Delete50arameter Destroy50arameter5list +et50arameter5attr +et50arameter5list set50arameter5attr 33. What are the two ways to incor0orate images into a oracle forms a00lication? Boiler0late Images Image5items 34. "ow image5items can be 0o0 late to field in forms 1.<? A fetch from a long raw database col mn H)LS=l assignment to e>ec ting the read5image5file b ilt5in 0roced re to get an image from the file system. 38. What are the triggers associated with the image item? When/Image/acti*atedC?ires when the o0erator do ble clic&s on an image ItemsD When/image/0ressedCfires when the o0erator selects or deselects the image itemD 39. )ist some b ilt/in ro tines sed to mani0 late images in image5item? Image5add Image5and Image5s btract Image5>or Image5Moom 3;. What are the b ilt5in sed to tra00ing errors in forms 1? -rror5ty0e ret rn character -rror5code ret rn n mber -rror5te>t ret rn char Dbms5error5code ret rn no. Dbms5error5te>t ret rn char 4<. What is a 0redefined e>ce0tion a*ailable in forms 1.<? Raise form5trigger5fail re 41. What are the men items that oracle forms 1.< s 00orts? Hlain7 2hec&7Radio7 Se0arator7 Magic ?:RMS1.3 ob6ect gro 0s <1. what ia an ob6ect gro 0s? An ob6ect gro 0 is a container for a gro 0 of ob6ects7 yo define an ob6ect gro 0 when yo ob6ects. so that yo co0y or reference them in another mod les. <$. what are the different ob6ects that yo cannot co0y or reference in ob6ect gro 0s? ob6ects of differnt mod les another ob6ect gro 0s indi*id al bloc& de0endent items 0rogram nits. can*as *iews <'. what are different ty0es of can*as *iews? content can*as *iews stac&ed can*as *iews horiMontal toolbar want to 0ac&age related

*ertical toolbar. <1. e>0lain abo t content can*as *iews? Most 2an*as *iews are content can*as *iews a content can*as *iew is the ,base, *iew that occ 0ies the entire content 0ane of the window in which it is dis0layed. <3. ->0lain abo t stac&ed can*as *iews? Stac&ed can*as *iew is dis0layed in a window on to0 of7 or ,stac&ed, on the content can*as *iew assigned to that same window. Stac&ed can*as *iews obsc re some 0art of the nderlying content can*as *iew7 and or often shown and hidden 0rogrammatically. <4. ->0lain abo t horiMontal7 Bertical tool bar can*as *iews? !ool bar can*as *iews are sed to create tool bars for indi*id al windows to0 of a window7 6 st nder its men bar. Bertical !ool bars are dis0layed along the left side of a window <8. %ame of the f nctions sed to getLset can*as 0ro0erties? +et5*iew50ro0erty7 Set5*iew50ro0erty Windows <8. What is relation between the window and can*as *iews? 2an*as *iews are the bac& gro nd ob6ects on which yo 0lace the interface items C!e>t itemsD7 chec& bo>es7 radio gro 0s etc.7D and boiler0late ob6ects Cbo>es7 lines7 images etc.7D that o0erators interact with s they r n yo r form . -ach can*as *iews dis0layed in a window. <9. What are the different modals of windows? Modalless windows Modal windows <;. What are modalless windows? More than one modelless window can be dis0layed at the same time7 and o0erators can na*igate among them if yo r a00lication allows them to do so . :n most +.I 0latforms7 modelless windows can also be layered to a00ear either in front of or behind other windows. 1<. What are modal windows? Modal windows are s ally sed as dialogs7 and ha*e restricted f nctionality com0ared to modelless windows. :n some 0latforms for e>am0le o0erators cannot resiMe7 scroll or iconify a modal window. 11. "ow do yo dis0lay console on a window ? !he console incl des the stat s line and message line7 and is dis0layed at the bottom of the window to which it is assigned. !o s0ecify that the console sho ld be dis0layed7 set the console window form 0ro0erty to the name of any window in the form. !o incl de the console7 set console window to % ll. 1$. What is the remo*e on e>it 0ro0erty? ?or a modelless window7 it determines whether oracle forms hides the window a tomatically when the o0erators na*igates to an item in the another window. 1'. "ow many windows in a form can ha*e console? :nly one window in a form can dis0lay the console7 and yo cannot chage the console assignment at r ntime. 11. 2an yo ha*e more than one content can*as *iew attached with a window? Ies. "oriMontal tool bars are dis0lay at the

-ach window yo create m st ha*e atleast one content can*as *iew assigned to it. Io can also create a window that has mani0 late contant can*as *iew. At r n time only one of the content can*as *iews assign to a window is dis0layed at a time. 13. What are the different window e*ents acti*ated at r ntimes? When5window5acti*ated When5window5closed When5window5deacti*ated When5window5resiMed Within this triggers7 yo can e>amine the b ilt in system *ariable system.e*ent5window to determine the name of the window for which the trigger fired. Mod les $8. What are different ty0es of mod les a*ailable in oracle form? ?orm mod le / a collection of ob6ects and code ro tines Men mod les / a collection of men s and men item commands that together ma&e 0 an a00lication men library mod le / a collectio of ser named 0roced res7 f nctions and 0ac&ages that can be called from other mod les in the a00lication 19. What are the defa lt e>tensions of the files careated by forms mod les? .fmb / form mod le binary .fm> / form mod le e>ec table 1;. What are the defa lt e>tentions of the files created by men mod le? .mmb7 .mm> $< What are the defa lt e>tension of the files created by library mod le? !he defa lt file e>tensions indicate the library mod le ty0e and storage format .0ll / 0lLs=l library mod le binary Master Detail $1. What is a master detail relationshi0? A master detail relationshi0 is an association between two base table bloc&s/ a master bloc& and a detail bloc&. !he relationshi0 between the bloc&s reflects a 0rimary &ey to foreign &ey relationshi0 between the tables on which the bloc&s are based. $$. What is coordination -*ent? Any e*ent that ma&es a different record in the master bloc& the c rrent record is a coordination ca sing e*ent. $'. What are the two 0hases of bloc& coordination? !here are two 0hases of bloc& coordination: the clear 0hase and the 0o0 lation 0hase. D ring7 the clear 0hase7 :racle ?orms na*igates internally to the detail bloc& and fl shes the obsolete detail records. D ring the 0o0 lation 0hase7 :racle ?orms iss es a S-)-2! statement to re0o0 late the detail bloc& with detail records associated wit6h the new master record. !hese o0erations are accom0lished thro gh the e>ec tion of triggers. $1. What are Most 2ommon ty0es of 2om0le> master/detail relationshi0s? !here are three most common ty0es of com0le> master/detail relationshi0s: master with de0endent details master with inde0endent details detail with two masters $3. What are the different ty0es of Delete details we can establish in Master/Details? 2ascade Isolate %on/isolote $4. What are the different defa st triggers created when Master Deletes Hro0erty is set to %on/isolated?

Master Delets Hro0erty Res lting !riggers //////////////////////////////////////////////////// %on/IsolatedCthe defa ltD :n/2hec&/Delete/Master :n/2lear/Details :n/Ho0 late/Details $4. Whar are the different defa lt triggers created when Master Deletes Hro0erty is set to 2ascade? Ans: Master Deletes Hro0erty Res lting !riggers /////////////////////////////////////////////////// 2ascading :n/2lear/Details :n/Ho0 late/Details Hre/delete $9. What are the different defa lt triggers created when Master Deletes Hro0erty is set to isolated? Master Deletes Hro0erty Res lting !riggers /////////////////////////////////////////////////// Isolated :n/2lear/Details :n/Ho0 late/Details $;. What are the 2oordination Hro0erties in a Master/Detail relationshi0? !he coordination 0ro0erties are Deferred A to/( ery !hese Hro0erties determine when the 0o0 lation 0hase of bloc& coordination sho ld occ r. '<. What are the different ty0es of 2oordinations of the Master with the Detail bloc&? 1$. What is the .ser/%amed -ditor? A ser named editor has the same te>t editing f nctionality as the defa lt editor7 b t7 beca e it is a named ob6ect7 yo can s0ecify editor attrib tes s ch as windows dis0lay siMe7 0osition7 and title. 1'. What are the B ilt/ins to dis0lay the ser/named editor? A ser named editor can be dis0layed 0rogrammatically with the b ilt in 0roced re -DI!5!-!I!-M inde0endent of any 0artic lar te>t item. 11. What is the difference between S":W5-DI!:R and -DI!5!-E!I!-M? Show editor is the generic b ilt5in which acce0ts any editor name and ta&es some in0 t string and ret rns modified o t0 t string. Whereas the edit5te>titem b ilt5in needs the in0 t foc s to be in the te>t item before the b ilt5in is e>c ted. 13. What is an ):B? An ):B is a scrollable 0o0 0 window that 0ro*ides the o0erator with either a single or m lti col mn selection list. 14. What is the basic data str ct re that is re= ired for creating an ):B? Record +ro 0. 18. What is the ,):B of Balidation, Hro0erty of an item? What is the se of it? When ):B for Balidation is set to !r e7 :racle ?orms com0ares the c rrent *al e of the te>t item to the *al es in the first col mn dis0layed in the ):B. Whene*er the *alidation e*ent occ rs. If the *al e in the te>t item matches one of the *al es in the first col mn of the ):B7 *alidation s cceeds7 the ):B is not dis0layed7 and 0rocessing contin es normally. If the *al e in the te>t item does not match one of the *al es in the first col mn of the ):B7 :racle ?orms dis0lays the ):B and ses the te>t item *al e as the search criteria to a tomatically red ce the list. 19. What are the b ilt5ins sed the dis0lay the ):B? Show5lo* )ist5*al es 1;. What are the b ilt/ins that are sed to Attach an ):B 0rogrammatically to an item? S":W/-DI!:R7

set5item50ro0erty get5item50ro0erty Cby setting the ):B5%AM- 0ro0ertyD 3<. What are the b ilt/ins that are sed for setting the ):B 0ro0erties at r ntime? get5lo*50ro0erty set5lo*50ro0erty 31. What is a record gro 0? A record gro 0 is an internal :racle ?orms that str ct re that hs a col mnLrow framewor& similar to a database table. "owe*er7 nli&e database tables7 record gro 0s are se0arate ob6ects that belong to the form mod le which they are defined. 3$. "ow many n mber of col mns a record gro 0 can ha*e? A record gro 0 can ha*e an nlimited n mber of col mns of ty0e 2"AR7 ):%+7 %.MB-R7 or DA!- 0ro*ided that the total n mber of col mn does not e>ceed 41J. 3'. What is the Ma>im m allowed length of Record gro 0 2ol mn? Record gro 0 col mn names cannot e>ceed '< characters. 31. What are the different ty0es of Record +ro 0s? ( ery Record +ro 0s %on( ery Record +ro 0s State Record +ro 0s 33. What is a ( ery Record +ro 0? A = ery record gro 0 is a record gro 0 that has an associated S-)-2! statement. !he col mns in a = ery record gro 0 deri*e their defa lt names7 data ty0es7 had lengths from the database col mns referenced in the S-)-2! statement. !he records in = ery record gro 0 are the rows retrie*ed by the = ery associated with that record gro 0. 34. What is a %on ( ery Record +ro 0? A non/= ery record gro 0 is a gro 0 that does not ha*e an associated = ery7 b t whose str ct re and *al es can be modified 0rogrammatically at r ntime. 38. What is a Static Record +ro 0? A static record gro 0 is not associated with a = ery7 rather7 yo define its str ct re and row *al es at design time7 and they remain fi>ed at r ntime. 39. What are the b ilt/ins sed for 2reating and deleting gro 0s? 2R-A!-/+R:.H Cf nctionD 2R-A!-5+R:.H5?R:M5(.-RICf nctionD D-)-!-5+R:.HC0roced reD 3;.What are the b ilt /ins sed for Modifying a gro 0Fs str ct re? ADD/+R:.H52:).M% Cf nctionD ADD5+R:.H5R:W C0roced reD D-)-!-5+R:.H5R:WC0roced reD 4<. H:H.)A!-5+R:.HCf nctionD H:H.)A!-5+R:.H5WI!"5(.-RICf nctionD S-!5+R:.H52"AR52-))C0roced reD S-!5+R:.H5DA!-52-))C0roced reD S-!5+R:.H5%.MB-R52-))C0roced reD 41. What are the b ilt/ins sed for +etting cell *al es?

+-!5+R:.H52"AR52-)) Cf nctionD +-!5+R:.H5DA!-52-))Cf nctionD +-!5+R:.H5%.MB-!52-))Cf nctionD 4$. What are b ilt/ins sed for Hrocessing rows? +-!5+R:.H5R:W52:.%!Cf nctionD +-!5+R:.H5S-)-2!I:%52:.%!Cf nctionD +-!5+R:.H5S-)-2!I:%Cf nctionD R-S-!5+R:.H5S-)-2!I:%C0roced reD S-!5+R:.H5S-)-2!I:%C0roced reD .%S-!5+R:.H5S-)-2!I:%C0roced reD 4'. What are the b ilt/ins sed for finding :b6ect ID f nction? ?I%D5+R:.HCf nctionD ?I%D52:).M%Cf nctionD 41. .se the ADD5+R:.H52:).M% f nction to add a col mn to a record gro 0 that was created at design time. ID !R.- IID?A)SIID ?A)S43. .se the ADD5+R:.H5R:W 0roced re to add a row to a static record gro 0 ID !R.- IID?A)SID ?A)S41. What are the b ilt/in sed for getting cell *al es? +et5gro 05char5cellCf nctionD +et5gro 05date5cellCf nctionD +et5gro 05n mber5cellCf nctionD 4$. What are the b ilt/ins sed for 0rocessing rows? +et5gro 05row5co ntCf nctionD +et5gro 05selection5co ntCf nctionD +et5gro 05selectionCf nctionD Reset5gro 05selectionC0roced reD Set5gro 05selectionC0roced reD .nset5gro 05selectionC0roced reD 4'. What are the b ilt/ins sed for finding ob6ect ID f nctions? ?ind5gro 0Cf nctionD ?ind5col mnCf nctionD 41. .se the add5gro 05col mn f nction to add a col mn to record gro 0 that was created at a design time? ?alse. 43. .se the Add5gro 05row 0roced re to add a row to a static record gro 0 1. tr e or false? ?alse. 0arameters 44. What are 0arameters? Harameters 0ro*ide a sim0le mechanism for defining and setting the *al es of in0 ts that are re= ired by a form at start 0. ?orm 0arameters are *ariables of ty0e char7n mber7date that yo define at design time. 48. What are the B ilt/ins sed for sending Harameters to forms?

Io can 0ass 0arameter *al es to a form when an a00lication e>ec tes the call5form7 %ew5form7 :0en5form or R n50rod ct. 49. What is the ma>im m no of chars the 0arameter can store? !he ma>im m no of chars the 0arameter can store is only *alid for char 0arameters7 which can be 0arameters defa lt to $'Bytes and Date 0arameter defa lt to 8Bytes. 4;. "ow do yo call other :racle Hrod cts from :racle ?orms? R n50rod ct is a b ilt/in7 .sed to in*o&e one of the s 00orted oracle tools 0rod cts and s0ecifies the name of the doc ment or mod le to be r n. If the called 0rod ct is na*ailable at the time of the call7 :racle ?orms ret rns a message to the o0ertor. 8<. "ow do yo reference a Harameter? In HlLS=l7 Io can reference and set the *al es of form 0arameters sing bind *ariables synta>. ->. HARAM-!-R name # FF or :bloc&.item # HARAM-!-R Harameter name 81. "ow do yo reference a 0arameter indirectly? !o indirectly reference a 0arameter se the %AM- I%7 2:HI Fb ilt/ins to indirectly set and reference the 0arameters *al eF ->am0le name5in CFca0ital 0arameter my 0aramFD7 2o0y CFS.R-S"F7FHarameter my50aramFD 8$. What are the different Harameter ty0es? !e>t Harameters Data Harameters 8'. When do yo se data 0arameter ty0e? 0to 41J. %o

When the *al e of a data 0arameter being 0assed to a called 0rod ct is always the name of the record gro 0 defined in the c rrent form. Data 0arameters are sed to 0ass data to 0rod ts in*o&ed with the r n50rod ct b ilt/in s b0rogram. 81. 2an yo 0ass data 0arametrs to forms? %o. I)A>ES 83. What are different ty0es of images? Boiler 0late images Image Items 84. What is the difference between boiler 0lat images and image items? Boiler 0late Images are static images C-ither *ector or bit ma0D that yo im0ort from the file system or database to se a gra0ical elements in yo r form7 s ch as com0any logos and ma0s Image items are s0ecial ty0es of interface controls that store and dis0lay either *ector or bitma0 images. )li&e other items that store *al es7 image items can be either base table itemsCitems that relate directly to database col mnsD or control items. !he definition of an image item is stored as 0art of the form mod le ?MB and ?ME files7 b t no image file is act aly associated with an image item ntil the item is 0o0 late at r n time. 88. What are the trigger associated with image items? When/image/acti*ated fires when the o0erators do ble clic&s on an image item when an o0erator clic&s or do ble clic&s on an image item 89. What is the se of image5Moom b ilt/in? !o mani0 late images in image items. W:RJI%+ WI!" M.)!IH)- ?:RMS when/image/0ressed fires

8;. "ow do yo create a new session while o0en a new form? .sing o0en5form b ilt/in setting the session o0tion ->. :0en5formCFStoc&s F7acti*e7sessionD. when in*o&e the m liti0le forms with o0en form and call5form in the same a00lication7 state whether the following are tr eL?alse 9<. Any attem0t to na*igate 0rogramatically to disabled form in a call5form stac& is allowed? ?alse 91. An o0en form can not be e>ec te the call5form 0roced re if yo chain of called forms has been initiated by another o0en form? !r e 9$. When a form is in*o&ed with call5form7 Does oracle forms iss es a sa*e 0oint? !r e Mo se :0erations 9'. What are the *ario s s b e*ents a mo se do ble clic& e*ent in*ol*es? Do ble clic&ing the mo se consists of the mo se down7 mo se 07 mo se clic&7 mo se down & mo se 0 e*ents. 917 State any three mo se e*ents system *ariables? System.mo System.mo system.mo system.mo system.mo :)93. What is an :)-? :b6ect )in&ing & -mbadding 0ro*ides yo with the ca0ability to integrate ob6ects from many Ms/Windows a00lications into a single com0o nd doc ment creating integrated a00lications enables yo to se the feat res form . 94. What is the difference between ob6ect embedding & lin&ing in :racle forms? In :racle forms7 -mbedded ob6ects become 0art of the form mod le7 and lin&ed ob6ects are references from a form mod le to a lin&ed so rce file. 98. What is the difference between :)- Ser*er & :le 2ontainer? An :le ser*er a00lication creates ole :b6ects that are embedded or lin&ed in ole 2ontainers e>. :le ser*ers are ms5word & ms5e>cell. :)- containers 0ro*ide a 0lace to store7 dis0lay and mani0 late ob6ects that are created by ole ser*er a00lications. ->. oracle forms is an e>am0le of an ole 2ontainer. 99. What are the different styles of act*ation of ole :b6ects? In 0lace acti*ation ->ternal acti*ation BiS.A) Attrib tes & 0ro0erty cla ses 9;. What are *is al attrib tes? Bis al attrib tes are the font7 color7 0attern 0ro0rities that yo set for form and men ob6ects that a00ear in yo r a00lication interface. ;<. What is a 0ro0erty cla se? A 0ro0erty cla se is a named ob6ect that contains a list of 0ro0erties and thier settings. :nce yo create a 0ro0erty cla se yo can base other ob6ect on it. An ob6ect based on a 0ro0erty can inherit the setting of any 0ro0erty in the cla se that ma&es sense for that ob6ect. se5b tton50ressed se5b tton5shift5state se5item se5can*as se5record

;1. 2an a 0ro0erty cla se itself be based on a 0ro0erty cla se? Ies ;$. What are the im0ortant difference between 0ro0erty cla se and *is al attrib tes? %amed *is al attrib tes differed only font7 color & 0attern attrib tes7 0ro0erty cla ses can contain this and any other 0ro0erties. Io can change the a00earance of ob6ects at r n time by changing the named *is al attrib tes 0rogramatically 7 0ro0erty cla se assignments cannot be changed 0rogramatically. When an ob6ect is inheriting from both a 0ro0erty cla se and named *is al attrib te7 the named *is al attrib te settings ta&e 0recedence7 and any *is al attrib te 0ro0erties in the class are ignored. ?orm B ild/ins ;'. What is a !e>t5io Hac&age? It allows yo to read and write information to a file in the file system. ;1. What is an .ser5e>it? 2alls the ser e>it named in the ser5e>it5string. In*o&es a '+l 0rograme by name which has been 0ro0erly lin&ed into yo r c rrent oracle forms e>ec table. ;3. What is synchroniMe? It is a terminal screen with the internal state of the form. It 0dates the screen dis0lay to reflect the information that oracle forms has in its internal re0resentation of the screen. ;4. What is forms5DD)? Iss es dynamic S=l statements at r n time7 incl ding ser*er side 0lLS(l and DD) !riggers ;8. What is W"-%/Database/record trigger? ?ires when oracle forms first mar&s a record as an insert or an 0date. !he trigger fires as soon as oracle forms determines thro gh *alidation that the record sho ld be 0rocessed by the ne>t 0ost or commit as an insert or 0date. c generally occ rs only when the o0erators modifies the first item in the record7 and after the o0erator attem0ts to na*igate o t of the item. ;9. What are the master/detail triggers? :n/2hec&5delete5master :n5clear5details :n50o0 late5details ;;. What is the difference between YYDA!-YY & YYDBDA!-YY YYDBDA!-YY retrie*es the c rrent database date YYdateYY retrie*es the c rrent o0erating system date. 1<<. What is system.coordination5o0eration? It re0resents the coordination ca sing e*ent that occ r on the master bloc& in master/detail relation. 1<1. What are the difference between lo* & list item? )o* is a 0ro0erty where as list item ias an item. A list item can ha*e only one col mn7 lo* can ha*e one or more col mns. 1<$. What are the different dis0lay styles of list items? Ho05list !e>t5list 2ombo bo>

1<'. What is 0o0 list? !he 0o0 list style list item a00ears initially as a single field Csimilar to a te>t item fieldD. When the o0erator selects the list icon7 a list of a*ailable choices a00ears. 1<1. What is a te>t list? !he te>t list style list item a00ears as a rectang lar bo> which dis0lays the fi>ed n mber of *al es. When the te>t list contains *al es that can not be dis0layed7 a *ertical scroll bar a00ears7 allowing the o0erator to *iew and select ndis0layed *al es. 1<3. What is a combo bo>? A combo bo> style list item combines the feat res fo nd in list and te>t item. .nli&e the 0o0 list or the te>t list style list items7 the combo bo> style list item will both dis0lay fi>ed *al es and acce0t one o0erator entered *al e. 1<4. What are dis0lay items? Dis0lay items are similar to te>t items with the e>ce0tion that dis0lay items only store and dis0lay fetched or assigned *al es.Dis0lay items are generaly sed as boiler0late or conditional te>t. 1<8. What is difference between o0en5form and call5form? when one form in*o&es another form by e>ec ting o0en5form the first form remains dis0layed7and o0erators can na*igate between the forms as desired. when one form in*o&es another form by e>ec ting call5form7the called form is modal with res0ect to the calling form.!hat is7 any windows that belong to the calling form are disabled7 and o0erators cannot na*igate to them ntil they first e>it the called form. 1<9. What is new5form b ilt/in? When one form in*o&es another form by e>ec ting new5form oracle form e>its the first form and releases its memory before loading the new form calling new form com0letely re0lace the first with the second. If there are changes 0ending in the first form7the o0erator will be 0rom0ted to sa*e them before the new form is loaded. 1<;. What is a library? A library is a collection of s b0rograms incl ding ser named 0roced res7 f nctions and 0ac&ages. 11<. What is the ad*antage of the library? )ibraryFs 0ro*ide a con*enient means of storing client/side 0rogram nits and sharing them among m lti0 le a00lications. :nce yo create a library7 yo can attach it to any other form7men 7or library mod les. When yo can call library 0rogram nits from triggers men items commands and ser named ro tine7 yo write in the mod les to which yo ha*e attach the library. when a library attaches another library 70rogram nits in the first library can reference 0rogram nits in the attached library. )ibrary s 00ort dynamic loading/that is library 0rogram nits are loaded into an a00lication only when needed. !his can significantly red ce the r n/time memory re= irements of an a00lications. 111. What is stri0 so rces generate o0tions? Remo*es the so rce code from the library file and generates a library files that contains only 0code.!he res lting file can be sed for final de0loyment7 b t can not be s bse= ently edited in the designer. e>. f13gen mod le#old5lib.0ll serid#scottLtiger stri05so rce I-S o t0 t5file 11$.What are the *b> controls? Bb> control 0ro*ide a sim0le mehtod of b ildig and enhancing ser interfaces.!he controls can se to obtain ser in0 ts and dis0lay 0rogram o t0 ts.*b> control where originally de*elo0 as e>tensions for the ms *is al basic en*ironments and incl de s ch items as sliders7grides and &nobs. 11'. What is a timer? !imer is a ,internal time cloc&, that yo e>0ires. can 0rogrammatically create to 0erform an action each time the timer

111. What are b ilt/ins associated with timers?

find5timer create5timer delete5timer 113. what are difference between 0ost database commit and 0ost/form commit? Host/form commit fires once d ring the 0ost and commit transactions 0rocess7 after the database commit occ res. !he 0ost/form/commit trigger fires after inserts7 0dates and deletes ha*e been 0osted to the database b t before the transactions ha*e been finalished in the iss ing the command.!he 0ost/database/commit trigger fires after oracle forms iss es the commit to finalished transactions. 114. What is a difference between 0re/select and 0re/= ery? ?ires d ring the e>ec te = ery and co nt = ery 0rocessing after oracle forms constr cts the select statement to be iss ed7 b t before the statement is act ally iss ed. !he 0re/= ery trigger fires 6 st before oracle forms iss es the select statement to the database after the o0erator as define the e>am0le records by entering the = ery criteria in enter = ery mode. Hre/= ery trigger fires before 0re/select trigger. 118. What is trigger associated with the timer? When/timer/e>0ired. 119 What is the se of transactional triggers? .sing transactional triggers we can control or modify the defa lt f nctionality of the oracle forms.

RE(ORTS 1. What are the different file e>tensions that are created by oracle re0orts? Re0 file and Rdf file. $. ?rom which designation is it 0referred to send the o t0 t to the 0rinted? Hre*iewer. '. Is it 0ossible to disable the 0arameter from while r nning the re0ort? Ies 1. What is le>ical reference?"ow can it be created? )e>ical reference is 0lace5holder for te>t that can be embedded in a s=l statements.A le>ical reference can be created sing & before the col mn or 0arameter name. 3. What is bind reference and how can it carate? Bind reference are sed to re0lace the single *al e in s=l70lLs=l statements a bind reference can be careated sing a C:D before a col mn or a 0arameter name. 4.What se of command line 0arameter cmd file? It is a command line arg ment that allows yo to s0ecify a file that contain a set of arg ments for r$<r n. 8.Where is a 0roced re ret rn in an e>ternal 0lLs=l library e>ec ted at the client or at the ser*er? At the client. 9. Where is the e>ternal = ery e>ec ted at the client or the ser*er? At the ser*er.

;. What are the defa lt 0arameter that a00ear at r n time in the 0arameter screen? Desty0e and Desname. 1<. Which 0arameter can be Read only. 11. What is term? !he term is terminal definition file that describes the terminal form which yo are sing r$<r n. 1$. What is se of term? !he term file which &ey is corres0ond to which oracle re0ort f nctions. 1'. Is it 0ossible to insert comments into s=l statements ret rn in the data model editor? Ies. 11. If the ma>im m record retrie*ed 0ro0erty of the = ery is set to 1< then a s mmary *al e will be calc lated? :nly for 1< records. 13. What are the s=l cla ses s 00orted in the lin& 0ro0erty sheet? Where startwith ha*ing. 14. !o e>ec te row from being dis0layed that still se col mn in the row which 0ro0erty can be sed? ?ormat trigger. 18. Is it 0ossible to set a filter condition in a cross 0rod ct gro 0 in matri> re0orts? %o. 19. If a brea& order is set on a col mn wo ld it effect col mns which are nder the col mn? %o. 1;. With which f nction of s mmary item is the com0 te at o0tions re= ired? 0ercentage of total f nctions. $<. What is the 0 r0ose of the 0rod ct order o0tion in the col mn 0ro0erty sheet? !o s0ecify the order of indi*id al gro 0 e*al ation in a cross 0rod cts. $1.2an a form la col mn be obtained thro gh a select statement? Ies. $$.2an a form la col mn refered to col mns in higher gro 0? Ies. $'. "ow can a brea& order be created on a col mn in an e>isting gro 0? By dragging the col mn o tside the gro 0. $1. What are the ty0es of calc lated col mns a*ailable? S mmary7 ?orm la7 Hlaceholder col mn. $3. What is the se of 0lace holder col mn? A 0laceholder col mn is sed to hold a calc lated *al es at a s0ecified 0lace rather than allowing is to a00ear in the act al row where it has to a00eared. sed to set read le*el consistency across m lti0le = eries?

$4. What is the se of hidden col mn? A hidden col mn is sed to when a col mn has to embedded into boiler0late te>t. $8. What is the se of brea& gro 0? A brea& gro 0 is be dis0layed. sed to dis0lay one record for one gro 0 ones.While m lti0le related records in other gro 0 can

$9. If two gro 0s are not lin&ed in the data model editor7 What is the hierarchy between them? !wo gro 0 that is abo*e are the left most ran& higher than the gro 0 that is to right or below it. $;.!he 6oin defined by the defa lt data lin& is an o ter 6oin yes or no? Ies. '<. "ow can a te>t file be attached to a re0ort while creating in the re0ort writer? By sing the lin& file 0ro0erty in the layo t boiler 0late 0ro0erty sheet. '1. 2an a re0eating frame be careated witho t a data gro 0 as a base? %o. '$. 2an a field be sed in a re0ort wihto t it a00earing in any data gro 0? Ies. ''. ?or a field in a re0eating frame7 can the so rce come from the col mn which does not e>ist in the data gro 0 which forms the base for the frame? Ies. '1. Is it 0ossible to center an ob6ect horiMontally in a re0eating frame that has a *ariable horiMontal siMe? Ies. '3. If yes7how? By the se anchors. '4. What are the two re0eating frame always associated with matri> ob6ect? :ne down re0eating frame below one across re0eating frame. '8. Is it 0ossible to s0lit the 0rint0re*iewer into more than one region? Ies. '9. Does a gro 0ing done for ob6ects in the layo t editor affect the gro 0ing done in the datamodel editor? %o. ';. "ow can a s= are be drawn in the layo t editor of the re0ort writer? By sing the rectangle tool while 0ressing the C2onstraintD &ey. 1<. !o dis0lay the 0age no. for each 0age on a re0ort what wo ld be the so rce & logical 0age no. or & of 0hysical 0age no.? & 0hysical 0age no. 11. What does the term 0anel refer to with regard to 0ages? A 0anel is the no. of 0hysical 0ages needed to 0rint one logical 0age.

1$. What is an anchoring ob6ect & what is its se? An anchoring ob6ect is a 0rint condition ob6ect which sed to e>0licitly or im0licitly anchor other ob6ects to itself. 1'. What is a 0hysical 0age ? & What is a logical 0age ? A 0hysical 0age is a siMe of a 0age. !hat is o t0 t by the 0rinter. !he logical 0age is the siMe of one 0age of the act al re0ort as seen in the Hre*iewer. 11. What is the frame & re0eating frame? A frame is a holder for a gro 0 of fields. A re0eating frame is sed to dis0lay a set of records when the no. of records that are to dis0layed is not &nown before. R-H:R! !RI++-RS. 13. What are the triggers a*ailable in the re0orts? Before re0ort7 Before form7 After form 7 Between 0age7 After re0ort. 14. Does a Before form trigger fire when the 0arameter form is s 00ressed. Ies. 18. At what 0oint of re0ort e>ec tion is the before Re0ort trigger fired? After the = ery is e>ec ted b t before the re0ort is e>ec ted and the records are dis0layed. 19. Is the After re0ort trigger fired if the re0ort e>ec tion fails? Ies. 1;. +i*e the se= ence of e>ec tion of the *ario s re0ort triggers? Before form 7 After form 7 Before re0ort7 Between 0age7 After re0ort. 3<. Is it 0ossible to modify an e>ternal = ery in a re0ort which contains it? %o. 31. What are the ways to monitor the 0erformance of the re0ort? .se re0orts 0rofile e>ec table statement. .se S() trace facility. 3$. Why is it 0referable to create a fewer no. of = eries in the data model. Beca se for each = ery7 re0ort has to o0en a se0arate c rsor and has to rebind7 e>ec te and fetch data. 3'. What are the *ario s methods of 0erforming a calc lation in a re0ort ? 1. Herform the calc lation in the S() statements itself. $. .se a calc lated L s mmary col mn in the data model. 31. Which of the abo*e methods is the faster method? 0erforming the calc lation in the = ery is faster. 33. Why is a Where cla se faster than a gro 0 filter or a format trigger? Beca se7 in a where cla se the condition is a00lied d ring data retrie*al than after retrie*ing the data.

34. What is the main diff. bet. Re0orts $.< & Re0orts $.3? Re0ort $.3 is ob6ect oriented. 38. What is the diff. bet. setting 0 of 0arameters in re0orts $.< re0orts $.3? ):Bs can be attached to 0arameters in the re0orts $.3 0arameter form. 39. "ow is lin& tool o0eration different bet. re0orts $ & $.3? In Re0orts $.< the lin& tool has to be selected and then two fields to be lin&ed are selected and the lin& is a tomatically created. In $.3 the first field is selected and the lin& tool is then sed to lin& the first field to the second field. R-H:R! $.3 SH-2I?I2 ISS.-S. 3;.What are the two ty0es *iews a*ailable in the ob6ect na*igatorCs0ecific to re0ort $.3D? Biew by str ct re and *iew by ty0e . 4<. Which of the two *iews sho ld ob6ects according to 0ossession? *iew by str ct re. 41."ow is 0ossible to restrict the ser to a list of *al es while entering *al es for 0arameters? By setting the Restrict !o )ist 0ro0erty to tr e in the 0arameter 0ro0erty sheet. 4$. "ow is it 0ossible to select generate a select ste. for the = ery in the = ery 0ro0erty sheet? By sing the tablesLcol mns b tton and then s0ecifying the table and the col mn names. 4'. If a 0arameter is sed in a = ery witho t being 0re*io sly defined7 what diff. e>ist betw. re0ort $.< and $.3 when the = ery is a00lied? While both re0orts $.< and $.3 create the 0arameter7 re0ort $.3 gi*es a message that a bind 0arameter has been created. 41. Do ser 0arameters a00ear in the data modal editor in $.3? %o. 43.What is the diff. when confine mode is on and when it is off? When confine mode is on7 an ob6ect cannot be mo*ed o tside its 0arent in the layo t. 44. What is the diff. when ?le> mode is mode on and when it is off? When fle> mode is on7 re0orts a tomatically resiMes the 0arent when the child is resiMed. 48. "ow can a b tton be sed in a re0ort to gi*e a drill down facility? By setting the action asscoiated with b tton to ->ec te 0lLs=l o0tion and sing the SRW.R n5re0ort f nction. 49. What are the two ways by which data can be generated for a 0arameterFs list of *al es? 1. .sing static *al es. $. Writing select statement.

4;. What are the two 0anes that A00ear in the design time 0lLs=l inter0reter? 1.So rce 0ane. $. Inter0reter 0ane 8<. What are three 0anes that a00ear in the r n time 0lLs=l inter0reter? 1.So rce 0ane. $. inter0reter 0ane. '. %a*igator 0ane. 2R:SS HR:D.2!S A%D MA!RIE R-H:R!S 81. "ow can a cross 0rod ct be created? By selecting the cross 0rod cts tool and drawing a new gro 0 s rro nding the base gro 0 of the cross 0rod cts. 8$. "ow can a gro 0 in a cross 0rod cts be *is ally disting ished from a gro 0 that does not form a cross 0rod ct? A gro 0 that forms 0art of a cross 0rod ct will ha*e a thic&er border. 8'. Atleast how many set of data m st a data model ha*e before a data model can be base on it? ?o r. 81. Is it 0ossible to ha*e a lin& from a gro 0 that is inside a cross 0rod ct to a gro 0 o tside ? CIL%D %o. 83. Is it 0ossible to lin& two gro 0s inside a cross 0rod cts after the cross 0rod cts gro 0 has been created? %o. 84. What is an ser e>it sed for? A way in which to 0ass control Cand 0ossibly arg ments D form :racle re0ort to another :racle 0rod cts of ' +) and then ret rn control C and D bac& to :racle re0rots. 88. What are the three ty0es of ser e>its a*ailable ? :racle Hrecom0iler e>its7 :racle call interface7%on:racle ser e>its. 89. "ow can *al es be 0assed bet. 0recom0iler e>its & :racle call interface? By sing the statement -E-2IA?+-! & -E-2IA?H.!. 8;. "ow can I message to 0assed to the ser from re0orts? By sing SRW.M-SSA+- f nction. Ora !e DBA 1. S%AHS":! is sed for PDBAQ aQ Synonym7 bQ !able s0ace7 cQ System ser*er7 dQ Dynamic data re0lication Ans : D $. We can create S%AHS":!):+ for PDBAQ aQ Sim0le sna0shots7 bQ 2om0le> sna0shots7 cQ Both A & B7 dQ %either A nor B Ans : A

'. !ransactions 0er rollbac& segment is deri*ed from PDBAQ aQ Db5Bloc&5B ffers7 bQ Hrocesses7 cQ Shared5Hool5SiMe7 dQ %one of the abo*e Ans : B 1. -%(.-.- reso rces 0arameter information is deri*ed from PDBAQ aQ Hrocesses or DD)5):2JS and DM)5):2JS7 bQ ):+5B.??-R7 cQ DB55B):2J5SIU-.. Ans : A 3. )+WR 0rocess writes information into aQ Database files7 bQ 2ontrol files7 cQ Redolog files7 dQ All the abo*e. Ans : 2 4. S-! !RA%SA2!I:% .S- R:))BA2J S-+M-%! is sed to create ser ob6ects in a 0artic lar !ables0ace aQ !r e7 bQ ?alse Ans : ?alse 8. Databases o*erall str ct re is maintained in a file called aQ Redolog file7 bQ Data file7 cQ 2ontrol file7 dQ All of the abo*e. Ans : 2 9. !hese following 0arameters are o0tional in init.ora 0arameter file DB5B):2J5SIU-7 HR:2-SS-S aQ !r e7 bQ ?alse Ans : ?alse ;. 2onstraints cannot be e>0orted thro gh -EH:R! command aQ !r e7 bQ ?alse Ans : ?alse 1<. It is *ery diffic lt to grant and manage common 0ri*ileges needed by different gro 0s of database sers sing the roles aQ !r e7 bQ ?alse Ans : ?alse 11. What is difference between a DIA):+ WI%D:W and a D:2.M-%! WI%D:W regarding mo*ing the window with res0ect to the a00lication window aQ Both windows beha*e the same way as far as mo*ing the window is concerned. bQ A doc ment window can be mo*ed o tside the a00lication window while a dialog window cannot be mo*ed cQ A dialog window can be mo*ed o tside the a00lication window while a doc ment window cannot be mo*ed Ans : 2 1$. What is the difference between a M-SSA+-B:E and an A)-R! aQ A messagebo> can be sed only by the system and cannot be sed in ser a00lication while an alert can be sed in ser a00lication also. bQ A alert can be sed only by the system and cannot be se din ser a00lication while an messagebo> can be sed in ser a00lication also. cQ An alert re= ires an res0onse from the serwhile a messagebo> 6 st flashes a message and only re= ires an ac&nowledment from the ser dQ An message bo> re= ires an res0onse from the serwhile a alert 6 st

flashes a message an only re= ires an ac&nowledment from the ser Ans : 2 1'. Which of the following is not an reason for the fact that most of the 0rocessing is done at the ser*er ? aQ !o red ce networ& traffic. bQ ?or a00lication sharing7 cQ !o im0lement b siness r les centrally7 dQ %one of the abo*e Ans : D 11. 2an a DIA):+ WI%D:W ha*e scroll bar attached to it ? aQ Ies7 bQ %o Ans : B 13. Which of the following is not an ad*antage of +.I systems ? aQ Int iti*e and easy to se.7 bQ +.IFs can dis0lay m lti0le a00lications in m lti0le windows cQ +.IFs 0ro*ide more ser interface ob6ects for a de*elo0er dQ %one of the abo*e Ans :D 14. What is the difference between a )IS! B:E and a 2:MB: B:E ? aQ In the list bo>7 the ser is restricted to selecting a *al e from a list b t in a combo bo> the ser can ty0e in a *al e which is not in the list bQ A list bo> is a data entry area while a combo bo> can be sed only for control 0 r0oses cQ In a combo bo>7 the ser is restricted to selecting a *al e from a list b t in a list bo> the ser can ty0e in a *al e which is not in the list dQ %one of the abo*e Ans : A 18. In a 2)I-%!LS-RB-R en*ironment 7 which of the following wo ld not be done at the client ? aQ .ser interface 0art7 bQ Data *alidation at entry line7 cQ Res0onding to ser e*ents7 dQ %one of the abo*e Ans : D 19. Why is it better to se an I%!-+RI!I 2:%S!RAI%! to *alidate data in a table than to se a S!:R-D HR:2-D.R- ? aQ Beca se an integrity constraint is a tomatically chec&ed while data is inserted into or 0dated in a table while a stored 0roced re has to be s0ecifically in*o&ed bQ Beca se the stored 0roced re occ 0ies more s0ace in the database than a integrity constraint definition cQ Beca se a stored 0roced re creates more networ& traffic than a integrity constraint definition Ans : A 1;. Which of the following is not an ad*antage of a clientLser*er model ? aQ A clientLser*er model allows centralised control of data and centralised im0lementation of b siness r les. bQ A clientLser*er model increases de*elo0erKs 0rod cti*ity cQ A clientLser*er model is s itable for all a00lications dQ %one of the abo*e. Ans : 2 $<. What does D)) stands for ? aQ Dynamic )ang age )ibrary

bQ Dynamic )in& )ibrary cQ Dynamic )oad )ibrary dQ %one of the abo*e Ans : B $1. H:S!/B):2J trigger is a aQ %a*igational trigger bQ Jey trigger cQ !ransactional trigger dQ %one of the abo*e Ans : A $$. !he system *ariable that records the select statement that S() G ?:RMS most recently sed to 0o0 late a bloc& is aQ SIS!-M.)AS!5R-2:RD bQ SIS!-M.2.RS:R5R-2:RD cQ SIS!-M.2.RS:R5?I-)D dQ SIS!-M.)AS!5(.-RI Ans: D $'. Which of the following is !R.- for the -%?:R2- J-I field aQ -%?:R2- J-I field characterstic indicates the so rce of the *al e that S()G?:RMS ses to 0o0 late the field bQ A field with the -%?:R2- J-I characterstic sho ld ha*e the I%H.! A)):W-D charaterstic t rned off aQ :nly 1 is !R.bQ :nly $ is !R.cQ Both 1 and $ are !R.dQ Both 1 and $ are ?A)SAns : A $1. What is the ma>im m siMe of the 0age ? aQ 2haracters wide & $43 characters length bQ 2haracters wide & $43 characters length cQ 2haracters wide & 9< characters length dQ %one of the abo*e Ans : B $3. A ?:RM is made 0 of which of the following ob6ects aQ bloc&7 fields only7 bQ bloc&s7 fields7 0ages only7 cQ bloc&s7 fields7 0ages7 triggers and form le*el 0roced res7 dQ :nly bloc&s. Ans : 2 $4. ?or the following statements which is tr e 1Q Hage is an ob6ect owned by a form $Q Hages are a collection of dis0lay information s ch as constant te>t and gra0hics. aQ :nly 1 is !R.bQ :nly $ is !R.cQ Both 1 & $ are !R.dQ Both are ?A)SAns : B $8. !he 0ac&aged 0roced re that ma&es data in form 0ermanent in the Database is aQ Host bQ Host form cQ 2ommit form dQ %one of the abo*e Ans : 2 $9. Which of the following is !R.- for the SIS!-M BARIAB)- YYdateYY aQ 2an be assigned to a global *ariable

bQ 2an be assigned to any field only d ring design time cQ 2an be assigned to any *ariable or field d ring r n time dQ %one of the abo*e Ans : B $;. Which of the following 0ac&aged 0roced re is .%R-S!RI2!-D ? aQ 2A))5I%H.!7 bQ 2)-AR5B):2J7 cQ -E-2.!-5(.-RI7 dQ .S-R5-EI! Ans : D '<. Identify the R-S!RI2!-D 0ac&aged 0roced re from the following aQ .S-R5-EI!7 bQ M-SSA+-7 cQ BR-AJ7 dQ -EI!5?:RM Ans : D '1. What is S()G?:RMS aQ S()G?:RMS is a 1+) tool for de*elo0ing & e>ec ting :racle based interacti*e a00lications. bQ S()G?:RMS is a '+) tool for connecting to the Database. cQ S()G?:RMS is a re0orting tool dQ %one of the abo*e. Ans : A '$. %ame the two files that are created when yo generate a form sing ?orms '.< aQ ?MB & ?ME7 bQ ?MR & ?DE7 cQ I%H & ?RM7 dQ %one of the abo*e Ans : 2

''. What is a trigger aQ A 0iece of logic written in H)LS() bQ ->ec ted at the arri*al of a S()G?:RMS e*ent cQ Both A & B dQ %one of the abo*e Ans : 2 '1. Which of the folowing is !R.- for a -RAS- 0ac&aged 0roced re 1Q -RAS- remo*es an indicated +lobal *ariable & releases the memory associated with it $Q -RAS- is sed to remo*e a field from a 0age 1Q :nly 1 is !R.$Q :nly $ is !R.'Q Both 1 & $ are !R.1Q Both 1 & $ are ?A)SAns : 1 '3. All datafiles related to a !ables0ace are remo*ed when the !ables0ace is dro00ed aQ !R.bQ ?A)SAns : B '4. SiMe of !ables0ace can be increased by aQ Increasing the siMe of one of the Datafiles bQ Adding one or more Datafiles cQ 2annot be increased dQ %one of the abo*e Ans : B '8. M lti0le !ables0aces can share a single datafile aQ !R.bQ ?A)SAns : B '9. A set of Dictionary tables are created aQ :nce for the -ntire Database

bQ -*ery time a ser is created cQ -*ery time a !ables0ace is created dQ %one of the abo*e Ans : A ';. Datadictionary can s0an across m lti0le !ables0aces aQ !R.bQ ?A)SAns : B 1<. What is a DA!AB):2J aQ Set of ->tents bQ Set of Segments cQ Smallest Database storage nit dQ %one of the abo*e Ans : 2 11. 2an an Integrity 2onstraint be enforced on a table if some e>isting table data does not satisfy the constraint aQ Ies bQ %o Ans : B 1$. A col mn defined as HRIMARI J-I can ha*e %.))Fs aQ !R.bQ ?A)SAns : B 1'. A !ransaction ends aQ :nly when it is 2ommitted bQ :nly when it is Rolledbac& cQ When it is 2ommitted or Rolledbac& dQ %one of the abo*e Ans : 2 11. A Database Hroced re is stored in the Database aQ In com0iled form bQ As so rce code cQ Both A & B dQ %ot stored Ans : 2 13. A database trigger doesnot a00ly to data loaded before the definition of the trigger aQ !R.bQ ?A)SAns : A 14. Dedicated ser*er config ration is aQ :ne ser*er 0rocess / Many ser 0rocesses bQ Many ser*er 0rocesses / :ne ser 0rocess cQ :ne ser*er 0rocess / :ne ser 0rocess dQ Many ser*er 0rocesses / Many ser 0rocesses Ans : 2 18. Which of the following does not affect the siMe of the S+A aQ Database b ffer bQ Redolog b ffer cQ Stored 0roced re dQ Shared 0ool Ans : 2 19. What does a 2:MMI! statement do to a 2.RS:R aQ :0en the 2 rsor bQ ?etch the 2 rsor

cQ 2lose the 2 rsor dQ %one of the abo*e Ans : D

1;. Which of the following is !R.1Q "ost *ariables are declared anywhere in the 0rogram $Q "ost *ariables are declared in the D-2)AR- section aQ :nly 1 is !R.bQ :nly $ is !R.cQ Both 1 & $are !R.dQ Both are ?A)SAns : B 3<. Which of the following is %:! BA)ID is H)LS() aQ Bool booleanK bQ %.M17 %.M$ n mberK cQ de0tname de0t.dnameNty0eK dQ date1 date :# sysdate Ans : B 31. Declare f*ar n mber :# n llK s*ar n mber :# 3 Begin goto SS f0rocTT if f*ar is n ll then SS f0rocTT s*ar :# s*ar R 3 end ifK -ndK What will be the *al e of s*ar after the e>ec tion ? aQ -rror bQ 1< cQ 3 dQ %one of the abo*e Ans : A 3$. Which of the following is not correct abo t an ->ce0tion ? aQ Raised a tomatically L ->0licitly in res0onse to an :RA2)-5-RR:R bQ An e>ce0tion will be raised when an error occ rs in that bloc& cQ Hrocess terminates after com0letion of error se= ence. dQ A Hroced re or Se= ence of statements may be 0rocessed. Ans : 2 3'. Which of the following is not correct abo t .ser5Defined ->ce0tions ? aQ M st be declared bQ M st be raised e>0licitly cQ Raised a tomatically in res0onse to an :racle error dQ %one of the abo*e Ans : 2

31. A Stored Hroced re is a aQ Se= ence of S() or H)LS() statements to 0erform s0ecific f nction bQ Stored in com0iled form in the database cQ 2an be called from all client en*ironmets dQ All of the abo*e Ans : D

33. Which of the following statement is false aQ Any 0roced re can raise an error and ret rn an ser message and error n mber bQ -rror n mber ranging from $<<<< to $<;;; are reser*ed for ser defined messages cQ :racle chec&s .ni= eness of .ser defined errors dQ Raise5A00lication5error is sed for raising an ser defined error. Ans : 2 34. Is it 0ossible to o0en a c rsor which is in a Hac&age in another 0roced re ? aQ Ies bQ %o Ans : A 38. Is it 0ossible to !riggers ? aQ Ies bQ %o Ans : B 39. Is it 0ossible to -nable or Disable a Database trigger ? aQ Ies bQ %o Ans : A 3;. H)LS() s 00orts dataty0eCsD aQ Scalar dataty0e bQ 2om0osite dataty0e cQ All of the abo*e dQ %one of the abo*e Ans 2 4<. ?ind the :DD dataty0e o t aQ BAR2"AR$ bQ R-2:RD cQ B::)-A% dQ RAW Ans : B se !ransactional control statements in Database

41. Which of the following is not correct abo t the ,!AB)-, dataty0e ? aQ 2an contain any no of col mns bQ Sim lates a :ne/dimensional array of nlimited siMe cQ 2ol mn dataty0e of any Scalar ty0e dQ %one of the abo*e Ans : A 4$. ?ind the :DD one o t of the following aQ :H-% bQ 2):ScQ I%S-R! dQ ?-!2" Ans 2 4'. Which of the following is not correct abo t 2 rsor ?

aQ 2 rsor is a named Hri*ate S() area bQ 2 rsor holds tem0orary res lts cQ 2 rsor is sed for retrie*ing m lti0le rows dQ S() ses im0licit 2 rsors to retrie*e rows Ans : B 41. Which of the following is %:! BA)ID in H)LS() ? aQ Select ... into bQ .0date cQ 2reate dQ Delete Ans : 2 43. What is the Res lt of the following FBIJF\\%.))\\FRAMF ? aQ -rror bQ BIJ RAM cQ BIJRAM dQ %.)) Ans : 2 44. Declare a n mber :# 3K b n mber :# n llK c n mber :# 1<K Begin if a T b A%D a S c then a :# c G aK end ifK -ndK What will be the *al e of FaF after e>ec tion ? aQ 3< bQ %.)) cQ 3 dQ %one of the abo*e Ans : 2 48. Does the Database trigger will fire when the table is !R.%2A!-D ? aQ Ies bQ %o Ans : B 49. S.BS!RCS(.AR- A%S A)WAIS W:RJ "ARD71174D will ret rn aQ A)WAI b_ S A)WA cQ A)WAIS Ans : 2 4;. R-H)A2-CFVA2J A%D V.-F7FVF7FB)FD will ret rn aQ VA2J A%D B).bQ B)A2J A%D VA2J cQ B)A2J A%D B).dQ %one of the abo*e Ans : 2 8<. !RA%S)A!-CF'''S(D$'1F7F<1$'13489;AB2DH(RS!F7F<1$'13489;FD will ret rn aQ '''$'1 bQ '''''' cQ $'1''' dQ %one of the abo*e Ans : A 81. -MH%: -%AMSA) A9$$ RAMASWAMI '3<< A91$ %ARAIA% 3<<<

A;8' A3<<

.M-S" BA)AVI

$93< 383<

.se these data for the following ( estions Select SA) from -MH -1 where ' T C Select co ntCGD from -m0 -$ where -1.SA) T -$.SA) D will retrie*e aQ '3<<73<<<7$3<< bQ 3<<<7$93< cQ $93<7383< dQ 3<<<7383< Ans : A 8$. Is it 0ossible to modify a Dataty0e of a col mn when col mn contains data ? aQ Ies bQ %o Ans B

8'. Which of the following is not correct abo t a Biew ? aQ !o 0rotect some of the col mns of a table from other sers bQ :c 0ies data storage s0ace cQ !o hide com0le>ity of a = ery dQ !o hide com0le>ity of a calc lations Ans : B 81. Which is not 0art of the Data Definiton )ang age ? aQ 2R-A!bQ A)!-R cQ A)!-R S-SSI:% Ans : 2 83. !he Data Mani0 lation )ang age statements are aQ I%S-R! bQ .HDA!cQ S-)-2! dQ All of the abo*e Ans : D 84. -MH%: -%AMSA) A9$$ RAMASWAMI '3<< A91$ %ARAIA% 3<<< A;8' .M-S" A3<< BA)AVI 383< .sing the abo*e data Select co ntCsalD from -m0 will retrie*e aQ 1 bQ < cQ ' dQ %one of the abo*e Ans : 2 88. If an .%I(.- J-I constraint on DA!- col mn is created7 will it acce0t the rows that are inserted with SISDA!- ? aQ Will bQ WonFt

Ans : B 89. What are the different e*ents in !riggers ? aQ Define7 2reate bQ Dro07 2omment cQ Insert7 .0date7 Delete dQ All of the abo*e Ans : 2 8;. What b ilt/in s b0rogram is sed to mani0 late images in image items ? aQ Uoom5o t bQ Uoom5inF cQ Image5Moom dQ Uoom5image Ans : 2 9<. 2an we 0ass R-2:RD +R:.H between ?:RMS ? aQ Ies bQ %o Ans : A 91. S":W5A)-R! f nction ret rns aQ Boolean bQ % mber cQ 2haracter dQ %one of the abo*e Ans : B 9$. What SIS!-M BARIAB)- is sed to refer DA!ABAS- !IM- ? aQ YYdbtimeYY bQ YYtimeYY cQ YYdatetimeYY dQ %one of the abo*e Ans : A 9'. :SIS!-M.-??-2!IB-.DA!- *araible is aQ Read only bQ Read & Write cQ Write only dQ %one of the abo*e Ans : 2 91. "ow can yo 2A)) Re0orts from ?orms1.< ? aQ R n5Re0ort b ilt5in bQ 2all5Re0ort b ilt5in cQ R n5Hrod ct b ilt5in dQ 2all5Hrod ct b ilt5in Ans : 2 93. When do yo get a .H)) e>tension ? aQ Sa*e )ibrary file bQ +enerate )ibrary file cQ R n )ibrary file dQ %one of the abo*e Ans : A 94. What is b ilt5in S b0rogram ? aQ Stored 0roced re & ? nction bQ 2ollection of S b0rogram

cQ 2ollection of Hac&ages dQ %one of the abo*e Ans : D 98. +-!5B):2J 0ro0erty is a aQ Restricted 0roced re bQ .nrestricted 0roced re cQ )ibrary f nction dQ %one of the abo*e Ans : D 99. A 2:%!R:) B):2J can sometimes refer to a BAS-!AB)- ? aQ !R.bQ ?A)SAns : B 9;. What do yo mean by 2"-2J B:E ? aQ !wo state control bQ :ne state control cQ !hree state control dQ none of the abo*e Ans : 2 / Hlease chec& the 2orrecness of this Answer C !he correct answer is $ D ;<. )ist of Bal es C):BD s 00orts aQ Single col mn bQ M lti col mn cQ Single or M lti col mn dQ %one of the abo*e Ans : 2 ;1. What is )ibrary in ?orms 1.< ? aQ 2ollection of ->ternal field bQ 2ollection of b ilt5in 0ac&ages cQ 2ollection of H)LS(l f nctions7 0roced res and 0ac&ages dQ 2ollection of H)LS() 0roced res & triggers Ans : 2 ;$. 2an we se a R-S!RI2!-D 0ac&aged 0roced re in W"-%5!-E!5I!-M trigger ? aQ Ies bQ %o Ans : B

;'. 2an we se +:5B):2J 0ac&age in a HR-5!-E!5I!-M trigger ? aQ Ies bQ %o Ans : B ;1. What ty0e of file is sed for 0orting ?orms 1.3 a00lications to *ario s 0latforms ? aQ .?MB file bQ .?ME file cQ .?M! file dQ .-E- file Ans : 2 ;3. What b ilt5in 0roced re is sed to get IMA+-S in ?orms 1.3 ?

aQ R-AD5IMA+-5?I)bQ +-!5IMA+-5?I)cQ R-AD5?I)dQ +-!5?I)Ans A ;4. When a form is in*o&ed with 2A))5?:RM does :racle forms iss es SAB-H:I%! ? aQ Ies bQ %o Ans : A ;8. 2an we attach the same ):B to different fields in Design time ? aQ Ies bQ %o Ans : A ;9. "ow do yo 0ass *al es from one form to another form ? aQ ):B bQ Harameters cQ )ocal *ariables dQ %one of the abo*e Ans : B ;;. 2an yo co0y the HR:+RAM .%I! into an :b6ect gro 0 ? aQ Ies bQ %o Ans : B 1<<. 2an M.)!IH)- D:2.M-%! I%!-R?A2- CMDID be sed in ?orms 1.3 ? aQ Ies bQ %o Ans : A 1<1. When is a .?MB file e>tension is created in ?orms 1.3 ? aQ +enerating form bQ ->ec ting form cQ Sa*e form dQ R n form Ans : 2 1<$. What is a B ilt5in s b0rogram ? aQ )ibrary bQ Stored 0roced re & ? nction cQ 2ollection of S b0rograms dQ %one of the abo*e Ans : D 1<'. What is a RADI: +R:.H ? aQ M t ally e>cl si*e bQ Select more than one col mn cQ Abo*e all !R.dQ Abo*e all ?A)SAns : A 1<1. Identify the :dd one of the following statements ? aQ Ho0list bQ !list cQ )ist of *al es

dQ 2ombo bo> Ans : 2 1<3. What is an A)-R! ? aQ Modeless window bQ Modal window cQ Both are !R.dQ %one of the abo*e Ans : B 1<4. 2an an Alert message be changed at r ntime ? aQ Ies bQ %o Ans : A 1<8. 2an we create an ):B witho t an R-2:RD +R:.H ? a_ Ies bQ %o Ans : B

1<9. "ow many no of col mns can a R-2:RD +R:.H ha*e ? aQ 1< bQ $< cQ 3< dQ %one of the abo*e Ans D 1<;. :racle 0recom0iler translates the -MB-DD-D S() statemens into aQ :racle ?:RMS bQ :racle R-H:R!S cQ :racle )IBRARI dQ %one of the abo*e Ans : D 11<. Jind of 2:MM-%! statements 0laced within S() statements ? aQ Asteris&CGD in col mn ? bQ A%SI S() style statementsC...D cQ 2/Style comments CLG......GLD dQ All the abo*e Ans : D 111. What is the a00ro0riate destination ty0e to send the o t0 t to a 0rinter ? aQ Screen bQ Hre*iewer cQ -ither of the abo*e dQ %one of the abo*e Ans : D 11$. What is !-RM ? aQ !-RM is the terminal definition file that describes the terminal from which yo are sing R$<R.% C Re0orts r n time D bQ !-RM is the terminal definition file that describes the terminal from which yo are sing R$<D-S C Re0orts designer D cQ !here is no Harameter called !-RM in Re0orts $.< dQ %one of the abo*e

Ans : A 11'. If the ma>im m records retrie*ed 0ro0erty of a = ery is set to 1<7 then a s mmary *al e will be calc lated aQ :nly for 1< records bQ ?or all the records retrie*ed cQ ?or all therecords in the referenced table dQ %one of the abo*e Ans : A 111. With which f nction of a s mmary item in the 2:MH.!- A! o0tion re= ired ? aQ S m bQ Standard de*iation cQ Bariance dQ N of !otal f nction Ans : D 113. ?or a field in a re0eating frame7 can the so rce come from a col mn which does not e>ist in the datagro 0 which forms the base of the frame ? aQ Ies bQ %o Ans : A 114. What are the different file e>tensions that are created by :racle Re0orts ? aQ .RD? file & .RHE file bQ .RDE file & .RD? file cQ .R-H file & .RD? file dQ %one of the abo*e Ans : 2 118. Is it 0ossible to Disable the Harameter form while r nning the re0ort ? aQ Ies bQ %o Ans : A 119.What are the S() cla ses s 00orted in the lin& 0ro0erty sheet ? aQ W"-R- & S!AR! WI!" bQ W"-R- & "ABI%+ c_ S!AR! WI!" & "ABI%+ dQ W"-R-7 S!AR! WI!" & "ABI%+ Ans : D 11;. What are the ty0es of 2alc lated col mns a*ailable ? aQ S mmary7 Hlace holder & Hroced re col mn bQ S mmary7 Hroced re & ?orm la col mns cQ Hroced re7 ?orm la & Hlace holder col mns dQ S mmary7 ?orm la & Hlace holder col mns Ans.: D 1$<. If two gro 0s are not lin&ed in the data model editor7 what is the hierarchy between them? aQ !here is no hierarchy between nlin&ed gro 0s bQ !he gro 0 that is right ran&s higher than the gro 0 that is to the left cQ !he gro 0 that is abo*e or leftmost ran&s higher than the gro 0 that is to right or below it

dQ %one of the abo*e Ans : 2 1$1. Se= ence of e*ents ta&es 0lace while starting a Database is aQ Database o0ened7 ?ile mo nted7 Instance started bQ Instance started7 Database mo nted & Database o0ened cQ Database o0ened7 Instance started & file mo nted dQ ?iles mo nted7 Instance started & Database o0ened Ans : B 1$$. SIS!-M !AB)-SHA2- can be made off/line aQ Ies bQ %o Ans : B 1$'. -%(.-.-5R-S:.R2-S 0arameter information is deri*ed from aQ HR:2-SS or DD)5):2JS & DM)5):2JS bQ ):+ B.??-R cQ DB5B):2J5SIUdQ DB5B):2J5B.??-RS Ans : A 1$1. SM:% 0rocess is sed to write into ):+ files aQ !R.bQ ?A)SAns : B 1$3. -EH command is sed aQ !o ta&e Bac& 0 of the :racle Database bQ !o im0ort data from the e>0orted d m0 file cQ !o create Rollbac& segments dQ %one of the abo*e Ans : A 1$4. S%AHS":!S cannot be refreshed a tomatically aQ !R.bQ ?A)SAns : B 1$8. !he .ser can set Archi*e file name formats aQ !R.bQ ?A)SAns : A 1$9. !he following 0arameters are o0tional in init.ora 0arameter file DB5B):2J5SIU-7 HR:2-SS a_ !R.bQ ?A)SAns : B 1$;. %:AR2"I-B-):+ 0arameter is sed to enable the database in Archie*e mode aQ !R.bQ ?A)SAns : B 1'<. 2onstraints cannot be e>0orted thro gh ->0ort command? aQ !R.bQ ?A)SAns: B 1'1. It is *ery diffic lt to grant and manage common 0ri*eleges needed by Different gro 0s of Database sers sing roles aQ !R.bQ ?A)S-

Ans: B 1'$. !he stat s of the Rollbac& segment can be *iewed thro gh aQ DBA5S-+M-%!S bQ DBA5R:)-S cQ DBA5?R--5SHA2-S dQ DBA5R:))BA2J5S-+ Ans: D 1''. ->0licitly we can assign transaction to a rollbac& segment aQ !R.BQ ?A)SAns: A 1'1. What file is read by :DB2 to load dri*ers ? aQ :DB2.I%I bQ :DB2.D)) cQ :DB2DRB.I%I dQ %one of the abo*e Ans: A Q"iE T 1 1DDis0lay the names of all the em0loyees and their e>0erience in years. SELECT ENA)E?ROUNDI)ONT7S;BETWEENIS*SDATE?7IREDATEG@12G AS EF(ERINCE 9RO) E)( $DDis0lay the em0loyee name and his managerFs name. ANS. se!e t a.e,a3e as e32!o4ee?1.e,a3e as 3a,a5er 0ro3 e32 a?e32 1 where 1.e32,oWa.35r 'DDis0lay the em0loyeeFs name7 de0artmentFs name 7grade and managerFs name. SQLV SELECT a.ENA)E?DNA)E?s.5ra/e?B.ENA)E 2 9RO) e32 a?E)( B?DE(T D?sa!5ra/e s 8 W7ERE a.35rW1.e32,o : AND A.DE(TNOWD.DE(TNO & A,/ a.sa! 1etwee, s.!osa! a,/ s.hisa! & @ 1DDis0lay the em0 name and salary those earn more than the a*erage salary of the com0any. se!e t e,a3e?sa! 0ro3 e32 where sa!VIse!e t a#5Isa!G 0ro3 e32GY 3DDis0lay all the em0loyees who earn more than their managerFs salary. SELECT A.E)(NO 9RO) E)( A?E)( B W7ERE B.E)(NOWA.)>R AND A.SALVB.SAL 4DDis0lay all the em0loyees whose grade is the same as that of V:%-S. Se!e t e32,o?e,a3e 0ro3 E32 A?SAL>RADE S?Ise!e t 5ra/e 0ro3 sa!5ra/e?e32 Where sa! 1etwee, LOsa! a,/ 7Isa! A,/ e,a3eWAQONESAG B W7ERE A.SAL BETWEEN S.LOSAL AND S.7ISAL AND S.>RADEWB.>RADE AND A.ENA)E `VAQONESA OR Se!e t e32,o?e,a3e 0ro3 E32 A?SAL>RADE S W7ERE A.SAL BETWEEN S.LOSAL AND S.7ISAL AND S.>RADEWIse!e t 5ra/e

0ro3 sa!5ra/e?e32 Where sa! 1etwee, LOsa! a,/ 7Isa! A,/ e,a3eWAQONESAG AND A.ENA)E `VAQONESA 8DDis0lay all em0loyee names and their salaries whose salary is not in the range on 13<< and $93< !he 2ol mn "eading to be dis0layed as -m0 Monthly %ame Salary //// ////// SQLV o!"3, e,a3e hea/i,5 AE32SNa3eA SQLV o!"3, sa! hea/i,5 A)o,th!4SSa!ar4A SQLV se!e t e,a3e?sa! 2 0ro3 e32 8 where sa! ,ot 1etwee, 1&.. a,/ 2'&.Y 9DDis0lay the name of the em0loyee who donFt ha*e any manager. se!e t e,a3e 0ro3 e32 where 35r is ,"!!Y ;DDis0lay the name 7salary and commission for all em0loyees whose commission amo nt is greater than their salary increased by 1<N se!e t e,a3e?sa!? o33 0ro3 e32 where o33 VI1.1Bsa!GY 1<DDis0lay the -name7salary and salary increased by 13N e>0ressed as a whole n mber.)abel the col mn %ew Salary.In addition to this dis0lay the Increase of salary o*er the 0re*io s one.?or ->am0le. -%AM- SA) %-WSA) I%2R-AS///// /// ////// /////// JI%+ 3<<< 33<< 3<< SELECT ENA)E?SAL?ROUNDISALB1.1&G AS NEWSAL?ROUNDISALB1.1&G-sa! AS INCREASE 9RO) E)(

11DDis0lay the -m0loyee name 7hiredate7 salary re*iew date which is the first Monday after 4 months of the ser*ice. -name "iredate Re*iew ///// //////// ////// JI%+ 18/%:B/91 Monday7 the !wenty/?orth of May71;9$ se!e t e,a3e as E,a3e? hire/ate as 7ire/ate? to; harI,ext;/a4Ia//;3o,thsIhire/ate?<G?A3o,/a4AG?ADa4K?theK //s2 Ko0K 3o,th rrrrAG as Re#iew 0ro3 e32 @

1$D2reate a = ery that will dis0lay the em0loyee name 7de0t n mber and all the em0loyees name that wor& in tha same de0t as a gi*en em0loyee. se!e t a.e,a3e?a./e2t,o?1.e,a3e 0ro3 e32 a?e32 1 where 1./e2t,oWa./e2t,o a,/ a.e,a3e LW1.e,a3e or/er 14 a./e2t,o?a.e,a3e 1'D Dis0lay the Vob and the no. of 0ersons wor&ing in each 6ob ty0e. se!e t Co1? o",tICo1G 0ro3 e32 5ro"2 14 Co1Y 11D Dis0lay de0t name7location7n mber of em0loyees and the a*erage salary for all em0loyees in that de0t.

se!e t /,a3e?!o ? o",tIe32,oG?a#5Isa!G 0ro3 e32?/e2t where e32./e2t,oINGW/e2t./e2t,o 5ro"2 14 /,a3e?!o 13D Dis0lay the em0name7salary of all em0loyees who re0ort to JI%+. se!e t a.e,a3e?a.sa! 0ro3 e32 a?e32 1 where 1.e32,oWa.35r a,/ 1.e,a3e WAKIN>A @ select ename7salRn*lCcomm7<D76ob7loc from em07de0t where em0.de0tno#de0t.de0tno and salRn*lCcomm7<DT Cselect salRn*lCcomm7<D from em0 where ename#@V:%-S@DK EFERCISE 1 Q"iE - 2 1.Dis0lay c rrent date and 89 days after. SELECT S*SDATE? S*SDATEN=' 9RO) DUALY $. Dis0lay the c rrent date in the following fashion. !odayFs date is : Van 1 1;;9. SELECT TO;C7ARIS*SDATE?A KTo/a4AAs /ate is PK )ON D ****AG 9RO) DUAL '. Dis0lay -m0loyee name and Vob information from em0loyee in the following fashion. SMI!" Wor&s as 2)-RJ. se!e t e,a3eSSA Wor$s as ASSCo1 0ro3 e32 1. Dis0lay all the information from de0artment table where second character of city name is FAF. SELECT B 9RO) DE(T W7ERE LOC LIKE A;AUA 3. Dis0lay rowid7 em0loyee n mber from em0loyee table. SQLV SELECT ROWID?E)(NO 9RO) E)(Y 4. Dis0lay rowid7 row n mber7 de0tno from de0artment table. SQLV SELECT ROWID?ROWNU)?DE(TNO 9RO) DE(T 2 @ 8. Dis0lay the last date in ?eb/;8 se!e t LAST;DA*Ito;/ateIA9EB-+=A?A)ON-**AGG 9RO) DUAL

9. Dis0lay logged on ser name in the following fashion. 2 rrent .ser %ame is : S2:!! se!e t AC"rre,t User Na3e isP A SS "ser 0ro3 /"a!Y

;. Dis0lay FI:. AR- +::D I% S()F te>t as FIo Are +ood In S=lF in a Select statement. SELECT INITCA(IAU ARE >OOD IN SQLAG9RO) DUALY 1<. Dis0lay c rrent date and 89 days before. SQLV SELECT S*SDATE?S*SDATE-=' 9RO) DUALY

>ro"2 9", tio,s WWWWWWWWWWWWWWW 1. Select ma>im m7 minim m salary in em0loyee table. se!e t 3axIsa!G?3i,Isa!G 0ro3 e32Y $. Select minim m salary7commission in em0loyee table for de0tno $<. se!e t sa!? o33 0ro3 e32 where /e2t,oW2. a,/ sa!WIse!e t 3i,Isa!G 0ro3 e32 where /e2t,oW2.G '. Select em0loyee n mber7 em0loyee name7 de0artment n mber whose s m of salary and commission greater than $3<<. se!e t e32,o? e,a3e? /e2t,o 0ro3 e32 where e32,o i, Ise!e t e32,o 0ro3 e32 a ha#i,5 s"3Isa!N o33G V 2&.. 5ro"2 14 e32,oG 1.Select em0loyee n mber7 em0loyee name7 em0loyee e>0erience in years from em0loyee table. se!e t e32,o?e,a3e?ro",/I3o,ths;1etwee,Is4s/ate?hire/ateG@12G 0ro3 e32Y 3. Select em0loyee n mber 7 em0loyee name hired in the month of 6 ly. se!e t e32,o?e,a3e 0ro3 e32 where to; harIhire/ate?A)ONAGWAQULA 4.Select em0loyee name 7"iredate in the format of ,$nd of 6 ly 1;;8, for de0tno 1< and $<. SELECT ENA)E?TO;C7ARI7IREDATE?A//th Ko0K 3o,th rrrrAG 0ro3 e32 where /e2t,o i,I1.?2.G 8.Dis0lay em0loyee names in lower case whose salary is greater than $<<< and less than $9<<. se!e t !owerIe,a3eG 0ro3 e32 where sa! 1etwee, 2... a,/ 2'..Y 9.Select the n mber of em0loyees who has no commission . se!e t o",tIe32,oG 0ro3 e32 where o33 is ,"!!Y ;.Select em0loyee name whose 6ob is Manager or 2ler& and Salary greater than 1<<< and commission greater than 1<< and de0tno is either 1< or $<. se!e t e,a3e 0ro3 e32 where Co1 i,IA)ANA>ERA?ACLERKAG AND SAL V1... AND CO))V1.. AND DE(TNO INI1.?2.GY 1<.Select em0loyee names in an al0habetical order. se!e t e,a3e 0ro3 e32 or/er 14 e,a3eY

SQL Exer ise ISi32!e Qoi,sG 1. Dis0lay em0loyee n mber7 em0loyee name7 de0artment name7 location from em0loyee and de0artment tables. Se!e t e32,o?e,a3e?/,a3e?!o 0ro3 e32?/e2t where e32./e2t,oINGW/e2t./e2t,o $. Dis0lay em0loyee n mber7 em0loyee name7 salary R comm as !:!A)7 location from em0loyee and de0artment tables. Se!e t e32,o?e,a3e?/,a3e?!o ?s"3Isa!N o33G as tota! 0ro3 e32?/e2t where e32./e2t,oINGW/e2t./e2t,o

5ro"2 14 e32,o?e,a3e?/,a3e?!o L '. Dis0lay em0loyee name7 location from em0loyee and de0artment tables. se!e t e,a3e?!o 0ro3 e32?/e2t where e32./e2t,oW/e2t./e2t,o :. Di2!a4 e32!o4ee ,a3e? /e2art3e,t ,a3e? Co1 0ro3 e32!o4ee a,/ /e2art3e,t ta1!es who Co1 is CLERK. select ename7dname76ob from em07de0t where em0.de0tno#de0t.de0tno and 6ob#F2)-RJF &. Dis2!a4 e32!o4ee ,a3e? /e2t,o? /,a3e 0ro3 e32!o4ee a,/ /e2art3e,t ta1!e where !o atio, is DALLAS. select ename7A.d-H!%:7D%AM- from em0 A7de0t where A.de0tno#de0t.de0tno and ):2#FDA))ASF 4. Dis0lay em0loyee n mber7 name7 address and city from em0loyee7 em0loyee address tables. Se!e t a.e32,o?a.e,a3e?1.a//ress?1. it4 0ro3 e32 a?a//ress 1 Where a.e32,oW1.e32,oY 8. Dis0lay em0loyee nmae7 address from em0loyee and em0loyee address tables who li*es in Mi0 code 83<'; Se!e t a.e32,o?a.e,a3e?1.a//ress?1. it4 0ro3 e32 a?a//ress 1 Where a.e32,oW1.e32,o A,/ 1.Ei2; o/eW=&.8+Y 9. Dis0lay em0loyee name7 de0artment name7 location who were getting comm as n ll. Se!e t e,a3e?/,a3e?!o 0ro3 e32?/e2t Where e32./e2t,oW/e2t./e2t,o A,/ o33 is ,"!!Y ;. Dis0lay first ' characters of em0loyee name7 6ob7 sal7 comm7 location from em0loyee and de0artment tables who wor&s in de0artment $< or '<7 salary sho ld be more than 1<<< comm as not n ll. Se!e t s"1strIe,a3e?1?8G?Co1?sa!? o33?!o 9ro3 e32?/e2t Where e32./e2t,oW/e2t./e2t,o A,/ e32./e2t,o i,I2.?8.G A,/ sa! V1... A,/ o33 is ,ot ,"!!Y 1<. Dis0lay location7 de0artment name7 length of location7 length of de0artment name for em0loyee n mbers 1<<17 1<<97 1<<;. Se!e t !o ?/,a3e?!e,5thI!o G?!e,5thI/,a3eG 9ro3 e32?/e2t where e32./e2t,oW/e2t./e2t,o A,/ e32,o i, I1..1?1..'?1..+GY Exer ise I>ro"2 B4 C!a"seG 1. Dis0lay de0tno7 n mber of em0loyee wor&s in each de0artment.

se!e t /e2t./e2t,o? o",tIe32,oG 0ro3 e32?/e2t where e32./e2t,oINGW/e2t./e2t,o 5ro"2 14 /e2t./e2t,o $. Dis0lay 6ob7 n mber of em0loyees wor&s in each category. se!e t Co1? o",tIe32,oG 0ro3 e32 5ro"2 14 Co1 L '. Dis0lay 6ob and a*erge salary 0aid for each 6obs in the com0any. se!e t Co1?a#5Isa!G 0ro3 e32 5ro"2 14 Co1

@ 1. Dis0lay location and s m of the salary s0ending for em0loyees on that location res0ecti*ely. se!e t !o ?s"3Isa!G 0ro3 e32?/e2t where e32./e2t,oINGW/e2t./e2t,o 5ro"2 14 !o &. Se!e t 3i,i3"3 sa!ar4? 3axi3"3 sa!ar4 i, ea h /e2art3e,t. Select minCsalD7ma>CsalD from em0 gro 0 by de0tnoK 4. Select de0artment n mber7 dname7 a*erage salary for each de0artment. Se!e t /e2t./e2t,o?/,a3e?a#5Isa!G 0ro3 e32?/e2t Where /e2t./e2t,oWe32./e2t,oING >ro"2 14 /e2t./e2t,o =. Se!e t Co1? ,"31er o0 e32!o4ees wor$i,5 i, that Co1? 3axi3"3 a,/ 3i,i3"3 sa!ar4 0or ea h Co1.

Select 6ob7co ntCem0noD7ma>CsalD7minCsalD ?rom em0 gro 0 by 6ob 9.Select de0artment n mber7 name where atleast ' em0loyees wor&s. Se!e t /e2t,o?/,a3e 0ro3 /e2t Where /e2t,o i,Ise!e t /e2t,o 0ro3 e32 ha#i,5 o",tIe32,oG VW8 >ro"2 14 /e2t,oG L ;. Select de0artment name7 location where the a*erage salary in each de0artment more than 14<<. se!e t /,a3e?!o 0ro3 /e2t where /e2t./e2t,o i, Ise!e t /e2t,o 0ro3 e32 ha#i,5 a#5Isa!GV1<.. 5ro"2 14 /e2t,oG 1.. Se!e t /e2art3e,t ,a3e? Co1 a,/ s"3 o0 sa!ar4 14 ea h Co1 with i, the /e2art3e,t. Se!e t /,a3e?Co1?s"3Isa!G 0ro3 e32?/e2t Where e32./e2t,oW/e2t./e2t,o >ro"2 14 /,a3e?Co1 Exer ise I Use SQL 9", tio,s G 1. Dis0lay the following te>t in lowercase cDISH)AI -EAMH)- I% ):W-R2AS-F SELECT LOWERIADIS(LA* EFA)(LE IN LOWERCASEAG 9RO) DUALY 2. Dis2!a4 the 0o!!owi,5 text i, "22er ase Z4o" are 5reatH. SELECT U((ERIA4o" are 5reatAG 9RO) DUALY '. Write a select statement to add 1$' and 894. SELECT SU)I128N='<G 9RO) DUALY 1. What is the length of c2.RR-%!@ string. SELECT LEN>T7IACURRENTAG 9RO) DUALY 3. Dis0lay the c rrent sername. SELECT USER 9RO) DUALY 4. Dis0lay cD:2!:R@ from cV:"% IS A D:2!:R@ string. SELECT SUBSTRIAQO7N IS A DOCTORA?11?<G 9RO) DUALY 8. Dis0lay Day of FV ly/1</1;;9F SELECT TO;C7ARITO;DATEIAQ"!4-1.-1++'A?A)o,th-//-rrrrAG?ADA*AG 9RO) DUAL 9. Dis0lay n mber of days till today from yo r date of birth. se!e t s4s/ate-TO;DATEIA.:-SE(-1+==A?ADD-)ON-****AG 9RO) DUAL ;. Dis0lay the date after 19 months from today. SELECT ADD;)ONT7SIS*SDATE?1'G 9RO) DUALY

1<.Dis0lay em0loyee information if em0loyee id is an e*en n mber se!e t B 0ro3 e32 where 3o/Ie32,o?2GW.Y Exer ise I Date 0", tio,s 0ro3 D"a! Ta1!eG 1.Dis0lay 2 rrent date SELECT S*SDATE 9RO) DUAL $.Dis0lay 2 rrent !ime. SELECT TO;C7ARIS*SDATE?A77P)IPSSAG 9RO) DUALY '.Dis0lay c rrent ser name. SELECT USER 9RO) DUALY 1.Dis0lay 2 rrent date in V ly ' 1;;8 format SELECT TO;C7ARIS*SDATE?A)o,th // RRRRAG 9RO) DUALY 3.Dis0lay 2 rrent date and the date after 89 days. SELECT S*SDATE?S*SDATEN=' 9RO) DUALY 4.Dis0lay 2 rrent date7 day7 8< days after c rrent date and its day also. SELECT S*SDATE?TO;C7ARIS*SDATE?ADA*AG?S*SDATEN=.?TO;C7ARIS*SDATEN=.?ADA*AG 9RO) DUALY 8.Dis0lay the months between cVA%/1</43@ and cV.%/$'/;9@ ta&e the in0 t in s0ecified format. se!e t I3o,ths;1etwee,Ito;/ateIAQAN-1.-<&A?A)ON-DD-RRA G?to;/ateIAQUN-28-+'A?A)ON-DD-RRAG GG 0ro3 /"a! L 9.Dis0lay the c rrent date as !oday@s date is : c rrent date from system. SELECT ATo/a4AAs /ate is P ASSs4s/ate 0ro3 /"a!Y ;.Dis0lay 2 rrent date7 time and ser name. se!e t s4s/ate?to; harIs4s/ate?AhhP3iPssAG?"ser 0ro3 /"a!Y 1<.Dis0lay the day li&e S nday or what for this date cV ly 1 1;;9@ se!e t to; harIto;/ateIAQ"!4 : 1++'A ?A03)o,th03// 4444AG?ADa4AG 0ro3 /"a!

ROWNU)BERIN> WIT7 AN ORDER B* CLAUSE :ne of the most often ses of the 0se do col mn row,"3 is to 0ro*ide serial n mbers to the records in a = ery. !his feat re is widely sed in re0orts to re0resent systematic dis0lay of information. ?or instance )isting A Select rown m7 ename7 em0no from em01<K !able A R:W%.M -%AM-MH%: ///////// ////////// ///////// 1 JI%+ 89'; $ B)AJ84;9 ' 2)ARJ 889$ 1 V:%-S 8344 3 MAR!I% 8431 "owe*er7 when we order this statement the rown m gets dist rbed as shown below C )isting B and !able BD. )isting B select rown m7 ename7 em0no from em01< order by enameK

!able B R:W%.M -%AM///////// ////////// ///////// $ B)AJ' 2)ARJ 1 V:%-S 1 JI%+ 3 MAR!I%

-MH%: 84;9 889$ 8344 89'; 8431

As we can see from abo*e the em0loyee names did get ordered b t the rown m also got the wrong order. !he desired res lt was B)AJ- ha*ing rown m 1 7 2)ARJ ha*ing a rown m of $ and so on. !o achie*e this we ha*e to o ter 6oin this table with d al that 0rocess forces a im0licit order on the rown m as shown below C )isting 27 !able 2D. )isting 2 select rown m7 ename7 em0no from em01< a 7 d al d where a.ename # d.d mmy CRD order by enameK !able 2 R:W%.M -%AM/////// ////////// 1 B)AJ$ 2)ARJ ' V:%-S 1 JI%+ 3 MAR!I% -MH%: ///////// 84;9 889$ 8344 89'; 8431

The tri $ is to /o a, o"ter Coi, with the o!"3, that 4o" wa,t to or/er a,/ this 2ro ess /oes ,ot /ist"r1 the row,"3 or/er. I, a//itio, to that i0 the o!"3, is o0 ,"31er /atat42e the, o,e sho"!/ 3a$e s"re to "se TO;C7AR /atat42e o,#ersio, 0", tio,. "#at are t#e -i**erence ,et.een DDL/ DML an- D)L c$mman-%0 DDL is Data De0i,itio, La,5"a5e state3e,ts. So3e exa32!esP

2R-A!- / to create ob6ects in the database A)!-R / alters the str ct re of the database DR:H / delete ob6ects from the database !R.%2A!- / remo*e all records from a table7 incl ding all s0aces allocated for the records are remo*ed 2:MM-%! / add comments to the data dictionary +RA%! / gi*es serFs access 0ri*ileges to database R-B:J- / withdraw access 0ri*ileges gi*en with the +RA%! command

D)L is Data )a,i2"!atio, La,5"a5e state3e,ts. So3e exa32!esP

S-)-2! / retrie*e data from the a database I%S-R! / insert data into a table .HDA!- / 0dates e>isting data within a table D-)-!- / deletes all records from a table7 the s0ace for the records remain 2A)) / call a H)LS() or Va*a s b0rogram -EH)AI% H)A% / e>0lain access 0ath to data ):2J !AB)- / control conc rrency

DCL is Data Co,tro! La,5"a5e state3e,ts. So3e exa32!esP

2:MMI! / sa*e wor& done SAB-H:I%! / identify a 0oint in a transaction to which yo can later roll bac& R:))BA2J / restore database to original since the last 2:MMI! S-! !RA%SA2!I:% / 2hange transaction o0tions li&e what rollbac& segment to se 1$. -$e% $ne e%cape %pecial c#aracter% .#en ,'il-ing SQL 2'erie%0

!he )IJ- &eyword allows for string searches. !he F5F wild card character is sed to match e>actly one character7 FNF is sed to match Mero or more occ rrences of any characters. !hese characters can be esca0ed in S(). ->am0le: S-)-2! name ?R:M em0 W"-R- id )IJ- FNO5NF -S2AH- FOFK .se two = otes for e*ery one dis0layed. ->am0le: S-)-2! F?ran&sFFs :racle siteF ?R:M D.A)K S-)-2! FA FF= otedFF word.F ?R:M D.A)K S-)-2! FA FFFFdo ble = otedFFFF word.F ?R:M D.A)K 1$. -$e% $ne eliminate -'plicate% r$.% *r$m a ta,le0 2hoose one of the following = eries to identify or remo*e d 0licate rows from a table lea*ing only ni= e records in the table: )etho/ 1P S()T D-)-!- ?R:M table5name A W"-R- R:WID T C $ S-)-2! minCrowidD ?R:M table5name B ' W"-R- A.&ey5*al es # B.&ey5*al esDK )etho/ 2P S()T create table table5name$ as select distinct G from table5name1K S()T dro0 table5name1K S()T rename table5name$ to table5name1K S()T // Remember to recreate all inde>es7 constraints7 triggers7 etc on table... )etho/ 8P Itha,$s to De,,is >"r,i $G S()T delete from my5table t1 S()T where e>ists Cselect F>F from my5table t$ S()T where t$.&ey5*al e1 # t1.&ey5*al e1 S()T and t$.&ey5*al e$ # t1.&ey5*al e$ S()T and t$.rowid T t1.rowidDK %ote: :ne can eliminate %e$ nnecessary o0erations by creating an inde> on the 6oined fields in the inner loo0 Cno need to loo0 thro gh the entire table on each 0ass by a recordD. !hese will s0eed/ 0 the deletion 0rocess. %ote $: If yo are com0aring %:!/%.)) col mns7 se the %B) f nction. Remember that %.)) is not e= al to %.)). !his sho ld not be a 0roblem as all &ey col mns sho ld be %:! %.)) by definition. 1$. -$e% $ne generate primary key 3al'e% *$r a ta,le0 2reate yo r table with a %:! %.)) col mn Csay S-(%:D. !his col mn can now be 0o0 lated with ni= e *al es: S()T .HDA!- table5name S-! se=no # R:W%.MK or se a se= ences generator: S()T 2R-A!- S-(.-%2- se= ence5name S!AR! WI!" 1 I%2R-M-%! BI 1K S()T .HDA!- table5name S-! se=no # se= ence5name.%-E!BA)K ?inally7 create a ni= e inde> on this col mn. 1$. -$e% $ne get t#e time -i**erence ,et.een t.$ -ate c$l'mn%0 )oo& at this e>am0le = ery: select floorCCCdate1/date$DG$1G4<G4<DL'4<<D \\ F ":.RS F \\ floorCCCCdate1/date$DG$1G4<G4<D / floorCCCdate1/date$DG$1G4<G4<DL'4<<DG'4<<DL4<D \\ F MI%.!-S F \\ ro ndCCCCdate1/date$DG$1G4<G4<D / floorCCCdate1/date$DG$1G4<G4<DL'4<<DG'4<< / CfloorCCCCdate1/date$DG$1G4<G4<D /

floorCCCdate1/date$DG$1G4<G4<DL'4<<DG'4<<DL4<DG4<DDD \\ F S-2S F time5difference from ... If yo donFt want to go thro gh the floor and ceiling math7 try this method Ccontrib ted by -ri& WileD: select to5charCto5dateCF<<:<<:<<F7F""$1:MI:SSFD R Cdate1 / date$D7 F""$1:MI:SSFD time5difference from ... %ote that this = ery only ses the time 0ortion of the date and ignores the date itself. It will th s ne*er ret rn a *al e bigger than $':3;:3;. 1$. -$e% $ne a-- a -ay&#$'r&min'te&%ec$n- t$ a -ate 3al'e0 !he SISDA!- 0se do/col mn shows the c rrent system date and time. Adding 1 to SISDA!- will ad*ance the date by 1 day. .se fractions to add ho rs7 min tes or seconds to the date. )oo& at these e>am0les: S()T select sysdate7 sysdateR1L$17 sysdate R1L111<7 sysdate R 1L941<< from d alK SISDA!SISDA!-R1L$1 SISDA!-R1L111< SISDA!-R1L941<< //////////////////// //////////////////// //////////////////// //////////////////// <'/V l/$<<$ <9:'$:1$ <'/V l/$<<$ <;:'$:1$ <'/V l/$<<$ <9:'':1$ <'/V l/$<<$ <9:'$:1' !he following format is fre= ently sed with :racle Re0lication: select sysdate %:W7 sysdateR'<LC$1G4<G4<D %:W5H).S5'<5S-2S from d alK %:W %:W5H).S5'<5S-2S //////////////////// //////////////////// <'/V.)/$<<$ 14:18:$' <'/V.)/$<<$ 14:18:3' 1$. -$e% $ne c$'nt -i**erent -ata 3al'e% in a c$l'mn0 .se this sim0le = ery to co nt the n mber of data *al es in a col mn: select my5table5col mn7 co ntCGD from my5table gro 0 by my5table5col mnK A more so0histicated e>am0le... select de0t7 s mC decodeCse>7FMF717<DD MA)-7 s mC decodeCse>7F?F717<DD ?-MA)-7 co ntCdecodeCse>7FMF717F?F71DD !:!A) from my5em05table gro 0 by de0tK 1$. -$e% $ne c$'nt&%'m AN!ES $* -ata 3al'e% in a c$l'mn0 A *al e > will be between *al es y and M if +R-A!-S!C>7 yD # )-AS!C>7 MD. )oo& at this e>am0le: select f$7 s mCdecodeCgreatestCf173;D7 leastCf171<<D7 17 <DD ,Range 4</1<<,7 s mCdecodeCgreatestCf17'<D7 leastCf17 3;D7 17 <DD ,Range '</3;,7 s mCdecodeCgreatestCf17 <D7 leastCf17 $;D7 17 <DD ,Range <</$;, from my5table gro 0 by f$K ?or e= al siMe ranges it might be easier to calc late it with D-2:D-C!R.%2C*al eLrangeD7 <7 rate5<7 17 rate517 ...D. -g. select ename ,%ame,7 sal ,Salary,7 decodeC tr ncCf$L1<<<7 <D7 <7 <.<7 17 <.17 $7 <.$7 '7 <.'1D ,!a> rate, from my5tableK )an $ne retrie3e $nly t#e Nt# r$. *r$m a ta,le0 0ro*ided this sol tion to select the %th row from a table: S-)-2! G ?R:M C S-)-2! -%AM-7R:W%.M R% ?R:M -MH W"-R- R:W%.M S 1<1 D W"-R- R% # 1<<K %ote: %ote: In this first it select only one more than the re= ired row7 then it selects the re= ired one. Its far better than sing MI%.S o0eration.

0ro*ided this sol tion: S-)-2! f1 ?R:M t1 W"-R- rowid # C S-)-2! rowid ?R:M t1 W"-R- rown m S# 1< MI%.S S-)-2! rowid ?R:M t1 W"-R- rown m S 1<DK Alternati*ely... S-)-2! G ?R:M em0 W"-R- rown m#1 A%D rowid %:! I% CS-)-2! rowid ?R:M em0 W"-R- rown m S 1<DK Hlease note7 there is no e>0licit row order in a relational database. "owe*er7 this = ery is = ite f n and may e*en hel0 in the odd sit ation. )an $ne retrie3e $nly r$.% + t$ 4 *r$m a ta,le0 0ro*ided this sol tion to the 0roblem: S-)-2! G ?R:M C S-)-2! -%AM-7R:W%.M R% ?R:M -MH W"-R- R:W%.M S 1<1 D W"-R- R% between ;1 and 1<< K %ote: the 1<1 is 6 st one greater than the ma>im m row of the re= ired rows Cmeans ># ;<7 y#1<<7 so the inner *al es is yR1D. Another sol tion is to se the MI%.S o0eration. ?or e>am0le7 to dis0lay rows 3 to 87 constr ct a = ery li&e this: S-)-2! G ?R:M tableE W"-R- rowid in C S-)-2! rowid ?R:M tableE W"-R- rown m S# 8 MI%.S S-)-2! rowid ?R:M tableE W"-R- rown m S 3DK Hlease note7 there is no e>0licit row order in a relational database. "owe*er7 this = ery is = ite f n and may e*en hel0 in the odd sit ation. 1$. -$e% $ne %elect E5E 4 Nt# r$. *r$m a ta,le0 :ne can easily select all e*en7 odd7 or %th rows from a table sing S() = eries li&e this: )etho/ 1P .sing a s b= ery S-)-2! G ?R:M em0 W"-R- CR:WID7<D I% CS-)-2! R:WID7 M:DCR:W%.M71D ?R:M em0DK )etho/ 2P .se dynamic *iews Ca*ailable from :racle8.$D: S-)-2! G ?R:M C S-)-2! rown m rn7 em0no7 ename ?R:M em0 D tem0 W"-R- M:DCtem0.R:W%.M71D # <K Hlease note7 there is no e>0licit row order in a relational database. "owe*er7 these = eries are = ite f n and may e*en hel0 in the odd sit ation. 1$. -$e% $ne %elect t#e TOP N r$.% *r$m a ta,le0 ?orm :racle9i one can ha*e an inner/= ery with an :RD-R BI cla se. )oo& at this e>am0le: S-)-2! G ?R:M CS-)-2! G ?R:M my5table :RD-R BI col5name51 D-S2D W"-R- R:W%.M S 1<K .se this wor&aro nd with 0rior releases: S-)-2! G ?R:M my5table a W"-R- 1< T# CS-)-2! 2:.%!CDIS!I%2! ma>colD ?R:M my5table b W"-R- b.ma>col T# a.ma>colD :RD-R BI ma>col D-S2K

1$. -$e% $ne c$-e a tree6%tr'ct're- 2'ery0 !ree/str ct red = eries are definitely non/relational Ceno gh to &ill 2odd and ma&e him roll in his gra*eD. Also7 this feat re is not often fo nd in other database offerings. !he S2:!!L!I+-R database schema contains a table -MH with a self/referencing relation C-MH%: and M+R col mnsD. !his table is 0erfect for tesing and demonstrating tree/str ct red = eries as the M+R col mn contains the em0loyee n mber of the ,c rrent, em0loyeeFs boss. !he )-B-) 0se do/col mn is an indication of how dee0 in the tree one is. :racle can handle = eries with a de0th of 0 to $33 le*els. )oo& at this e>am0le: select )-B-)7 -MH%:7 -%AM-7 M+R from -MH connect by 0rior -MH%: # M+R start with M+R is %.))K :ne can 0rod ce an indented re0ort by sing the le*el n mber to s bstring or l0adCD a series of s0aces7 and concatenate that to the string. )oo& at this e>am0le: select l0adCF F7 )-B-) G $D \\ -%AM- ........ :ne ses the ,start with, cla se to s0ecify the start of the tree. More than one record can match the starting condition. :ne disad*antage of ha*ing a ,connect by 0rior, cla se is that yo cannot 0erform a 6oin to other tables. !he ,connect by 0rior, cla se is rarely im0lemented in the other database offerings. !rying to do this 0rogrammatically is diffic lt as one has to do the to0 le*el = ery first7 then7 for each of the records o0en a c rsor to loo& for child nodes. :ne way of wor&ing aro nd this is to se H)LS()7 o0en the dri*ing c rsor with the ,connect by 0rior, statement7 and the select matching records from other tables on a row/by/row basis7 inserting the res lts into a tem0orary table for later retrie*al. 1$. -$e% $ne c$-e a matrix rep$rt in SQL0 )oo& at this e>am0le = ery with sam0le o t0 t: S-)-2! G ?R:M CS-)-2! 6ob7 s mCdecodeCde0tno71<7salDD D-H!1<7 s mCdecodeCde0tno7$<7salDD D-H!$<7 s mCdecodeCde0tno7'<7salDD D-H!'<7 s mCdecodeCde0tno71<7salDD D-H!1< ?R:M scott.em0 +R:.H BI 6obD :RD-R BI 1K V:B D-H!1< D-H!$< D-H!'< ///////// ////////// ////////// ////////// ////////// A%A)IS! 4<<< 2)-RJ 1'<< 1;<< ;3< MA%A+-R $13< $;83 $93< HR-SID-%! 3<<< SA)-SMA% 34<< D-H!1<

1$. -$e% $ne implement I76T1EN6ELSE in a %elect %tatement0 !he :racle /e o/e f nction acts li&e a 0roced ral statement inside an S() statement to ret rn different *al es or col mns based on the *al es of other col mns in the select statement. So3e exa32!esP select decodeCse>7 FMF7 FMaleF7 F?F7 F?emaleF7 F.n&nownFD from em0loyeesK select a7 b7 decodeC absCa/bD7 a/b7 Fa T bF7 <7 Fa # bF7 Fa S bFD from tableEK select decodeC +R-A!-S!CA7BD7 A7 FA is greater :R -(.A) than BF7 FB is greater than AFD... select decodeC +R-A!-S!CA7BD7 A7 decodeCA7 B7 FA %:! +R-A!-R !"A% BF7 FA +R-A!-R !"A% BFD7 FA %:! +R-A!-R !"A% BFD...

NoteP !he decode f nction is not A%SI S() and is rarely im0lemented in other RDBMS offerings. It is one of the good things abo t :racle7 b t se it s0aringly if 0ortability is re= ired. ?rom :racle 9i one can also se 2AS- statements in S(). )oo& at this e>am0le: S-)-2! ename7 2AS- W"-% salT1<<< !"-% F:*er 0aidF -)S- F.nder 0aidF -%D ?R:M em0K 1$. can $ne -'mp& examine t#e exact c$ntent $* a -ata,a%e c$l'mn0 S-)-2! D.MHCcol1D ?R:M tab1 W"-R- cond1 # *al1K D.MHC2:)1D !y0#;4 )en#1: 437447487'$ )an $ne -r$p a c$l'mn *r$m a ta,le0 ?rom :racle9i one can DR:H a col mn from a table. )oo& at this sam0le scri0t7 demonstrating the ALTER TABLE table_name DROP COLUMN column_name; command. :ther wor&aro nds: 1. S()T 0date t1 set col mn5to5dro0 # %.))K S()T rename t1 to t15baseK S()T create *iew t1 as select Ss0ecific col mnsT from t15baseK $. S()T create table t$ as select Ss0ecific col mnsT from t1K S()T dro0 table t1K S()T rename t$ to t1K )an $ne rename a c$l'mn in a ta,le0 %o7 this is listed as -nhancement Re= est 14'31;. Some wor&aro nds: 1. // .se a *iew with correct col mn names... rename t1 to t15baseK create *iew t1 Scol mn list with new nameT as select G from t15baseK $. // Recreate the table with correct col mn names... create table t$ Scol mn list with new nameT as select G from t1K dro0 table t1K rename t$ to t1K '. // Add a col mn with a new name and dro0 an old col mn... alter table t1 add C newcolame dataty0e DK 0date t1 set newcolname#oldcolnameK alter table t1 dro0 col mn oldcolnameK 1$. can I c#ange my Oracle pa%%.$r-0 Iss e the following S() command: A)!-R .S-R S sernameT ID-%!I?I-D BI Snew50asswordT ?rom :racle9 yo can 6 st ty0e ,0assword, from S()GHl s7 or if yo need to change another serFs 0assword7 ty0e ,0assword ser5name,. 1$. -$e% $ne *in- t#e next 3al'e $* a %e2'ence0 Herform an ,A)!-R S-(.-%2- ... %:2A2"-, to nload the n sed cached se= ence n mbers from the :racle library cache. !his way7 no cached n mbers will be lost. If yo then select from the .S-R5S-(.-%2-S dictionary *iew7 yo will see the correct high water mar& *al e that wo ld be ret rned for the ne>t %-E!BA)) call. Afterwards7 0erform an ,A)!-R S-(.-%2- ... 2A2"-, to restore caching. Io can se the abo*e techni= e to 0re*ent se= ence n mber loss before a SHUTDOWN ABORT7 or any other o0eration that wo ld ca se ga0s in se= ence *al es. "$rkar$'n- *$r %nap%#$t% $n ta,le% .it# LON! c$l'mn% Io can se the S()GHl s 2:HI command instead of sna0shots if yo need to co0y ):%+ and ):%+ RAW *ariables from one location to another. -g: 2:HI !: S2:!!L!I+-R[R-M:!- / 2R-A!- IMA+-5!AB)- .SI%+ / S-)-2! IMA+-5%:7 IMA+- / ?R:M IMA+-SK

%ote: If yo r n :racle97 con*ert yo r ):%+s to ):Bs7 as it can be re0licated.