
本文共 5532 字,大约阅读时间需要 18 分钟。
Oracle������������������������������������������������������������������DBA������������������������������������������������AUM������������������������������������������Oracle������������������������������
1.���������������������������
���Oracle 9i������������������������������������������������������������������������������������������������������������������������������������������������������������SCN���������������������������������������������������������������������������������������������������������������������������
2.������������������
���������������Oracle���������������������������������������������������������������������������������������������������������
- ������������������������������
ROLLBACK
������������Oracle��������������������������������������������������������������������� - ���������������������������������������������������������������������������������������������Oracle������������������������������������������������������������������������
- ���������������������������������������������������������������������������������������������������������������������������������������
3.������������������������������
Oracle���DELETE
���COMMIT
������������������������������������������������������������������������������
���������������������
- Oracle������������������������������������
- ���������������������������������
DELETE
��������������������� - ������������������������������������������������
- ������������������������������������
- ���������������������������������dirty���������������������������������������
���������������������
- Oracle���������������������������������SCN������
- ���������������������������������������������������������committed������
- ���������������������������������������������������������������������������
4.���������������������������
���������������������������������������������������������������������������
������������
- ���������������
UNDO_MANAGEMENT=AUTO
���UNDO_RETENTION= n
���n��������������������������������� - ������sysdba���������������������������������������������������������
conn sys/sys as sysdba create user flash identified by flash; grant connect, resource to flash; grant execute on dbms_flashback to flash;
������������
- ���������������������������
create table t_flash (test varchar2(10)); insert into t_flash values('google'); insert into t_flash values('KingXt');
- ������������������������������
delete t_flash where test = 'google'; commit;
- ���������������������
execute dbms_flashback.enable_at_time(to_date('2010-05-08 17:00:00','yyyy-mm-dd hh24:mi:ss')); execute dbms_flashback.disable;
������������
- ���������������������������������
cursor flash_recover is select * from t_flash; t_recode t_flash%rowtype; begin dbms_flashback.enable_at_time(to_date('2010-05-08 20:35:23','yyyy-mm-dd hh24:mi:ss')); open FLASH_RECOVER; dbms_flashback.disable; loop fetch FLASH_RECOVER into t_recode; exit when FLASH_RECOVER%notfound; insert into t_flash values (t_recode.test); end loop; close FLASH_RECOVER; commit; end;
5.������������������������
- ���5������������������SCN������������������������������������������������������������SCN���������������������
- ���������������������������������������_used_ ������������ ��������������������������������������������
UNDO_RETENTION
������������������������������
6.Flashback Database
Flashback Database���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
flashback database to time to_timestamp(xxx); flashback database to scn xxx;
7.Flashback Table
Flashback Table������������������������������������������������������������������������������������������������������������������
������������������������
flashback table test to timestamp to_timestamp('2010-05-08 17:00:00','yyyy-mm-dd hh24:mi:ss');
������������������
flashback table test to timestamp to_timestamp('2010-05-08 17:00:00','yyyy-mm-dd hh24:mi:ss');
### 8.Flashback Drop Flashback Drop���������������������������������������������������������������������������������������������������1. **���������������������**��� ```sqlshow recyclebin;
������������������������������������
drop table test_drop; show recyclebin;
������������������������
flashback table test_drop to before drop;
���������������������
select versions_starttime, versions_operation, test from t_flash versions between minvalue and maxvalue order by versions_starttime;
���������������������������������
select test from t_flash versions between timestamp to_date('2010-05-07 15:30:00', 'yyyy-mm-dd hh24:mi:ss') and to_date('2010-05-07 16:30:00', 'yyyy-mm-dd hh24:mi:ss');
������������ID���
delete from test where id=2; commit; select xid from v$transaction; XID ---------------- 04001200AE010000
���������������
select * from FLASHBACK_TRANSACTION_QUERY where xid='04001F0035000000';
���������������
������������������������ID���������������������������������
9.Flashback Version Query
Flashback Version Query���������������������������������������������������������������������������������������������
10.Flashback Transaction Query
Flashback Transaction Query���������������������������������������������������������������������������
������
Oracle������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
