版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
FlashbackTechnology,LogMiner,andDataPumpEnhancements.ObjectivesAftercompletingthislesson,youshouldbeableto:UseFlashbackDataArchivetocreate,protect,andusehistorydataPrepareyourdatabaseCreate,change,anddropaflashbackdataarchiveViewflashbackdataarchivemetadataUseFlashbackTransactionBackoutSetupFlashbackTransactionprerequisitesQuerytransactionswithandwithoutdependenciesChoosebackoutoptionsandflashbacktransactionsUseEnterpriseManagerLogMinerUseDataPumplegacymode.FlashbackDataArchive:OverviewTransparentlytrackshistoricalchangestoallOracledatainahighlysecureandefficientmanner:“Secure”NopossibilitytomodifyhistoricaldataRetainedaccordingtoyourspecificationsAutomaticallypurgedbasedonyourretentionpolicy“Efficient”SpecialkerneloptimizationstominimizeperformanceoverheadofcapturinghistoricaldataStoredincompressedformintablespacestominimizestoragerequirementsCompletelytransparenttoapplicationsEasytosetup.FlashbackDataArchive:OverviewOriginaldatainUndodataDMLoperationsbuffercacheFlashbackdataarchivesstoredintablespaces1year2years5yearsExample:Threeflashbackdataarchiveswithretentionof:ForretentionrequirementsexceedingundoFBDA.Historyorarchivetables:-Compressedstorage-WithautomaticdigitalshreddingFlashbackDataArchive:ArchitectureBuffercacheDMLchangesusedbyFBDAOldvaluesUndoFBDAFlashbackdataarchives123.PreparingYourDatabaseCreateoneormoretablespacesfordataarchivesandgrantQUOTAonthetablespaces.GranttheFLASHBACK
ARCHIVEADMINISTERsystemprivilegetocreateandmaintainflashbackarchivestothearchiveadministrator.GranttheFLASHBACKARCHIVEobjectprivilege(toenablehistorytrackingforspecifictablesinthegivenflashbackarchives)tothearchiveuser.GrantFLASHBACKandSELECTprivilegestoqueryspecificobjectsasnecessary...Configuringundo:Createanundotablespace(default:automaticallyextensibletablespace)EnableAutomaticUndoManagement(11gdefault)Understandautomatictuningofundo:Fixed-sizetablespace:AutomatictuningforbestretentionAutomaticallyextensibleundotablespace:Automatictuningforlongest-runningqueryRecommendationforFlashback:Fixed-sizeundotablespacePreparingYourDatabase..FlashbackDataArchive:WorkflowCreatetheflashbackdataarchive.Optionally,specifythedefaultflashbackdataarchive.Enabletheflashbackdataarchive.Viewflashbackdataarchivedata..UsingFlashbackDataArchive1. Createtheflashbackdataarchive:2. Enablehistorytrackingforatableinthearchive:3. Viewthehistoricaldata:CREATEFLASHBACKARCHIVEfla1TABLESPACEtbs1QUOTA10GRETENTION5YEAR;
ALTERTABLEinventoryFLASHBACKARCHIVEfla1;SELECTproduct_number,product_name,countFROMinventoryASOFTIMESTAMPTO_TIMESTAMP('2007-01-0100:00:00','YYYY-MM-DDHH24:MI:SS');.ConfiguringaDefaultFlashbackDataArchiveUsingadefaultflashbackarchive:1. Createadefaultflashbackdataarchive:2. Enablehistorytrackingforatable:
Note:Thenameoftheflashbackdataarchiveisnotneededbecausethedefaultoneisused.3. Disablehistorytracking:CREATEFLASHBACKARCHIVEDEFAULTfla2TABLESPACEtbs1QUOTA10GRETENTION2YEAR;
ALTERTABLEstock_dataFLASHBACKARCHIVE;ALTERTABLEstock_dataNOFLASHBACKARCHIVE;.FillingtheFlashbackDataArchiveSpaceWhathappenswhenyourflashbackdataarchivegetsfull?90%spaceusageRaisingoferrors:ORA-55623
"FlashbackArchive\"%s\"isblockingandtrackingonalltablesissuspended"ORA-55617"FlashbackArchive\"%s\"runsoutofspaceandtrackingon\"%s\"issuspended"GeneratingalertlogentrySuspendingtracking.MaintainingFlashbackDataArchivesAddingspace:Changingretentiontime:Purgingdata:Droppingaflashbackdataarchive:ALTERFLASHBACKARCHIVEfla1ADDTABLESPACEtbs3QUOTA5G;ALTERFLASHBACKARCHIVEfla1PURGEBEFORETIMESTAMP(SYSTIMESTAMP-INTERVAL'1'day);
ALTERFLASHBACKARCHIVEfla1MODIFYRETENTION2YEAR;DROPFLASHBACKARCHIVEfla1;.FlashbackDataArchive:ExamplesToenforcedigitalshredding:Toaccesshistoricaldata:Torecoverdata:CREATEFLASHBACKARCHIVEtax7_archiveTABLESPACEtbs1RETENTION7YEAR;
SELECTsymbol,stock_priceFROMstock_dataASOFTIMESTAMPTO_TIMESTAMP('2006-12-3123:59:00','YYYY-MM-DDHH24:MI:SS')
INSERTINTOemployeesSELECT*FROMemployeesASOFTIMESTAMPTO_TIMESTAMP('2007-06-1211:30:00','YYYY-MM-DDHH24:MI:SS')WHEREname='JOE';
.FlashbackDataArchive:DDLRestrictionsUsinganyofthefollowingDDLstatementsonatableenabledforFlashbackDataArchivecausesanORA-55610error:ALTERTABLEstatementthatdoesanyofthefollowing:PerformspartitionorsubpartitionoperationsConvertsaLONGcolumntoaLOBcolumnIncludesanUPGRADETABLEclause,withorwithoutanINCLUDINGDATAclauseDROPTABLEstatementTRUNCATETABLEstatement.FlashbackDataArchive:SupportingTransparentSchemaEvolutionAdditionalDDLsupported:DROP,RENAME,andMODIFYcolumnDROPandTRUNCATEpartitionRENAMEandTRUNCATEtableFlashbackqueriesworkacrossDDLchanges:Outputispresentedaccordingly.AllotherDDLnotautomaticallysupportedDropColumnAddColumnAddColumntimeFlashbackVersionQuery11.2.FlashbackDataArchive:SupportingFullSchemaEvolutionDBMS_FLASHBACK_ARCHIVE.DISASSOCIATE_FBAandDBMS_FLASHBACK_ARCHIVE.REASSOCIATE_FBADisablesFlashbackDataArchiveonspecifiedtables,allowingmorecomplexDDL(upgrades,splittables)EnforcesschemaintegrityafterassociationBasetableandhistorytableschemasmustbethesame.RequirestheFLASHBACK
ARCHIVE
ADMINISTERprivilegeALTERSCHEMADISASSOCIATEALTERSCHEMAASSOCIATE11.21243HistorytableHistorytableBasetable.ViewingFlashbackDataArchivesViewingtheresults:ViewNameDescription*_FLASHBACK_ARCHIVEDisplaysinformationaboutflashbackdataarchives*_FLASHBACK_ARCHIVE_TSDisplaystablespacesofflashbackdataarchives*_FLASHBACK_ARCHIVE_TABLESDisplaysinformationabouttablesthatareenabledforflashbackarchiving.GuidelinesandUsageTipsCOMMITorROLLBACKbeforequeryingpastdataUseofcurrentsessionsettingsObtainSCNwiththeDBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBERfunction.Computeapasttimewith: (SYSTIMESTAMP-INTERVAL'10'MINUTE)UseSystemChangeNumber(SCN)whereprecisionisneeded(timestampshaveathree-secondgranularity)..QuizWhichofthefollowingarecharacteristicsofaflashbackdataarchive?Aflashbackdataarchiveconsistsofoneormoretablespacesorpartsthereof.Aflashbackdataarchiveconsistsofonlyonetablespace.Youcanhaveonlyoneflashbackdataarchiveineachdatabase.Youcanhavemultipleflashbackdataarchivesineachdatabase..FlashbackTransactionBackoutLogicalrecoveryoptiontorollbackaspecifictransactionandallitsdependenttransactionsUsingredologsandsupplementalloggingCreatingandexecutingcompensatingtransactionsYoufinalizechangeswithcommitorrollback.FasterandeasierthanlaboriousmanualapproachDependenttransactionsinclude:Write-after-write(WAW)andprimarykeyconstraints,butnotforeignkeyconstraints.Prerequisites
…anddatabasemustbeinARCHIVELOGmode11.2update.FlashingBackaTransactionYoucanflashbackatransactionbyusingEnterpriseManagerorthecommandline.EnterpriseManagerusestheFlashbackTransactionWizard,whichcallstheDBMS_FLASHBACK.TRANSACTION_BACKOUTprocedurewiththeNOCASCADEoption.IfthePL/SQLcallfinishessuccessfully,itmeansthatthetransactiondoesnothaveanydependenciesandasingletransaction
is
backedoutsuccessfully..UsingtheFlashbackTransactionWizard.UsingtheDBMS_FLASHBACK.TRANSACTION_BACKOUTProcedureCREATETYPEXID_ARRAYASVARRAY(100)OFRAW(8);CREATEORREPLACEPROCEDURETRANSACTION_BACKOUT(numberOfXIDsNUMBER,--numberoftransactionspassedasinputxidsXID_ARRAY,--thelistoftransactionidsoptionsNUMBERdefaultNOCASCADE,--backoutdependenttxntimeHintTIMESTAMPdefaultMINTIME--timehintonthetxnstart);.ViewingaDependencyReportAfterchoosingyourbackoutoption,thedependencyreportisvisibleintheDBA_FLASHBACK_TXN_STATEandDBA_FLASHBACK_TXN_REPORTviews.Reviewthedependencyreportthatshowsalltransactionswhichwerebackedout.Committhechangestomakethempermanent.Rollbacktodiscardthechanges..ViewingFlashbackTransactionMetadataViewNameDescription*_FLASHBACK_TXN_REPORTDisplaysrelatedXMLinformation*_FLASHBACK_TXN_STATEDisplaysthetransactionidentifiersforbacked-outtransactionsSQL>SELECT*FROMDBA_FLASHBACK_TXN_STATE;COMPENSATING_XIDXIDBACKOUT_MODEDEPENDENT_XIDUSER#-------------------------------------------------------------------050015006905000003000000A905000040
050015006905000005001E0063050000403000000A90500000
.QuizFlashbackTransactionBackoutenablesyoutorollbackaspecifictransactionanddependenttransactionswhilethedatabaseremainsonline.TrueFalse.UsingLogMinerPowerfulaudittoolforOracledatabasesDirectaccesstoredologsUserinterfaces:SQLcommandlineGraphicaluserinterface(GUI)IntegratedwithEnterpriseManager.Review:DataPumpExportandImportexpdp
clientDump
filesetDatabaseDataPump
jobSourceMaster
tableServer
processDump
filesetServer
processTargetDataPump
jobimpdp
clientDatabaseMaster
tableDatabase
link“Networkmode”.MigrationwithDataPumpLegacyModeAssistanceintransitioningfromimpandexputilitiestoimpdpandexpdputilitiesDataPumpinlegacymode:1. Encountersuniqueimporexpparameterandenterslegacymode2. Attemptstomaptheoldsyntaxtothenewsyntax3. Displaysnewsyntax4. ExitslegacymodeBestpracticetip:Oraclestronglyrecommendsthatyouviewthenewsyntaxandmakescriptchangesastimepermits.11.2.DataPumpLegacyModeTheDataPumpexportandimportutilities:ReadandwritefilesonlyinDataPumpformatAcceptexpandimputilitycommandsinlegacymodeLegacymodeparameters:Canbeidenticaltothenewsyntax:FILESIZE=integer[B|K|M|G]Canbesimilar:QUERY=query_clauseAreignored,whenthecommandissupercededbyDataPumpdefaults.BUFFER=integerCOMPRESS={y|n}DIRECT={y|n}Causeanerrorwhenoldandnewsyntaxismixed.11.2.DataPumpLegacyModeLegacymodeparameters(continued):AremappedtoDataPumpparameters,ifpossible:consistent={y|n}->FLASHBACK_TIMEGRANTS=n->EXCLUDE=CONSTRAINTSINDEXES=n->EXCLUDE=INDEXLOG=filename->LOGFILE=filenameFILE=filename->dumpfile=directory-object:filename
Canbesimilar,butnotidentical:FEEDBACK=integer->STATUSCauseanerrorwhenincompatiblewith
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年电工职业技能鉴定真题练习
- 2026年昆明市盘龙区中小学编制教师招聘笔试模拟试题及答案详解
- 2026年伊春市红星区中小学编制教师招聘考试备考题库及答案详解
- 2026年江西省鹰潭市中小学编制教师招聘笔试模拟试题及答案详解
- 2026年贵阳市花溪区中小学编制教师招聘笔试模拟试题及答案详解
- 2026年辽宁省抚顺市中小学编制教师招聘考试参考试题及答案详解
- 2026年鹤岗市工农区中小学编制教师招聘笔试备考试题及答案详解
- 2026年青岛市市北区中小学编制教师招聘笔试参考题库及答案详解
- 2026年伊春市美溪区中小学编制教师招聘考试模拟试题及答案详解
- 2026年开封市郊区中小学编制教师招聘笔试参考题库及答案详解
- 2026新教材人教版九年级上册英语暑假预习:Unit1-Unit5词汇详解
- 2026年北师大版(一起)小学英语五年级下册期末综合测试卷及答案(2套)
- 2025-2026学年北师大版八年级数学下册期末考试模拟卷(二)
- 山东大学2026年强基计划面试模拟试题及答案解析
- 2025年山西晋中市地理生物会考真题试卷+答案
- 《电加热熔盐储能热力站技术标准》
- 混凝土蓄水池施工方案
- MOOC 工程力学-大连海事大学 中国大学慕课答案
- 市政工程资料表格(完整版)
- 怎样收纳整理物品PPT教学课件
- 环境因素对食品品质的影响教学
评论
0/150
提交评论