Sunteți pe pagina 1din 3

OracleDBAInterviewQuestionsandAnswersDatapump

OracleDatapumpInterviewQuestionsandAnswers

Inwhichcasesimp/expisused?
Eliminatedatabasefragmentation
Schemarefresh(movetheschemafromonedatabasetoanother)
Detectdatabasecorruption.Ensurethatallthedatacanberead(ifthedatacanbereadthatmeansthereis
noblockcorruption)
Transportingtablespacesbetweendatabases
Backupdatabaseobjects

WhicharethecommonIMP/EXPproblems?
ORA00001:Uniqueconstraint...violatedPerhapsyouareimportingduplicaterows.UseIGNORE=Nto
skiptablesthatalreadyexist(impwillgiveanerroriftheobjectisrecreated)orthetablecouldbedropped/
truncatedandreimportedifweneedtodoatablerefresh..
IMP00015:Statementfailed...objectalreadyexists...UsetheIGNORE=Yimportparametertoignore
theseerrors,butbecarefulasyoumightendupwithduplicaterows.
ORA01555:SnapshottoooldAskyouruserstoSTOPworkingwhileyouareexportingoruseparameter
CONSISTENT=NO(Howeverthisoptioncouldcreatepossiblereferentialproblems,becausethetablesarenot
exportedfromonesnapshotintime).
ORA01562:FailedtoextendrollbacksegmentCreatebiggerrollbacksegmentsorsetparameter
COMMIT=Y(withanappropriateBUFFERparameter)whileimporting.

HowcanwecheckDATAPUMPfileiscorruptedornot?Sometimeswemaybeinsituation,tocheckwhether
thedumpfileexportedlongtimebackisVALIDornotorourapplicationteamissayingthatthedumpfile
providedbyusiscorrupted.
UseSQLFILEParameterwithimportscripttodetectcorruption.Theuseofthisparameterwillreadtheentire
datapumpexportdumpfileandwillreportifcorruptionisdetected.
impdpsystem/***directory=dump_dirdumpfile=expdp.dmplogfile=corruption_check.log
sqlfile=corruption_check.sql
ThiswillwriteallDDLstatements(whichwillbeexecutedifanimportisperformed)intothefilewhichwe
mentionedinthecommand.

HowcanwefindelapsedtimeforparticularobjectduringDatapumporExport?Wehavean
undocumentedparametermetricsinDATAPUMPtocheckhowmuchittooktoexportdifferentobjectstypes.
Expdpsystem/passwddirectory=dump_dirdumpfile=expdp_full.dmplogfile=expdp_full.logfull=ymetrics=y

Howtomovetablefromonetablespacetoanothertablespace?
Youcanuseanyofthebelowmethod:
1.Exportthetable,dropthetable,createdefinitionoftableinnewtablespaceandthenimportthedatausing
(impignore=y).
2.Createnewtableinnewtablespacethendroptheoriginaltableandrenametemporarytablewithoriginal
tablename.
CREATETABLEtemp_nameTABLESPACEnew_tablespaceasselect*from'source_table'
DROPTABLEreal_table
RENAMEtemp_nametoreal_table

WhatisthedifferencebetweenSQL*loaderandImportutilities?
Boththeseutilitiesareusedforloadingthedataintothedatabase.Thedifferenceisthattheimportutilityrelies
onthedatabeingproducedbyanotheroracleutilityExportwhileSQL*Loaderisahighspeeddataloading
mechanismallowsdatatobeloadedthathasbeenproducedbyotherutilitiesfromdifferentdatasource.SQL*
LoaderloadsdatafromstandardOSfilesorflatfileinoracledatabasetables.Export/Importallowsmoving
existingdatainoracleformattoandfromoracledatabase.

Howtoreorganizeschema?
Wecanusedbms_redefinitionpackageforonlinereorganizationofschemaobjects.Otherwiseusing
import/exportanddatapumputilityyoucanrecreateorreorganizeyourschema.

HowwecanimprovetheEXPPerformance?
1.SettheBUFFERparametertoahighvalue(e.g.2M)
2.Ifyourunmultipleexportsessions,ensuretheywritetodifferentphysicaldisks.

HowwecanimprovetheIMPperformance?
1.ImportthetableusingINDEXFILEparameter(theimportisnotdone,butafilewhichcontainstheindexes
creationisgenerated),importthedataandrecreatetheindexes
2.Storethedumpfiletobeimportedonaseparatephysicaldiskfromtheoracledatafiles
3.Ifthereareanyconstraintsonthetargettable,theconstraintsshouldbedisabledduringtheimportand
enabledafterimport
4.SettheBUFFERparametertoahighvalue(ex.BUFFER=30000000(~30MB))andCOMMIT=yorset
COMMIT=n(isthedefaultbehavior:importcommitsaftereachtableisloaded,however,thisusealotofthe
rollbacksegmentsorundospaceforhugetables.)
5.Usethedirectpathtoimportthedata(DIRECT=y)
6.(ifpossible)IncreaseDB_CACHE_SIZE(DB_BLOCK_BUFFERSpriorto9i)considerablyintheinit<SID>.ora
file
7.(ifpossible)SettheLOG_BUFFERtoabigvalueandrestartoracle.

HowDatapumpworksinternally?WhatresourceswillbeutilizedatNetworklevel,inMemorylevel?

HowtoExportDumpfiletodifferentmountpoints(multipledumpfiles)sametimebothinEXPand
EXPDP,asthedestinationhaslessspaceavailable?

S-ar putea să vă placă și