You are on page 1of 12

Oracle Architecture Configuration of Oracle database File Structure segement Q. Describe Oracle architecture in brief? A.

the Oracle database has: -Logical layer: The components of the logical layer map the data to these physical components -Physical layer: The physical layer consists of the files that reside on the disk Tablespaces and Data files Physical : Data files, Redo Log files, ontrol file. Logical : Tables, !ie"s, Tablespaces, etc. The database is di#ided into one or more logical pieces kno"n as tablespaces. A table space is $sed to logically gro$p data together. The Database %chema: A collection of logical-str$ct$re ob&ects, kno"n as schema ob&ects. These schema ob&ects consist of str$ct$res s$ch as: -Tables, -cl$sters, -inde'es, -#ie"s, -stored proced$res, -database triggers, and -se($ences. %egments, )'tents, and Data *locks "ithin Oracle, the space $sed to store data are controlled by the $se of logical str$ct$res. These str$ct$res consist of the follo"ing: +Data blocks--A block is the smallest $nit of storage in an Oracle database. , ontains header information concerning the block itself as "ell as the data+)'tents--)'tents consist of data blocks. +%egments--A segment is a set of e'tents $sed to store a partic$lar type of data. The Oracle .nstance has: +/ser processes +Oracle backgro$nd processes +The shared memory The Oracle 0emory %tr$ct$re contains: +The %ystem 1lobal Area ,%1A+The Data-Dictionary ache

+The Program 1lobal Area ,P1AQ.What are the basic element of base configuration of an Oracle database? .t consists of one or more data files.one or more control files. t"o or more redo log files. The Database contains m$ltiple $sers2schemas one or more rollback segments one or more tablespaces Data dictionary tables /ser ob&ects ,table,inde'es,#ie"s etc.,The ser#er that access the database consists of %1A ,Database b$ffer, Dictionary ache *$ffers, Redo log b$ffers, %hared %3L pool%0O4 ,%ystem 0O4itorP0O4 ,Process 0O4itorL15R ,Lo1 5riteD*5R ,Data *ase 5riteAR 6 ,AR 6i#er7PT , heck PointR) O Dispatcher /ser Process "ith associated P1% Q.What does a control file contains ? .nformation abo$t the database, redologfile and datafile ,archi#elog file location and c$rrent scn no and redo log file. 8.Database name and identifier. 9.Time stamp of database creation. :.Tablespace names. ;.*ack$p information. <. heckpoint information. =. $rrent online redo log file se($ence n$mber. Q. What are the different types of segments? temp segment, data segment, table segment, inde' segment There>re different types of segments depend on "hat types of TA*L)%: 8-Table segments 9-.nde' segments :-Partition segments ? s$bpartition segments ;-.nde' partition segments <-LO* segments

=- l$ster segments @-Rollback or Type9 /4DO segments A-4ested table segments Q.What is a segment ? %egment is the collection of e'tents allocated to partic$lar ob&ect like table and inde'. Table segment and inde' segment. Q.What Is an Oracle Data File? An Oracle data file is a big $nit of physical storage in the O% file system. One or many Oracle data files are organiBed together to pro#ide physical storage to a single Oracle tablespace. Q.What is a redo log ? Redo log contains the before and after image copies of changed data. Q.What are the components of logical database structure of Oracle database? Tablespace, segments, e'tents, data *locks. A logical $nit of storage of database is called Tablespace. %egments is a space allocated for a specific logical storage str$ct$re "ithin a tablespce. )'tents: %pace allocated to a segments. Datablocks: Oracle ser#er manage the storage space in the datafiles in $nits is called data blocks or oracle blocks. Q.What is data bloc ? Oracle database>s data is stored in data blocks. One data block corresponds to a specific n$mber of bytes of physical database space on disk. Q. !o" to define data bloc si#e? A data block siBe is specified for each Oracle database "hen the database is created. A database $sers and allocated free database space in Oracle data blocks. *lock siBe is specified in init.ora file and cannot be changed latter. Q.What is an e$tent? An e'tent is a specific n$mber of contig$o$s data blocks, obtained in a single allocation and $sed to store a specific type of information. An )'tent is a collection of contagio$s blocks the second le#el of gran$ality of the storage in database is called e'tent. it is defined as the collection of contagio$s datablocks.

