flashback 英[?fl??b?k] 美[?fl???b?k] n. 闪回,倒叙; 药效幻觉重现; [例句]There is even a flashback to the murder itself. 甚至有一段关于谋杀本身的闪回。 [其他] 复数:flashbacks
7,flashback是什么意思啊
百度翻译结果flashback 英[?fl??b?k] 美[?fl???b?k] n. 闪回,倒叙; 药效幻觉重现; [网络] 娜娜; 闪回技术; 回闪; [例句]There is even a flashback to the murder itself.甚至有一段关于谋杀本身的闪回。[其他] 复数:flashbacks 双语例句 柯林斯词典 英英释义 百度百科相关单词:Flashback [词典] [电影]细说从头
8,oracle的flashback怎么用
flashback database要求数据库必须处于归档模式,且闪回之后必须使用resetlogs打开数据库 查看数据库的归档模式及闪回是否启用 SQL> select log_mode,open_mode,flashback_on from v$database; LOG_MODE OPEN_MODE FLASHBACK_ON ------------ --...by jdstkxx on 2012 年 4 月 17 日/*11g的flashbackup 分好几种,分别用途不一样。a.flashback database 闪回数据库,简单理解就是把数据库闪回到某个以前的时间点,能恢复到的最早的scn, 取决与flashback log中记录的最早scnb.flashback drop 回收数据库表,用于表误drop后恢复。类似windows的回收站。c.flashback query 闪回表记录,用于数据表记录的恢复d.falshabck table 闪回数据库表,后两个是重点,下面说明。*/– a.flashback database相关/*1.默认情况数据库的flashback database是关闭,可以在mount exclusive状态下打开。在设置了闪回恢复区后,可以启动闪回数据库功能。*/–1.检查是否启动了flash recovery areashow parameter db_recovery_file–2.检查是否启用了归档archive log list;–3.flashback database 默认是关闭的,查看方法select flashback_on from v$database;–4.查询当前的scnselect current_scn from v$database;–5.查询当前的时间select to_char(sysdate,yy-mm-dd hh24:mi:ss) time from dual;–6.查看scn 和 timestamp 之间的对应关系:select scn,to_char(time_dp,yyyy-mm-dd hh24:mi:ss)from sys.smon_scn_time;–7.恢复到时间点,或者恢复到scnflashback database to timestamp to_timestamp(09-10-14 14:37:05′,yy-mm-dd hh24:mi:ss);flashback database to scn 947921;– b. flashback table 恢复误drop表drop table sphsy.login_table;select * from flash_table;–purge table sphsy.login_table;清空回收站flashback table sphsy.login_table to before drop;select * from sphsy.login_table;– c. flashback query 实现行级恢复/*flashback查询用于获取先前时间点的表行级数据。当使用flashback查询时,需要在表名后指定as of timestamp子句或as of scn子句,其中as of timestamp用于指定早期时间点,而as of scn用于指定早期的scn值,示例如下:*/– 1.查原始记录 ,区间内有62 行select *from sphsy.login_table awhere a.id > 201204171078and a.id < 201204171141order by a.id ;– 2.晚于区间的有 3016select program,count(*)from sphsy.login_table awhere a.id >= 201204171141group by program ;–3. 删除delete from sphsy.login_table awhere a.id > 201204171078and a.id < 201204171141–4.利用闪回特性查到区间内,有62行select * from sphsy.login_tableas of timestamp to_timestamp(2012-04-17 17:20:30′,yyyy-mm-dd hh24:mi:ss)where id > 201204171078and id < 201204171141– 5.不利用闪回特性,直接查询发现没有select * from sphsy.login_tablewhere id > 201204171078and id < 201204171141– 6.进行数据恢复– 禁止表上的触发器alter trigger sphsy.t_ins_login_table disable ;– 恢复数据insert into sphsy.login_tableselect * from sphsy.login_tableas of timestamp to_timestamp(2012-04-17 17:20:30′,yyyy-mm-dd hh24:mi:ss)where id > 201204171078and id < 201204171141– 恢复触发器alter trigger sphsy.t_ins_login_table enable ;– 7.晚于区间的数据回来了3130 = 3016 +62 + 后来的数据。实现了区间恢复误删除。select program,count(*)from sphsy.login_table awhere a.id >= 201204171078group by program ;– d. flashback table 恢复表到先前状态/*flashback查询可以用于恢复被误删除的表行数据,但是用户在表上执行了其他的dml语句误操作(insert或update),则不能直接使用flashback查询将表数据恢复到先前时间点,从oracle10g开始,使用flashback table语句可以将表恢复到先前时间点,通过使用该特征,可以避免执行基于时间点的不完全恢复,注意如果要在某个表上使用flashback table特征,则要求必须具有以下条件:a.用户必须具有flashback any table系统权限或flashback对象权限b.用户必修在表上具有select insert delete和alter权限c.必须合理设置初始化参数undo_retention,以确保undo信息保留足够时间d.必须激活行移动特征:alter table table_name enable row movement;*/– 1.查原始记录 ,区间内有62 行select *from sphsy.login_table awhere a.id > 201204171078and a.id < 201204171141order by a.id ;– 2.晚于区间的有 3074select count(*)from sphsy.login_table awhere a.id >= 201204171141;–3. 删除 ,先记下时间点,2012-04-17 17:43:46select to_char(sysdate,yyyy-mm-dd hh24:mi:ss) from dual ;delete from sphsy.login_table awhere a.id > 201204171078and a.id < 201204171141– 4.删除之后表 sphysy.login_table继续有修改 ,行3082select count(*)from sphsy.login_table awhere a.id >= 201204171141;–5.激活行移动特征alter table sphsy.login_table enable row movement–6.利用闪回特性,直接恢复到删除时间点前flashback table sphsy.login_table to timestamp to_timestamp(2012-04-17 17:43:46′,yyyy-mm-dd hh24:mi:ss);– 7.晚于区间的数据 回到了3080 ,说明时间点之后的修改丢失。select count(*)from sphsy.login_table awhere a.id >= 201204171141– 8.往前推1分,恢复到删除之前,删除的62条也回来了。flashback table sphsy.login_table to timestamp to_timestamp(2012-04-17 17:40:46′,yyyy-mm-dd hh24:mi:ss);– 62 行select count(*)from sphsy.login_table awhere a.id > 201204171078and a.id < 201204171141– 删除之后的数据为3074,代表还有修改丢失。select count(*)from sphsy.login_table awhere a.id >= 201204171141/*总结:方法c,方法d均可以用数据恢复。方法c安全,恢复麻烦。方法d简单,有可能数据丢失。*/