Bo's Oracle Station

查看: 2466|回复: 0

课程第19次(2017-04-13星期四)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-4-14 09:32:29 | 显示全部楼层 |阅读模式
上完1Z0-053闪回1
1Z0-052共19章(上完10章),1Z0-053共21章(上完3章)和
1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的13章

http://124.16.180.178:8080/studentguide_sec_O11g/1Z0-053-10/

游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0


  1. select * from flashback_transaction_query   f
  2. where f.table_name='T_NOCASCADE_FORCE' and f.table_owner='HR'
  3. order by 4 desc;
  4.   
  5. begin
  6.    dbms_flashback.transaction_backout(1,xid_array('080013008B080000'),
  7.     options =>dbms_flashback.nocascade_force
  8.       );
  9. end;

  10. select  * from hr.t_nocascade_force;

  11. select  * from dba_flashback_txn_report;

  12. select  * from dba_flashback_txn_state;

  13. commit;

  14. ---

  15. select  * from hr.regions;

  16. ----

  17. select * from dba_flashback_archive;

  18. select * from dba_flashback_archive_tables;

  19. select  * from dba_flashback_archive_ts;

  20. create flashback archive fda1
  21. tablespace users quota 10M retention 1 year;

  22. create flashback archive   default fda2
  23. tablespace users quota 20M retention 2 year;

  24. alter flashback archive fda1 set default;

  25. grant flashback archive  on fda1 to hr;

  26. select  * from dba_objects o where o.owner='HR'
  27.   and o.object_name='EMPLOYEES';




  28. create undo tablespace undotbs1 datafile size 10M ;

  29. alter system set undo_tablespace=undotbs1;

  30. drop tablespace undotbs2;


  31. alter table hr.employees no flashback archive;
  32. alter system flush buffer_cache;
  33. ----

  34. create tablespace tbsfda datafile size 20M  ;

  35. alter flashback  archive fda1 add tablespace tbsfda quota 10M  ;

  36. ---
  37. alter flashback archive fda1 modify retention 5 year;

  38. alter flashback archive fda1 modify  tablespace tbsfda quota  15M;

  39. ---

  40. ALTER FLASHBACK ARCHIVE fda2
  41.   PURGE BEFORE
  42.    TIMESTAMP (SYSTIMESTAMP - INTERVAL '0 00:01:00' DAY TO SECOND);
  43.   
  44.   
  45. select   sysdate - INTERVAL '0 00:00:5' DAY TO SECOND, sysdate
  46.     from dual;

  47.   ---
  48.   
  49.   grant flashback archive on fda2 to hr;

  50. select  * from hr.SYS_FBA_HIST_73953;

  51. alter system flush buffer_cache;
  52. ----

  53. drop flashback archive fda2 ;
  54. ---

  55. create flashback archive fda3
  56. tablespace tbsfda  quota 15M  retention 10 day;

  57. select  * from dba_flashback_archive;

  58. select  * from dba_flashback_archive_tables;

  59. select  * from dba_flashback_archive_ts;

  60. create table hr.part1 ( a number , b varchar2(20))
  61. partition by range(a)
  62. (
  63.    partition p1 values less than  ( 100  ),
  64.    partition  p2 values less than (maxvalue ));
  65.    
  66.    insert into hr.part1 values (100,'AAA');
  67.    
  68.    commit;
  69.    
  70.       insert into hr.part1 values (49,'BBB');
  71.       
  72.       commit;
  73.       
  74.       select  * from hr.part1  partition (p2);
  75.       
  76.       select   to_char(sysdate,'YYYY-MM-DD:HH24:MI:SS')  from dual;
  77.       
  78.       grant flashback archive on fda3 to hr;
  79.       
  80.       alter table hr.part1 flashback archive fda3;
  81.       
  82.       update hr.part1 set a=101 where a=100;
  83.       commit;
  84.       
  85.       alter table  hr.part1 drop (b) ;
  86.       
  87.       select versions_xid , versions_startscn  , versions_operation , a
  88.        from hr.part1  
  89.        versions between  timestamp  sysdate-3/1440 and sysdate;
  90.       
  91.        select  * from hr.part1
  92.         as of scn 4199417;
  93.       
  94.        alter table hr.part1 enable row movement;
  95.       
  96.        flashback table hr.part1 to scn 4199417;
  97.       
  98.        alter table hr.part1 split partition p1  at (50)
  99.         into ( partition p1_1  , partition p1_2  );
  100.         
  101.         select  * from hr.SYS_FBA_HIST_76026;
  102.         
  103.         update hr.SYS_FBA_HIST_76026 set a=99 where a=100;
  104.         commit;
  105.       
  106.        begin
  107.            dbms_flashback_archive.disassociate_fba('HR','PART1');
  108.         end;
  109.         
  110.         begin
  111.            dbms_flashback_archive.reassociate_fba('HR','PART1');
  112.            end;
  113.            
  114.            select  * from dba_segments where segment_name='PART1';
  115.            
  116.            
  117.            select  * from hr.part1  partition (p2);
  118.            
  119.            



复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-22 10:09 , Processed in 0.034651 second(s), 24 queries .

快速回复 返回顶部 返回列表