Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107592
  • 博文数量: 38
  • 博客积分: 506
  • 博客等级: 下士
  • 技术积分: 405
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 10:46
文章分类
文章存档

2014年(6)

2013年(10)

2012年(22)

我的朋友

分类: Oracle

2012-10-26 14:09:46

Prerequisites

To flash back a table to an earlier SCN or timestamp, you must have either the FLASHBACK object privilege on the table or the FLASHBACK ANY TABLE system privilege. In addition, you must have the SELECT, INSERT, DELETE, and ALTER object privileges on the table.

Row movement must be enabled for all tables in the Flashback list unless you are flashing back the table TO BEFORE DROP. That operation is called a flashback drop operation, and it uses dropped data in the recyclebin rather than undo data. Please refer to for information on enabling row movement.

To flash back a table to a restore point, you must have the SELECT ANY DICTIONARY or FLASHBACK ANY TABLE system privilege or the SELECT_CATALOG_ROLE role.

To flash back a table to before a DROP TABLE operation, you need only the privileges necessary to drop the table.

例:
 
flashback table t1 to timestamp to_timestamp('2012-09-21 05:06:26','YYYY-MM-DD HH24:MI:SS');
 
TO_TIMESTAMP converts char of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype to a value of TIMESTAMP datatype.
 

Examples

The following example converts a character string to a timestamp. The character string is not in the default TIMESTAMP format, so the format mask must be specified:

SELECT TO_TIMESTAMP ('10-Sep-02 14:10:10.123000', 'DD-Mon-RR HH24:MI:SS.FF') FROM DUAL; TO_TIMESTAMP('10-SEP-0214:10:10.123000','DD-MON-RRHH24:MI:SS.FF') --------------------------------------------------------------------------- 10-SEP-02 02.10.10.123000000 PM
 
闪回查询
select * from t1 as of timestamp to_timestamp('2012-09-21 05:08:26','YYYY-MM-DD HH24:MI:SS');
阅读(938) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~