|
本帖最后由 botang 于 2014-11-27 10:13 编辑
2014-11-01-A.txt
- select * from v$flashback_database_stat;
- select * from v$fixed_table where name like '%USAGE%';
- select * from V$FLASH_RECOVERY_AREA_USAGE;
- select * from v$restore_point;
- create restore point rsp1 ;
- select * from v$restore_point;
- select flashback_on from v$database;
- select * from v$flashback_database_log;
- create restore point rsp2 guarantee flashback database;
- select * from v$restore_point;
- select * from v$flashback_database_logfile;
复制代码
2014-11-01-B.txt
2014-11-01-C.txt
- alter database add supplemental log data;
- alter database add supplemental log data (primary key) columns;
- alter database add supplemental log data (foreign key) columns;
- alter database drop supplemental log data (foreign key) columns;
- select xid,dependent_xid,backout_mode from dba_flashback_txn_state;
- select * from dba_flashback_txn_report;
- select * from flashback_transaction_query where table_name = 'T5' order by start_scn desc;
- select distinct xid,start_scn
- from flashback_transaction_query
- where table_owner='HR' and
- table_name='EMPLOYEES' and
- start_timestamp > systimestamp - interval '15' minute
- order by start_scn;
- select * from flashback_transaction_query where start_Scn=1138443;
- declare
- xids sys.xid_array;
- begin
- xids := sys.xid_array('080001002E030000');
- dbms_flashback.transaction_backout(1,xids,options=>dbms_flashback.cascade);
- end;
-
- select xid,dependent_xid,backout_mode from dba_flashback_txn_state;
复制代码
2014-11-01-D.txt
- select * from flashback_transaction_query where table_name = 'T10' order by start_scn desc;
- --0200010044030000
- declare
- xids sys.xid_array;
- begin
- xids := sys.xid_array('0200010044030000');
- dbms_flashback.transaction_backout(1,xids,options=>dbms_flashback.cascade);
- end;
-
- select * from flashback_transaction_query where table_name = 'T11' order by start_scn desc;
- --0100070083020000
- declare
- xids sys.xid_array;
- begin
- xids := sys.xid_array('0800070031030000');
- dbms_flashback.transaction_backout(1,xids,options=>dbms_flashback.nocascade_force);
- end;
-
- select * from flashback_transaction_query where table_name = 'T12' order by start_scn desc;
- --0800070031030000
- declare
- xids sys.xid_array;
- begin
- xids := sys.xid_array('0800070031030000');
- dbms_flashback.transaction_backout(1,xids,options=>dbms_flashback.nonconflict_only);
- end;
复制代码
2014-11-01-E.txt- create tablespace tbsfda_2 datafile size 30M ;
- alter flashback archive fda1 add tablespace tbsfda_2 quota 10G;
- alter flashback archive fda1 modify retention 5 year;
- create flashback archive fda1
- tablespace tbsfda quota 10G retention 1 year;
-
- select * from dict where table_name like '%FLASHBACK%';
-
- select * from DBA_FLASHBACK_ARCHIVE;
-
- select * from DBA_FLASHBACK_ARCHIVE_TABLES;
-
- select * from DBA_FLASHBACK_ARCHIVE_TS;
-
- alter flashback archive fda1 set default;
-
- create flashback archive fda2
- tablespace tbsfda quota 10G retention 2 year;
-
-
- select * from DBA_FLASHBACK_ARCHIVE;
-
- select * from DBA_FLASHBACK_ARCHIVE_TABLES;
-
- select * from DBA_FLASHBACK_ARCHIVE_TS;
-
-
- grant flashback archive on fda1 to hr;
-
- grant flashback archive on fda2 to hr;
-
- alter flashback archive fda1 purge before timestamp systimestamp;
-
- drop flashback archive fda1;
复制代码
2014-11-01-F.sql
- select * from dba_flashback_archive;
- select * from dba_flashback_archive_tables;
- select * from dba_flashback_archive_ts;
- select * from hr.SYS_FBA_HIST_74620;
- select * from hr.SYS_FBA_HIST_74620;
- select * from dba_tables t where t.tablespace_name='TBSFDA';
- begin
- dbms_flashback_archive.disassociate_fba('HR','FDA3');
- end;
-
- select * from hr.SYS_FBA_HIST_74642;
-
- update hr.SYS_FBA_HIST_74642 set a=4;
-
- commit;
- begin
- dbms_flashback_archive.reassociate_fba('HR','FDA3');
-
- end;
复制代码
2014-11-01-G.sql
- SELECT s.sid, p.spid, s.client_info
- FROM v$process p, v$session s
- WHERE p.addr = s.paddr
- AND CLIENT_INFO LIKE '%AAA%';
- select * from v_$session_longops l where l.SID=200;
复制代码
t05310.sql
- undefine s1
- create table &s1( id number ) ;
- ! sleep 5
- insert into &&s1 values (1) ;
- insert into &&s1 values (2) ;
- insert into &&s1 values (3) ;
- commit;
- update &&s1 set id=11 where id=1;
- update &&s1 set id=22 where id=2;
- update &&s1 set id=33 where id=3;
- commit;
- update &&s1 set id=222 where id=22;
- update &&s1 set id=333 where id=33;
- commit;
- update &&s1 set id=22 where id=222;
- commit;
复制代码
|
|