Q.What are the different types of segments? Data segment, inde' segment, rollback segment and temporary segment. Q.What is a data segment? )ach non-cl$stered table has a data segment. All of the table>s data is stored in the e'tents of its data segment. )ach cl$ster has a data segment. The data of e#ery table in the cl$ster is stored in the cl$ster>s data segment. Q.What is rollbac segment? A database contains one or more rollback segments to temporarily store C$ndoC information. Q.What are the uses of rollbac segment? To generate read-consistent database information d$ring database reco#ery and to rollback $ncommitted transactions by the $sers. Q.What is an inde$ segment? )ach inde' has an inde' segment that stores all of its data. Q."hat are temporary segments? A.Temporary %egments: The %)L) T statements need a temporary storage. 5hen ($eries are fired, oracle needs area to do sorting and other operation d$e to "hich temporary storages are $sef$l.The commands that may $se temporary storage "hen $sed "ith %)L) T are:1RO/P *D, /4.O4, D.%T.4 T, etc. Q.What is the difference bet"een a %&'(O)A)* tablespace and a (&)'A+&+% tablespace? A temporary tablespace is $sed for temporary ob&ects s$ch as sort str$ct$res "hile permanent tablespaces are $sed to store those ob&ects meant to be $sed as the tr$e ob&ects of the database. Eiles Q.What is a datafile? )#ery Oracle database has one or more physical data files. A database>s data files contain all the database data. The data of logical database str$ct$res s$ch as tables and inde'es is physically stored in the data files allocated for a database. Q.What are the characteristics of data files? A data file can be associated "ith only one database. Once created a data file can>t change siBe. One or more data files form a logical $nit of database storage called a tablespace.

Q.!o" to define Data ,loc si#e ? A data block siBe is specified for each ORA L) database "hen the database is created. A database $sers and allocated free database space in ORA L) data blocks. *lock siBe is specified in .4.T.ORA file and canFt be changed latter. Q.What is a redo log? The set of redo log files for a database is collecti#ely kno"n as the database redo log.
Q.What

is the function of redo log?

The primary f$nction of the redo log is to record all changes made to data. Q.What is the use of redo log information ? A redo log file is one of the file of database, along "ith control file and data file.here the datafile is "ork for storing the act$al data control file is $sed for taking all other information abo$t the act$al data redolog file is for storing the act$al data>s copy for reco#ery p$rpose. information are $sed to reco#er database if it get corr$pt. Q.What is the use of redo log information? The information in a redo log file is $sed only to reco#er the database from a system or media fail$re pre#ents database data from being "ritten to a database>s data files. Q.Describe "hat redo logs are? Redo logs are logical and physical str$ct$res that are designed to hold all the changes made to a database and are intended to aid in the reco#ery of a database.
Q.What does a control file contains?

- Database name - 4ames and locations of a database>s files and redolog files. - Time stamp of database creation.
Q.What is the use of control file?

5hen an instance of an Oracle database is started, its control file is $sed to identify the database and redo log files that m$st be opened for database operation to proceed. .t is also $sed in database reco#ery.
Q.What is a Database instance ? Explain

A database instance ,%er#er- is a set of memory str$ct$re and backgro$nd processes that access a set of database files. The process can be shared by all $sers. The memory str$ct$re that are $sed to store most ($eried data from database. This helps $p to impro#e database performance by

