0% found this document useful (0 votes)
29 views25 pages

Usama Dba Solved

Database solved paper of PU

Uploaded by

ua388358
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
29 views25 pages

Usama Dba Solved

Database solved paper of PU

Uploaded by

ua388358
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 25
> at 110 cock: Hau can we s e Wlite Stes, command 2 3 x 201), (80/6) = : » Araxciy Shutclawn the database and begin xecovery (“SHUTDOWN TrarEDIATE”) a RS tio Restore all datafiles }xom backup: Youmey 2 meed te stose adchived Log s-If enough Space Vs T= available to xestoxe the (lot -ARCHIVE-DEST & = SET-LOGSOURCE) to change the Location - iii), Mount the olatabace. ("STARTUP MOUNT’). a _ tiv) Recover the database Be (8Q2 5 vecovers database until time ‘11.0 Clock’) @ atin Reset logs: (S81 > altes database apen xescthog §; =(vi)_ Noo DB % yecoves anid owatlable Jos uses, but Sr iny.dlata entesecl after the xe Cover time 11. Os Sd ac util need to be xeerrtesed- . Note -2n (ols) time ix _4o 0 lack: So, ye can Sim ehange Hime in te above Answey. ieee the location of the Snapshot carhal 2) Configure the audobackup control File pea the axchived seco Logs 258 4 Cenfiguse the flash JECDVEAY AHEQ.: F Commands : 2) Login to the Seaves executing the DB- (Entes wseiname + / a5 sysdba) | 2) Start RMANI using the xman_commanal (Y% xman) (4 xtman TARGET/) i 2 AT He RMAN psornpt , cennect to the tasget » Oletabase using the CONNECT TARGET commanol __CRMAN > & CONNECT TARGET ; ch 4) AT he _RMAN prompt, Lackupthe DB to the flash HrecevOy axea using She Lemmancl: ee __ (RAN > Backup Database Plus Aschive log 3) 5) To check the List of baCRUPS, use_cemmand: © ( MAN > List Backup 3) @0'2) Yers with Commands: ee pgin te the DB and cennect as SYS Aba: pwn He Database- | ~ __CSSHDTOOWWN Im EDIATE? a) _Meunt the Database: —— CSTARTUP MOUNT”. z = the above command is successfull , then tt T>_dlesplays the following output ORACLE instance see 4 Fa oe System aR Axea _ (9dgits) byte, Meee xed $620 toligits) bytes 4 24 aa Vakiable Size (4olipits) bytes pee Database Buffes 4 ctigits) bytes a BP REDO Guages (Flights) bees S| Datobase mounted. #3 : 4 Ulhite 0. Command to neate a user Ale —, having 14GB Quota en each tablespace and 188eand 1BS1 i = anes Doi Baie) i (be | omer asuad stem Crbol hared geaves picks up the xequest ext queue and processes the xequess Shared server places the Hesponse on he Dx DBS\ SPFILEXE ORA contsof fle ; { 3 OFACLE \ORADATA\XE\ CONTRO“ BD ALTER SYSTEM SET CONTROL.-FILES = % \ ORACLE XE\A PNORACLE\ ORADATA\ XE \ CONTROL: P ? & p a ~ Cz \ORACLEXE \ APP\ ORACLE ORADATA\XE\ CONTROLDBE C:\ ORACLE XE\APP\ORACLE\ORADATA\XEN CONTROL AD > SOL select name {kom vib corlaot fife « C\oRACLEXE\APP\ oRACLE\ ORADATA\XE\ CONTROL DBF ¢ C= \ CRACIEXE\ APP\ORACLE\ORADATA\XE \COn TROLS DBE Q32 Waite a command.te make a re table © —$Pace_and then make ik defaulk tempocany cee (2014) » (e616) | Ains:-- Making Ternpoxory Tablespace - SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE ‘/ORADATA /inytemp-1-tmp” ~ i SIZE JOM EXTENT MANAGEMENT LOCAL UNIFORM SI2E 46M; Making it olefault temporary tablespace s- SQL> ALTER DATAGASE DEFAULT TEMPORARY TABLESAACE Temps | Qs &plain Row stuctuke with oliagame (ol4) [WITTE 7 LL) PAAAAAAN 6 as vallabk length Jsecorcs wrowane genesally stoxect inthe ofdes rut He defined: andl any null cateumns ave thé colurnn mot block ha. seb fo8 OLPT > Syntax :-— > Syntax e CREATE INDEX idy-emp-idl |CREATE BITMAP INDEX tok-emp: On employee (Fa); ON employee AL); Q410 Ditfeserce biw immediate and deffered Constraints? (20%) ANE Tmmecliate Conthaints:- Jmmeciake contain ¢ ese the constrainis which ave enforced at the endl of every database Dm statement A constraints _ Via. am casts the Statement to be rolled back. Hh alo knauwnas nen-defessed constraint: Dis type of constraint can be modlified to be enforced at the enc of a transaction: Deffered Constraints: Deffesed censtsaints ave the —_cenkhaints which ove Checked only vihna taansattien is commited: df any constraints ee _ Vielation ate occured at the committe entice ansaction is soled back: These constsaints ane | mate useful uwhen both the paxent_and_chtld wows na. foseign key nelationshipn axe entered at the same time: _ SELECT * From Vv & tecoves- Fife, Recover dlatafile 1) S61 > ALIER. DATABASE CREATE. DATAFe ‘Jdiska/ DATA fol tdif?’ as Vidisra/ Data falf te 2) Apply aschived and enline xedolog files ta tr wecbeited Aatofi:le: Re. OBL s RECOVER TABLESPACE -lable- dlata By 24) 68ing the datafile ox tablespace online Fi 2 SQL> ALTER TABLESPACE table dada enline; — Gia UWite clown the stepsand cemmands to = _secoves the tablese mm (20/5) 9 =o Ams: 4) Shutclown the database PS SOLS SHUTDOWN TMMEDTATE > 2) Restoxe all ohta files OLS RicoveR datafile table—data 3) Mount the olatabase : L SOLS SARTUP mount Recover the database SQL> Recover olatabase utith Reset Ors the aa members each gaoup (Ghovpt, Din yous. Arcated. on ar “_ Qo!5), (201) S** To add. sedolog membes to gAasp wie can Use = “Alter Database” command: —S>S sil ALTER DATABASE ADD LOGFILE MEMBER ~~ “$mydb/ ORACLEDATA/u04/ £09 got xdo’ to Gaoup4 eg '$mydb/ORACL EDATA).04/_log 01: ido’ to Gsoup2 > _feo * Damydb/ ORACLE) ATA/u04 0d tdlo’ do Gueupt “an °$ mydb/ ORACLEDATA/1104/ bog od: to’ to Gasupad RP ne g ae Qin wsKite a, lemmard. to old w1eol0 membess 20 (104 4b- sdo, Log 1 xdo) into (Grsoup3) i. in you a: database Located on “rmydb"e =i (201%) ob Ane Todd edo log members to group we can use “Alkes Database” Command: co ALTER DATABASE. ADD Lol MEMBER . a © $ maydlb/ORACLEDATA/.u04/ Jog 1b-xd0’ to Cxseu>3 ema c 3 myc] OKA CLE Aa. 04) Lag ic: “le ‘to soups. A (715 Geate esate with mame ‘uses.ot” Locally = amanagedl unifeem size extendlse wi me (2014) Ans: CREATE TABLESPACE Ust.01 DAFLE C+ \ORACLE \ORADATA\ TSH1\ weer ot rem Sie aNAeMONT Loch UNIFORM STZE 5 PTANAGE) 2 PAILE ts Static, Client |—> SPFILE is peasistent siole text file sewed side binary file. = local copy of > local copy is not : hed to stast claabase | Lequixeol feom.@ remote machine Grnot be backup by RAMAN L2H & availat Son Can Access se will be Pkotected yo Seige soo ie. fat hock ip: Ang Same answers of Q5- See on. paevious Ages Q19 Lithak isthe Puspose of Cache? How DB cathe work in Oxade rlrive Some Suggestions Lo tmproe it ? (2015) ing: Purpose of Cache:- > Catching is C COS. of s- Accessing nA. AAives: stosing data in memory amematy is fas, qyickes Osacle dedabase cache ' amd seilahiliity Of apy ns 4acdle datahasés. [rJitr oracle ola yous applicatiens 5 Ira Abguests 25 Wanking of DB Luffes Caches : Stoxes the most recently usecl hi - 5 ts the park of SGA (System Global Axea)- 4 holds copies af Olata blocks that axe read fiom olata fles> Database buffers. cache is shased by all cencuent UbCNS: Buf fe cache. us osganized in duo Lte-These * ae Waite List ancl Least Recent used (LRy) List. ben artacle uses Aeguiies a_ specific data block, it fisst seasch thin Buffer. Cache. it finds wyequised block, ik 16 lt accessed nel Hats, event. is known a& Cache Hite» 9f seasching in B LESS. (an f abase buffer Cache cater tale gf a ona data: uh binaay file recessany ty fot the LOSS Fpl a4 Oat What is Sesves Process? Explain aliffesen bhw. oledicated! serves arcl Shared. seaver? (Qo) oi = Gesvers Procese:- ae A Seaver process is. 0. pkogsam f tho dinectty imtesack with the osacdle sexves- Osacle creates sewer processes do handle Hae areas of the uses processes conmectedl ta.an taskance A Serves process can be etthes of the followin 1 A oledticated Sesves. prowess , ushich services enky ene uses process A Shasedl Serves Process, uthich can sevice mulbiple Uses processes: Declicatedl Srwver Shased Staves. 2 luhenackient request ln hen the frsst vequest 1% Hetiveol, a newserves ecoivedl fxom.a_ client, the proces An A session | dispakches pocess Places this ane cheaked Jor the Chitnt| veqest 0.0 Common aueue: 7 qiatis pick upbyan _§ awollable shased Sexves process em > Releasing DB wesoudces involtes Cesminating the Cravolves terminating the session &.StKles process sefsion : > These is. one.sewer ot | There is only one session and.ene.session foreach | fos each Nien > 2 saa en ee i : 7 2 Stssion emt pilocated fx e PGA — Releasing DB besoUs CES > Lexion memory Us ed_fxom Tt sa Check OF =e “There ane tu types of Pasome 1) Serves Pasametes files (SP; Fite). a) Int deration Masametes Pile _C TP File) rok Certain. — The file stroubdl. If chanackes eb: i : iS 0 Cop pn include jr ctl pa 3 b ae ee fils,,_, Aching 1g mole is 0 ut the olatabase in fos Creating o “fot al thamsactiens pat hove accused! Aadohase 8a that yolk can xecoves to any in time- NoAschive i NoAschive Log the absence of asthive imitation of not betng peink im time: ) Ofen RMAN execute yee e7n_ Syst Shutcloun the DB & Mounted the DB MAN Slit > SHUTDOWN. IMMEDIATE 5 Be VBE» STARTUP. PAOQUNT ¢ 3) Backup the DB 4 “Rod nih >Cactop J Databesea ind O8aCle instance. cers ebal Arca (SGM memory sth r zounol processes phat OHe used to manage Inétance can open and using 2 aba tune Pi = , TARIVUR NOmMoNT; 5: pe BRIE, cons, ‘Qo/?), i (38/3) Aine Create TemPoKARY TABLESPACE temp TEMPELLE ‘ C :\ ORADATA \temp- 01+ temp” SIZE REvVSE EXTENT MANAREMENT LOCAL UNZFORIA STZ: ‘e\ app) \ ogacle\ sex 4- dbf ApP\ dsk2\ user 4s dbf - Recoves the ‘lata files SAL RECOVER AUTOMATIC dotazihes ORACLEXE \ APP\ oxacle\ users: ales Bhing the tablespace online Se 4 - These xecoxcle | undo- Undo xecoxds ae O4E vEA Beene ox om ChEALLS Ene ON daka- > Sthe —_.. Schema. | objects include sbuctusce such as-tobles —— Seqplences, indexes, clusters eke» o Sof ph and allocates vrs ee space in ». a8aCKE clata bhocks: fet lain database's ata The cata 2f logical dato. stuctuses. SUA) OS tables and indexes is stored tn datafiles - Q, ob. ee ia abl a Logical wott ia pace - ~ pltebose name, rame and Location of lata ol edlofives andl tirne Stan? of detabas Abe SOLVES, Can. by ali y ie men t» } to Stove. ren PLO. cetabase series is more efficient tran a SAA” All the deta is Stored an the data & thesefise, the DBA can easily create the ba ‘the clea f Diagsam of Database Sesves:- ASE : o the elnea A Poptle ab marek sek Of the $ ord and wesouce Aiemits = wasd aging ancl expisotion. ual history fication “Connect time + Cencuttent Session’ : “oft abignments dlo mvt affect cussent Sessions | = fee Moleles can be as signed j-to Uke. s 0mol 20k F te raleb os ofher profiles: a A you clo mot. assign a hen eating a gE the usih i6 automatic lly 248igned the a default fife: - O20 Lkite a command to set passuiasal — Settings though phofile 0/8) = SO) > Create fe p41 pe Limit foaled. ba bier 4 time 30 ce. fock-+ime F a - ~) Ensuse the DB In Adachive log mode. _ 2) Ensuse the DB is up and sunning 2» Use RMAN to dackup/ Open Ra ptomp 9 Ulkile Lackup command in ROMAN prompt — Com ( =F Dato Database openedl - MAN tasget / LY) URMAN > backup Aatohase oe 52 -mourte ol meote UNDO Tablespace uNco2.* °REATE SMALLFILE UNDO TABLESPA, AMFLLE "$140 E/akADKTA/ U0? SIZES AUIDEXTEND ON NEX7 20M _MAXSIZE UNLIMITED MOG UARANTEE § ist the xollback Segment : pes! $ SELECT Segment name Me LOM pnd ;

You might also like