版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Recovering from User ErrorsObjectivesAfter completing this lesson, you should be able to:Perform Flashback table operationManage the recycle binRecover from user errors using Flashback versions queryPerform transaction level recovery using Flashback Transaction query Flashback Time NavigationFlashba
2、ck QueryQuery all data at a specified point in timeFlashback Versions QuerySee all versions of a row between two timesSee the transactions that changed the rowFlashback Transaction QuerySee all changes made by a transactionTx3Tx1Tx2TimeFlashbackFlashback Drop OverviewDROP TABLE employees;FLASHBACK T
3、ABLEemployeesTO BEFORE DROP;Mistake wasmadeRecycle BinDROP TABLE employees; BIN$zbjra9wy=$0EMPLOYEES_PKEMPLOYEESRecyclebinDBA_FREE_SPACEBIN$zbjrBdpw=$0USER_OBJECTSBIN$zbjrBdpw=$0 EMPLOYEESBIN$zbjra9wy=$0 EMPLOYEES_PK1234Querying the Recycle BinSELECT owner, original_name, object_name, type, ts_name,
4、 droptime, related, spaceFROM dba_recyclebinWHERE can_undrop = YES;SELECT original_name, object_name, type, ts_name, droptime, related, spaceFROM user_recyclebinWHERE can_undrop = YES;SQL SHOW RECYCLEBINFlashback Dropped Tables Using EMRestoring Objects from the Recycle BinUse the FLASHBACK TABLE co
5、mmand to restore dropped tables and dependent objects.If multiple recycle bin entries have the same original name:Use unique system-generated names to restore a particular version.When using original names, restored table is LIFO.Rename the original name if that name is currently used.FLASHBACK TABL
6、E TO BEFORE DROP RENAME TO Recycle Bin Automatic Space ReclamationBIN$zbjrBdpw=$0 BIN$zbjra9wy=$0 BIN$zbjra9wy=$0BIN$zbjrBdpw=$0123Recycle binDBA_FREE_SPACE - RECYCLEBINAutoextendRecycle Bin Manual Space ReclamationPURGE TABLE |INDEX PURGE TABLESPACE USER PURGE USER_|DBA_RECYCLEBINBypassing the Recy
7、cle BinDROP TABLESPACE INCLUDING CONTENTS ;DROP USER CASCADE ;DROP TABLE PURGE ;Querying Dropped TablesSELECT . FROM BIN$zbjrBdpw=$0 AS OF .WHERE . RecyclebinUSER_INDEXESYESINDEX_NAMEDROPPEDNOSALES_PKUSER_TABLESBIN$zbjrBdpw=$0 EMPLOYEESBIN$zbjra9wy=$0 EMPLOYEES_PKTABLE_NAMEDROPPEDYESNOSALESFlashback
8、 Drop Considerations Protected tables:Are non-SYSTEM tablespace tablesAre stored in locally managed tablespacesDo not use fine-grained auditing or virtual private databaseThe following dependencies are not protected:Bitmap-join indexesMaterialized view logsReferential integrity constraintsIndexes dr
9、opped before tablesPurged tables cannot be flashed backFlashback Versions Query Overviewt1t2Tx1Tx2SELECT versions_xid, salary FROM employeesVERSIONS BETWEEN TIMESTAMP t1 and t2WHERE last_name = Fox;Tx0Tx0Tx1Tx2 Employees EmployeesFox EmployeesFlashback Versions Query Using EMFlashback Versions Query
10、 SyntaxPseudocolumnDescriptionVERSIONS_STARTTIMEVERSIONS_STARTSCNVersion validity range lower boundVERSIONS_ENDTIMEVERSIONS_ENDSCNVersion validity range upper boundVERSIONS_XIDTransaction that created the versionVERSIONS_OPERATIONOperation that produced the versionSELECT PseudocolumnsFROM VERSIONS B
11、ETWEEN SCN|TIMESTAMP expr|MINVALUE AND expr|MAXVALUE AS OF SCN|TIMESTAMP exprWHERE PseudocolumnsFlashback Versions Query ExampleSELECT versions_xid AS XID, versions_startscn AS START_SCN, versions_endscn AS END_SCN, versions_operation AS OPERATION, first_nameFROM employees VERSIONS BETWEEN SCN MINVA
12、LUE AND MAXVALUEAS OF SCN 5525300WHERE employee_id = 111;XID START_SCN END_SCN O First_NAME- - - - -8C0025003A000000 5525293 I Tom8C0024003A000000 5525291 D Mike8C0022003A000000 5525277 5525291 I MikeFlashback Versions Query ConsiderationsThe VERSIONS clause cannot be used to query:External tablesTe
13、mporary tablesFixed tablesViewsThe VERSIONS clause cannot span DDL commands.Segment shrink operations are filtered out.Flashback Transaction Query OverviewUndoSQLFLASHBACK_TRANSACTION_QUERYDBAUSERErroneousDMLQuerying FLASHBACK_TRANSACTION_QUERYSELECT operation, undo_sql, table_nameFROM FLASHBACK_TRA
14、NSACTION_QUERY;SELECT operation, undo_sql, table_nameFROM FLASHBACK_TRANSACTION_QUERYWHERE xid = HEXTORAW(8C0024003A000000)ORDER BY undo_change#;SELECT operation, undo_sql, table_nameFROM FLASHBACK_TRANSACTION_QUERYWHERE start_timestamp = TO_TIMESTAMP(2003-10-21 11:00:00,YYYY-MM-DD HH:MI:SS)AND comm
15、it_timestamp CREATE UNDO TABLESPACE undotbs1 2 DATAFILE undotbs01.dbf 3 SIZE 100M AUTOEXTEND ON 4 RETENTION GUARANTEE ;SQL SELECT tablespace_name, RETENTION 2 FROM dba_tablespaces;TABLESPACE_NAME RETENTION- -UNDOTBS1 GUARANTEE. .SQL ALTER TABLESPACE undotbs1 2 RETENTION NOGUARANTEE; SCN and Time Map
16、ping EnhancementsThe mapping granularity is three seconds.The mapping is retained for Max(five days, UNDO_RETENTION)Access the mapping by using the following SQL functions:SCN_TO_TIMESTAMPTIMESTAMP_TO_SCNSELECT current_scn, SCN_TO_TIMESTAMP(current_scn)FROM v$database;CURRENT_SCN SCN_TO_TIMESTAMP(CURRENT_SCN)- -3274940 23-SEP-03 02.56.03.000000000 AMSummaryIn this lesson, you should have learned how to:Perform Flashback table operationManage the recycle binRecover from user errors using Flashback versions queryPerform transaction level recovery using FB T
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 七年级 下学期 地理 商务星球版《澳大利亚》优教学案(第2课时)
- 儿童友好的家庭餐饮菜单设计
- 创新思维的培育与产品设计实践
- 从个人到社会看学生健康体能的价值挖掘与应用
- 企业内部知识产杈教育培训体系的构建
- 从课堂到实践学生自主学习能力培养全解析
- 企业内部团队协作与客户关系管理的关系
- 不同领域企业家的家庭火灾应对指南
- 从功能到艺术-家居产品设计的发展方向
- 以实践为导向的孩子自信心培养方案探索
- 幼儿园大班语言课件:不怕冷的大衣
- 2024至2030年中国生物反应器行业市场调查研究及投资潜力预测报告
- DL∕T 448-2016 电能计量装置技术管理规程
- 幼儿园家长助教日主题班会《保护眼睛》适用于幼儿园家长助教模板
- 2024年六年级上册《综合实践活动》全册教案
- 小学生预防早婚早育主题班会
- 上海市虹口区2023-2024学年八年级下学期期末考试语文试题
- 废气治理设施运行管理规程
- W -S-T 433-2023 静脉治疗护理技术操作标准(正式版)
- JTS-131-2012水运工程测量规范
- 【经济学基础课程案例探析报告:“双十一”的经济学探析5100字】
评论
0/150
提交评论