decreasing the amo$nt of .2O performed against data file. Q.What is (rogram -lobal Area .(-A/ in Oracle? A Program 1lobal Area ,P1A- is a memory b$ffer that is allocated for each indi#id$al database session and it contains session specific information s$ch as %3L statement data or b$ffers $sed for sorting. The #al$e specifies the total memory allocated by all sessions, and changes "ill take effect as ne" sessions are started. Q. What is the function of S'O+? A.The %0O4 backgro$nd process performs all system monitoring f$nctions on the oracle database. )ach time oracle is re-started, %0O4 performs a "arm start and makes s$re that the transactions that "ere left incomplete at the last sh$t do"n are reco#ered. %0O4 performs periodic clean$p of temporary segments that are no longer needed. Q.&$plain S-A memory structures0 Shared (ool1 Database buffer Cache1 )edo log Cache1 2arge (ool Ga#a Pool. A.%1A ,%ystem 1lobal Area- is a dynamic memory area of an Oracle %er#er. .n %1A,the allocation is done in gran$les. The siBe of the %1A is dependent on %1AH0AIH%.J) parameter. The memory str$ct$res contained by %1A are:8.%hared Pool - This memory str$ct$re is di#ided into t"o s$b-str$ct$res "hich are Library ache and Data Dictionary ache for storing recently $sed PL2%3L statements and the recent data definitions. The ma'im$m siBe of the %hared Pool depends on the %6AR)DHPOOLH%.J) parameter. % 9.Database *$ffer ache K This memory str$ct$re impro#es the performance "hile fetching or $pdating the recently $sed data as it stores the recently $sed datafiles. The siBe of this block is decided by D*H*LO 7H%.J). :.Redo Log *$ffer K This memory str$ct$re is $sed to store all the changes made to the database and it>s primarily $sed for the data reco#ery p$rposes. The siBe of this block is decided by LO1H*/EE)R. ;.Ga#a Pool K This memory str$ct$re is $sed "hen Ga#a is installed on the Oracle ser#er. %iBe that can be $sed is stored in parameter named GA!AHPOOLH%.J). <.Large Pool K This memory str$ct$re is $sed to red$ce the b$rden of the %hared Pool, as the %ession memory for the %hared %er#er, as the temporary storage for the .2O and for the back$p and restore operations or R0A4. Parameter that stores the ma'im$m siBe is LAR1)HPOOLH%.J). Q.What is a tablespace? A database is di#ided into Logical %torage /nit called tablespaces. A tablespace is $sed to gro$ped related logical str$ct$res together.

Q.What is S*S%&' tablespace? A.%D%T)0 tablespace is a$tomatically created "hen the database is created. .t contains data dictionary for the entire database. Q.What is the use of Data Dictionary in oracle? A. Data Dictionary is $sed to store information abo$t #ario$s physical and logical Oracle str$ct$res. e.g.Tables, Tablespaces, datafiles, etc. Q.What are elements of database logical layers? A. The logical layer of the database consists of the follo"ing elements: One or more tablespaces. The database schema that comprises of items s$ch as tables, cl$sters, inde'es, #ie"s, stored proced$res, database triggers, and se($ences. 3.What is Data3Dictionary Cache? A.Data-Dictionary ache keeps information abo$t the logical and physical str$ct$re of the database. The data dictionary contains information s$ch as the follo"ing: 8./ser information, s$ch as $ser pri#ileges 9..ntegrity constraints defined for tables :.4ames and data types of all col$mns in database tables ;..nformation on space allocated and $sed for schema ob&ects Q.What are bac ground processes in oracle? A.Oracle $ses backgro$nd process to increase performance. Database "riter, D*5n Log 5riter, L15R heckpoint, 7PT %ystem 0onitor, %0O4 Process 0onitor, P0O4 Archi#er, AR n Q.What is t prof and ho" is it used? +Tkprof is a performance diagnosing $tility a#ailable to D*As. .t formats a trace file into a more readable format for performance analysis. %o that the D*A can identify and resol#e performance iss$es like poor %3L, inde'ing, and "ait e#ents. +5hen a $ser comes across problems related to the response time in comparison to his pre#io$s "eeks response time, %ession tracing and tkprof can be $sed to see e'actly "hat is happening on the database, enabling the D*A to take correcti#e action. +At times, #ie"ing %3L that is being e'ec$ted for an application "ill be the only mechanism a D*A "ill ha#e. These sit$ations arri#e d$ring the e'ec$tion of encrypted PL2%3L code on the database or s$bmission of %3L statements from third party applications.

Q.What is t prof and ho" is it used ? The tkprof tool is a t$ning tool $sed to determine cp$ and e'ec$tion times for %3L statements. Do$ $se it by first setting timedHstatistics to tr$e in the initialiBation file and then t$rning on tracing for either the entire database #ia the s(lHtrace parameter or for the session $sing the ALT)R %)%%.O4 command. Once the trace file is generated yo$ r$n the tkprof tool against the trace file and then look at the o$tp$t from the tkprof tool. This can also be $sed to generate e'plain plan o$tp$t. Q.What is a %ablespace? A.Tablespaces is a logical storage $nit. .t is $sed to gro$p related logical str$ct$res together. Q.What are elements of database logical layers? A.The logical layer of the database consists of the follo"ing elements: One or more tablespaces. The database schema that comprises of items s$ch as tables, cl$sters, inde'es, #ie"s, stored proced$res, database triggers, and se($ences. Q. Describe (rogram -lobal Area .(-A/? A. P1A is a memory area that contains data and control information for the Oracle ser#er processes. This area consists of the follo"ing components: %tack space--This holds the session>s #ariables and arrays. %ession information--.f yo$ are not r$nning the m$ltithreaded ser#er, the session information is stored in the P1A. .f yo$ are r$nning the m$ltithreaded ser#er, the session Pri#ate %3L area--This area keeps information abo$t binding #ariables and r$ntime b$ffers. Q. What is user process? A. A /ser process is created and maintained to e'ec$te the soft"are code of an application program .it has been created a$tomatically bet"een $ser and process. Q. What is Ser4er (rocess? A. %er#er process handle re($est from connected $ser process.A ser#er process is in charge of comm$nicating "ith the $ser process and interacting "ith oracle carry o$t re($est of the associated $ser process. Q. What are the t"o type of ser4er configuration? Dedication ser#er config$ration : .tFs a ser#er process handles re($est for a single process. m$tli threaded ser#er config$ration. 0any $ser process share the gro$p of ser#er process. Q. What is S-A? A. %ystem global area is shared memory area region allocated by oracle that contains data and control information for one oracle instance.

Q. What are the components of S-A? A. Database b$ffer , redo log b$ffer, the shared pool and c$rsor. Q. What do the database buffers contain? A. Database b$ffers store the most recently $sed blocks of database data. .t can also contain the modified data that has not yet been permanently "ritten to disk. Q. What do redo log buffers contain ? A. Redo log b$ffers stores redo log entries a log of changes made to the database. Q.What is shared pool? A. shared pool is a portion of the %1A that contain shared memory constr$ct s$ch as shared %3L Areas. %hared %3L areas is re($ired to process e#ery $ni($e %3L statements s$bmitted to a database and contain information s$ch as the parse tree and e'ec$tion plan for the corresponding statement. Q.Describe shared pool performance? A. %hared pool one of the memories %tr$ct$re in %1A. .t is comprised of the data dictionary and library cache. Data dictionary cache b$ffers data dictionary ob&ects that contain data abo$t table, inde'es, $sers, and all other ob&ects. The library ache 2%3L cache b$ffers pre#io$sly e'ec$ted ($eries, so that they need not be reloaded and reparsed if $sers call them again. Other"ise information is not in b$ffer than oracle m$st get from disk. Q. What are the name of oracle bac ground process? A. D*5R KData base "riter *. L15R- Log "riter . 7PT- heck point D. %0O4- system monitor ). P0O4- Process 0onitor E. AR 6-archi#er 1. R) O-reco#er 6. Dnnn-Dispatcher .. L 74 Klock G. %nnn- %er#er D*5R K Database 5riter "rites modified block from the database b$ffer cache to the data files. D*5R "rites "hen more data need to be read into the %1A and too fe" database b$ffers are free. The least recently $sed data is "ritten to the data file first.D*5R also "rites "hen check point occ$rs . L15R-log "riter redo log entries generated in the redo log b$ffer of the %1A to on line Redo log Eiles. L15R "rites redo log entries into an on line redo log file "here transaction commit and the log files are f$ll.

7PT-process is responsible for signalling D*5R at check point and $pdating all data files and control files of the database. %0O4 Kperform instance reco#ery at instance start $p, in a m$ltiple instance system ,%0O4 also clean $p the temporary segments that are no longer in $se P0O4 K performs process reco#ery "hen $ser process fail P0O4 is responsible for cleaning $p the cache and freeing reso$rce tat the process "as $sing P0O4 also check on dispatcher and ser#er process and restart them if they ha#e failed . AR 6-copies the on line redo files to archi#al storage "hen they are f$ll . arch is acti#e only "hen a databaseFs redo log $s $sed in arhi#e log mode. R) O K is $sed to to resol#e distrib$ted transaction that are pending d$e to a net"ork or system fail$re in a distrib$ted database. D444- process is responsible for ro$ting re($est from connected $ser process to a#ailable shared ser#er process and ret$rning the response back to the appropriate $ser process . L 74-lock are $sed for inter instance locking "hen the oracle parallel ser#er is option is $sed.
Q.Explain the difference between $ORACLE !O"E and $ORACLE #A$E. ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is where the oracle products reside. Q.!ow can %ou rebuild an index? AL ER !"#E$ inde%_na&e REB'!L#(

#A A BASE L!")
Q.What are the t%pes of database lin&s? *ri+ate database lin,- public database lin, . networ, database lin,. Q.What is public database lin&? *ublic database lin, is created for the special user /roup *'BL!C. A public database lin, can be used when any user in the associated database specifies a /lobal ob0ect na&e in a S1L state&ent or ob0ect definition. Q.What is networ& database lin&? "etwor, database lin, is created and &ana/ed by a networ, do&ain ser+ice. A networ, database lin, can be used when any user of any database in the networ, specifies a /lobal ob0ect na&e in a S1L state&ent or ob0ect definition. Q.What is pri'ate database lin&? *ri+ate database lin, is created on behalf of a specific user. A pri+ate database lin, can be used only when the owner of the lin, specifies a /lobal ob0ect na&e in a S1L state&ent or in the definition of the owner2s +iews or procedures.

Q.!ow do %ou resi(e a data file? AL ER #A ABASE #A A3!LE 4datafile_na&e5 RES!6E 4new_si7e5( Q.What 'iew would %ou use to loo& at the si(e of a data file?

#BA_#A A_3!LES Q.)a*e a tablespace auto*aticall% created when %ou create a database. he S8S EM tablespace. Q.)a*e two files used for networ& connection to a database. "S"AMES.ORA and S1L"E .ORA *ER3ORMA"CE
Q.What is Execution +lan? he co&bination of the steps the opti&i7er chooses to e%ecute a state&ent is called an e%ecution plan. Q.Can one resi(e tablespaces and data files? ,for D#AOne can &anually increase or decrease the si7e of a datafile fro& Oracle 9.: usin/ the co&&and. AL ER #A ABASE #A A3!LE 2filena&e:2 RES!6E ;<<M( Because you can chan/e the si7es of datafiles- you can add &ore space to your database without addin/ &ore datafiles. his is beneficial if you are concerned about reachin/ the &a%i&u& nu&ber of datafiles allowed in your database. Manually reducin/ the si7es of datafiles allows you to reclai& unused space in the database. his is useful for correctin/ errors in esti&ations of space re=uire&ents. Also- datafiles can be allowed to auto&atically e%tend if &ore space is re=uired. Loo, at the followin/ co&&and> CREA E ABLES*ACE pcs_data_ts #A A3!LE 2c>?ora_apps?pcs?pcsdata;.dbf2 S!6E @M A' OE$ E"# O" "E$ ;M MA$S!6E '"L!M! E# #E3A'L S ORAAE B!"! !AL ;<:C< "E$ ;<:C< M!"E$ E" S ; MA$E$ E" S '"L!M! E# *C !"CREASE <D O"L!"E *ERMA"E" ( Q.!ow does one .i'e de'elopers access to trace files ,re/uired as input to t&prof-? ,for D#Ahe Ealter session set s=l_traceFtrueE co&&and /enerates trace files in 'SER_#'M*_#ES that can be used by de+elopers as input to t,prof. On 'ni% the default file &as, for these files are Erw% rGG GGGE. here is an undocu&ented !"! .ORA para&eter that will allow e+eryone to read Brw% rGrGGD these trace files> _trace_files_public F true !nclude this in your !"! .ORA file and bounce your database for it to ta,e effect. H Q.Can one rena*e a tablespace? ,for D#A"o- this is listed as Enhance&ent Re=uest ;CI9C:. Jor,around> E%port all of the ob0ects fro& the tablespace #rop the tablespace includin/ contents Recreate the tablespace !&port the ob0ects Q.What is the function of Opti*i(er? he /oal of the opti&i7er is to choose the &ost efficient way to e%ecute a S1L state&ent. Q.What is R0LE1based approach to opti*i(ation? Choosin/ an e%ecutin/ planbased on the access paths a+ailable and the ran,s of these access paths. Q.What are the responsibilities of a Database Ad*inistrator? !nstallin/ and up/radin/ the Oracle Ser+er and application tools. Allocatin/ syste& stora/e and plannin/ future stora/e re=uire&ents for the database syste&. Mana/in/ pri&ary database structures BtablespacesD Mana/in/ pri&ary ob0ects Btable-+iews-inde%esD Enrollin/ users and &aintainin/ syste& security. Ensurin/ co&pliance with Oralce license a/ree&ent Controllin/ and &onitorin/ user access to the database. Monitorin/ and opti&i7in/ the perfor&ance of the database. *lannin/ for bac,up and reco+ery of database infor&ation. Maintain archi+ed data on tape Bac,in/ up and restorin/ the database. Contactin/ Oracle Corporation for technical support. Q.What is a trace file and how is it created? Each ser+er and bac,/round process can write an associated trace file. Jhen an internal error is detected by a process or user process- it du&ps infor&ation about the error to its trace. his can be used for tunin/ the database.

Q.What are the t%pes of $QL $tate*ent? #ata #efinition Lan/ua/e > CREA E-AL ER-#RO*- R'"CA E-REKO)E-"O A'#! . COMM! . #ata Manipulation Lan/ua/e> !"SER -'*#A E-#ELE E-LOC) ABLE-E$*LA!" *LA" . SELEC . ransactional Control> COMM! . ROLLBAC)Session Control> AL ERSESS!O" . SE ROLESyste& Control > AL ER S8S EM.