版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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年人教版高一年级语文下册第3单元现代文测试卷
- 2026年江苏省湘教版五年级数学下册单元重难点检测试卷
- 2025-2026年心理测评技术与应用练习题
- 2025-2026年天津市北师大版高中化学下册元素周期表专项训练习题
- 2026年福建省人教版初中物理下册第5章同步练习题
- 2025-2026年国防教育与国家安全教育模拟试卷
- 2026年天津市苏教版小学语文二年级上册第5单元课后练习题
- 2026年陕西省苏教版九年级地理下册第10章世界地理综合测试卷
- 2026年广东省人教版初中数学上册第7章同步练习题
- 2026-2030医用包装袋市场投资前景分析及供需格局研究预测报告
- 中国邮政集团2026招聘笔试真题
- 2026年山东发展投资控股集团有限公司权属企业社会招聘(82人)考试备考试题及答案详解
- 2026中国农业大学烟台研究院非事业编实验系列管理服务岗工勤岗招聘4人(二)笔试题库含答案详解(综合题)
- 2025 版中国脓毒症与感染性休克院前急救指南
- (2026秋新版)西师大版四年级数学上册全册教案
- 统编版道德与法治五年级上册《开学第一课》课件
- 四川省泸州市2026年中考英语试题附答案
- 2026国企总部招聘笔试真题题库及标准答案(完整版)
- 动火作业专项施工方案
- 钢筋工程监理实施细则
评论
0/150
提交评论