设为首页收藏本站

Botang唐波's Oracle Station

查看: 327|回复: 6

课程第9次(2018-06-05星期二)

[复制链接]

730

主题

1100

帖子

7995

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7995
发表于 2018-6-5 19:35:14 | 显示全部楼层 |阅读模式
1. 闪回单点查询(9i就能做的闪回,闪回技术2,因为有undo所以能够见到提交以前的样子):
  1. SQL> conn hr/oracle_4U
  2. Connected.
  3. SQL> select  salary from employees where employee_id=100;

  4.     SALARY
  5. ----------
  6.      24000

  7. SQL> update employees set salary=25000  where employee_id=100;

  8. 1 row updated.

  9. SQL> commit;

  10. Commit complete.

  11. SQL> select  salary from employees where employee_id=100;

  12.     SALARY
  13. ----------
  14.      25000


  15. SQL> select  salary from employees as of timestamp systimestamp-1/1440       where employee_id=100;

  16.     SALARY
  17. ----------
  18.      24000

  19. SQL>
复制代码

2. 闪回技术1(10g, FLASHBACK_TRANSACTION_QUERY,是所有闪回的原理,查询它就是以Oracle的语言来查看整个UNDO表空间):

Screenshot.png


3. 闪回技术4 (闪回表):
  1. SQL> flashback table employees to scn 1165416;
  2. flashback table employees to scn 1165416
  3.                 *
  4. ERROR at line 1:
  5. ORA-08189: cannot flashback the table because row movement is not enabled
复制代码
  1. SQL> alter table employees enable row movement;

  2. Table altered.

  3. SQL> flashback table employees to scn 1165416;

  4. Flashback complete.

  5. SQL> alter table employees disable row movement;

  6. Table altered.

  7. SQL> select  salary from employees where employee_id=100;

  8.     SALARY
  9. ----------
  10.      24000

  11. SQL>
复制代码

证明它是一个事务,而且还是删除再添加:

  1. select  * from Flashback_Transaction_Query  ftq
  2. where ftq.logon_user='HR' and ftq.table_name='EMPLOYEES'
  3. order by ftq.commit_timestamp;
复制代码

4. 闪回技术3(闪回版本查询,把 Flashback_Transaction_Query 的信息映射到自己的表(employees)的查询技术):
  1. SQL> select versions_xid, versions_startscn, versions_operation, salary from employees
  2.   2  versions between scn minvalue and maxvalue
  3.   3  where employee_id=100;

  4. VERSIONS_XID         VERSIONS_STARTSCN V         SALARY
  5. ---------------- ----------------- - ----------
  6. 05001400BB030000           1170658 I          24000
  7. 05001400BB030000           1170658 D          25000
  8.                                           25000
复制代码

Screenshot-1.png

versions_startscn就是flashback_transaction_query中的提交的时间。在EM上看同样versions查询,startscn被图形界面-1:
firefox.png

  1. oracle@station87 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 6 04:18:23 2018

  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  4. SQL> conn hr/oracle_4U
  5. Connected.
  6. SQL> select salary from employees where employee_id=100;

  7.     SALARY
  8. ----------
  9.      24000

  10. SQL> update employees set salary=30000 where employee_id=100;

  11. 1 row updated.

  12. SQL> commit;

  13. Commit complete.

  14. SQL> update employees set salary=40000 where employee_id=100;

  15. 1 row updated.

  16. SQL> commit;

  17. Commit complete.

  18. SQL> update employees set salary=50000 where employee_id=100;

  19. 1 row updated.

  20. SQL> commit;

  21. Commit complete.

  22. SQL>  select versions_xid, versions_startscn, versions_operation, salary from employees
  23.   2   versions between scn minvalue and maxvalue
  24.   3  where employee_id=100  order by versions_startscn;

  25. VERSIONS_XID         VERSIONS_STARTSCN V         SALARY
  26. ---------------- ----------------- - ----------
  27. 05001400BB030000           1170658 D          25000
  28. 05001400BB030000           1170658 I          24000
  29. 06001600A0030000           1172047 U          30000
  30. 02000E008D030000           1172182 U          40000
  31. 09000400C1030000           1172237 U          50000
  32.                                           25000

  33. 6 rows selected.

  34. SQL> /

  35. VERSIONS_XID         VERSIONS_STARTSCN V         SALARY
  36. ---------------- ----------------- - ----------
  37. 05001400BB030000           1170658 D          25000
  38. 05001400BB030000           1170658 I          24000
  39. 06001600A0030000           1172047 U          30000
  40. 02000E008D030000           1172182 U          40000
  41. 09000400C1030000           1172237 U          50000
  42. 09001600C7030000           1178141 D          50000
  43. 09001600C7030000           1178141 I          30000
  44.                                           25000

  45. 8 rows selected.

  46. SQL> select  salary from employees where employee_id=100;

  47.     SALARY
  48. ----------
  49.      30000

  50. SQL> clear
  51. SQL>
  52. SQL>
  53. SQL>
  54. SQL>
  55. SQL>
  56. SQL>
  57. SQL> !clear


  58. SQL> create table t05310_a( a number ) ;

  59. Table created.

  60. SQL> insert into t05310_a values (1) ;

  61. 1 row created.

  62. SQL> commit;

  63. Commit complete.

  64. SQL> update t05310_a set a=2 ;

  65. 1 row updated.

  66. SQL> commit;

  67. Commit complete.

  68. SQL> select versions_xid, versions_startscn, versions_operation,a from  t05210_a
  69.   2  

  70. SQL>
  71. SQL>
  72. SQL>
  73. SQL> select versions_xid, versions_startscn, versions_operation,a from  t05310_a
  74.   2  versions between scn minvalue and maxvalue;

  75. VERSIONS_XID         VERSIONS_STARTSCN V              A
  76. ---------------- ----------------- - ----------
  77. 03000D00C6030000           1179717 U              2
  78. 0200140096030000           1179700 I              1

  79. SQL> select  a from t05310_a as of scn 1179700 ;

  80.          A
  81. ----------
  82.          1

  83. SQL> alter table t05310_a add ( b varchar2(20)) ;

  84. Table altered.

  85. SQL> update t05310_a set a=3,b='C' ;

  86. 1 row updated.

  87. SQL> commit;

  88. Commit complete.

  89. SQL> select  * from t05310_a;

  90.          A B
  91. ---------- --------------------
  92.          3 C

  93. SQL> select versions_xid, versions_startscn, versions_operation,a from  t05310_a
  94.   2  versions between scn minvalue and maxvalue;

  95. VERSIONS_XID         VERSIONS_STARTSCN V              A
  96. ---------------- ----------------- - ----------
  97. 09001D00CA030000           1180048 U              3
  98. 03000D00C6030000           1179717 U              2
  99. 0200140096030000           1179700 I              1

  100. SQL> select versions_xid, versions_startscn, versions_operation,a,b from  t05310_a
  101.   2  versions between scn minvalue and maxvalue;

  102. VERSIONS_XID         VERSIONS_STARTSCN V              A B
  103. ---------------- ----------------- - ---------- --------------------
  104. 09001D00CA030000           1180048 U              3 C
  105. 03000D00C6030000           1179717 U              2
  106. 0200140096030000           1179700 I              1

  107. SQL> select  a from t05310_a as of scn 1179700 ;

  108.          A
  109. ----------
  110.          1

  111. SQL> alter table t05310_a enable row movement;

  112. Table altered.

  113. SQL> flashback table t05310_a to scn 1179700;

  114. Flashback complete.

  115. SQL> select  a from t05310_a ;

  116.          A
  117. ----------
  118.          1

  119. SQL> select versions_xid, versions_startscn, versions_operation,a,b from  t05310_a
  120.   2  versions between scn minvalue and maxvalue;versions between scn minvalue and maxvalue;
  121. versions between scn minvalue and maxvalue;versions between scn minvalue and maxvalue
  122.                                           *
  123. ERROR at line 2:
  124. ORA-00911: invalid character


  125. SQL> select versions_xid, versions_startscn, versions_operation,a,b from  t05310_a         
  126.   2  versions between scn minvalue and maxvalue;                              

  127. VERSIONS_XID         VERSIONS_STARTSCN V              A B
  128. ---------------- ----------------- - ---------- --------------------
  129. 01000D00DA020000           1180198 I              1
  130. 01000D00DA020000           1180198 D              3 C
  131. 09001D00CA030000           1180048 U              3 C
  132. 03000D00C6030000           1179717 U              2
  133. 0200140096030000           1179700 I              1

  134. SQL> select  a from t05310_a as of scn 1180198 ;

  135.          A
  136. ----------
  137.          1

  138. SQL> update t05310_a set a=4 ;

  139. 1 row updated.

  140. SQL> COMMIT;

  141. Commit complete.

  142. SQL> select  * from t05310_a;

  143.          A B
  144. ---------- --------------------
  145.          4

  146. SQL> select versions_xid, versions_startscn, versions_operation,a,b from  t05310_a
  147.   2   versions between scn minvalue and maxvalue;

  148. VERSIONS_XID         VERSIONS_STARTSCN V              A B
  149. ---------------- ----------------- - ---------- --------------------
  150. 06002100AB030000           1180318 U              4
  151. 01000D00DA020000           1180198 I              1
  152. 01000D00DA020000           1180198 D              3 C
  153. 09001D00CA030000           1180048 U              3 C
  154. 03000D00C6030000           1179717 U              2
  155. 0200140096030000           1179700 I              1

  156. 6 rows selected.

  157. SQL> select  a from t05310_a as of scn 1180198 ;

  158.          A
  159. ----------
  160.          1

  161. SQL> alter table t05310_a drop ( b) ;

  162. Table altered.

  163. SQL> select  a from t05310_a as of scn 1180198 ;
  164. select        a from t05310_a as of scn 1180198
  165.                *
  166. ERROR at line 1:
  167. ORA-01466: unable to read data - table definition has changed


  168. SQL>
复制代码

5. 闪回技术8:闪回事务

  1. undefine s1
  2. create table &&s1( id number ) ;
  3. ! sleep 5
  4. insert into &&s1 values (1) ;
  5. insert into &&s1 values (2) ;
  6. insert into &&s1 values (3) ;
  7. commit;
  8. update &&s1 set id=11 where id=1;
  9. update &&s1 set id=22 where id=2;
  10. update &&s1 set id=33 where id=3;
  11. commit;
  12. update &&s1 set id=222 where id=22;
  13. update &&s1 set id=333 where id=33;
  14. commit;
  15. update &&s1 set id=22 where id=222;
  16. commit;
复制代码
  1. select  d.SUPPLEMENTAL_LOG_DATA_MIN,
  2.           d.SUPPLEMENTAL_LOG_DATA_PK,
  3.           d.SUPPLEMENTAL_LOG_DATA_FK
  4. from v_$database  d;

  5. alter database add supplemental log data;

  6. alter database add supplemental log data (primary key) columns;
复制代码

Screenshot-2.png

----------------------------------------------------------------------------
T_NOCASCADE:
  1. select  * from flashback_transaction_query ftq
  2. where ftq.logon_user='HR' and ftq.table_name='T_NOCASCADE'
  3. order by commit_Scn;

  4. begin
  5.     dbms_flashback.transaction_backout(numtxns => 1,
  6.     xids => xid_array('03000600D6030000'),
  7.     options => dbms_flashback.nocascade);
  8.   end;
复制代码

Screenshot-Error.png

  1. SQL> select * from t_nocascade;

  2.         ID
  3. ----------
  4.         11
  5.         22
  6.        333
复制代码

T_CASCADE:

  1.     select  * from flashback_transaction_query ftq
  2.     where ftq.logon_user='HR' and ftq.table_name='T_CASCADE'
  3.     order by commit_Scn;

  4.     begin
  5.         dbms_flashback.transaction_backout(numtxns => 1,
  6.         xids => xid_array('0A000D002F030000'),
  7.         options => dbms_flashback.cascade);
  8.       end;
  9.       
  10.       select  * from dba_flashback_txn_report;
  11.       
  12.       commit;
复制代码
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <COMP_XID_REPORT XID="04001B0021030000">
  3.         <TRANSACTION XID="0A000D002F030000">
  4.         <CHARACTERISTICS>
  5.         </CHARACTERISTICS>
  6.         <UNDO_SQL>
  7.                 <USQL exec="yes">
  8.                  update "HR"."T_CASCADE" set "ID" = '3' where "ID" = '33' and ROWID = 'AAATGVAAEAAAAI9AAC'
  9.                 </USQL>
  10.                 <USQL exec="yes">
  11.                  update "HR"."T_CASCADE" set "ID" = '2' where "ID" = '22' and ROWID = 'AAATGVAAEAAAAI9AAB'
  12.                 </USQL>
  13.                 <USQL exec="yes">
  14.                  update "HR"."T_CASCADE" set "ID" = '1' where "ID" = '11' and ROWID = 'AAATGVAAEAAAAI9AAA'
  15.                 </USQL>
  16.         </UNDO_SQL>
  17.         <DEPENDENT_XIDS>
  18.                 <TRANSACTION XID="0400160020030000">
  19.                 <CHARACTERISTICS>
  20.                 </CHARACTERISTICS>
  21.                 <UNDO_SQL>
  22.                         <USQL exec="yes">
  23.                          update "HR"."T_CASCADE" set "ID" = '33' where "ID" = '333' and ROWID = 'AAATGVAAEAAAAI9AAC'
  24.                         </USQL>
  25.                         <USQL exec="yes">
  26.                          update "HR"."T_CASCADE" set "ID" = '22' where "ID" = '222' and ROWID = 'AAATGVAAEAAAAI9AAB'
  27.                         </USQL>
  28.                 </UNDO_SQL>
  29.                 <DEPENDENT_XIDS>
  30.                         <TRANSACTION XID="01001E00E9020000">
  31.                         <CHARACTERISTICS>
  32.                         </CHARACTERISTICS>
  33.                         <UNDO_SQL>
  34.                                 <USQL exec="yes">
  35.                                  update "HR"."T_CASCADE" set "ID" = '222' where "ID" = '22' and ROWID = 'AAATGVAAEAAAAI9AAB'
  36.                                 </USQL>
  37.                         </UNDO_SQL>
  38.                         <DEPENDENT_XIDS>
  39.                         </DEPENDENT_XIDS>
  40.                         </TRANSACTION>
  41.                 </DEPENDENT_XIDS>
  42.                 </TRANSACTION>
  43.         </DEPENDENT_XIDS>
  44.         </TRANSACTION>
  45. <EXECUTED_UNDO_SQL>
  46. <EXEC_USQL>update "HR"."T_CASCADE" set "ID" = '222' where "ID" = '22' and ROWID = 'AAATGVAAEAAAAI9AAB'
  47. </EXEC_USQL>
  48. <EXEC_USQL>update "HR"."T_CASCADE" set "ID" = '33' where "ID" = '333' and ROWID = 'AAATGVAAEAAAAI9AAC'
  49. </EXEC_USQL>
  50. <EXEC_USQL>update "HR"."T_CASCADE" set "ID" = '22' where "ID" = '222' and ROWID = 'AAATGVAAEAAAAI9AAB'
  51. </EXEC_USQL>
  52. <EXEC_USQL>update "HR"."T_CASCADE" set "ID" = '3' where "ID" = '33' and ROWID = 'AAATGVAAEAAAAI9AAC'
  53. </EXEC_USQL>
  54. <EXEC_USQL>update "HR"."T_CASCADE" set "ID" = '2' where "ID" = '22' and ROWID = 'AAATGVAAEAAAAI9AAB'
  55. </EXEC_USQL>
  56. <EXEC_USQL>update "HR"."T_CASCADE" set "ID" = '1' where "ID" = '11' and ROWID = 'AAATGVAAEAAAAI9AAA'
  57. </EXEC_USQL>
  58. </EXECUTED_UNDO_SQL>
  59. </COMP_XID_REPORT>
复制代码
  1. SQL> select * from t_cascade;

  2.         ID
  3. ----------
  4.          1
  5.          2
  6.          3
复制代码

----------------------------------------------------

T_NONCONFLICT_ONLY:

  1. select * from flashback_transaction_query ftq
  2. where ftq.logon_user='HR' and ftq.table_name='T_NONCONFLICT_ONLY'
  3. order by commit_Scn;

  4. begin
  5. dbms_flashback.transaction_backout(numtxns => 1,
  6. xids => xid_array('070015002A030000'),
  7. options => dbms_flashback.nonconflict_only);
  8. end;

  9. select * from dba_flashback_txn_report;

  10. commit;
复制代码

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <COMP_XID_REPORT XID="0800040094040000" NAME="_SYS_COMP_TXN_458772_TIM_1528234613">
  3.         <TRANSACTION XID="070015002A030000">
  4.         <CHARACTERISTICS>
  5.         </CHARACTERISTICS>
  6.         <UNDO_SQL>
  7.                 <USQL exec="no">
  8.                  update "HR"."T_NONCONFLICT_ONLY" set "ID" = '3' where "ID" = '33' and ROWID = 'AAATGWAAEAAAAJFAAC'
  9.                 </USQL>
  10.                 <USQL exec="no">
  11.                  update "HR"."T_NONCONFLICT_ONLY" set "ID" = '2' where "ID" = '22' and ROWID = 'AAATGWAAEAAAAJFAAB'
  12.                 </USQL>
  13.                 <USQL exec="yes">
  14.                  update "HR"."T_NONCONFLICT_ONLY" set "ID" = '1' where "ID" = '11' and ROWID = 'AAATGWAAEAAAAJFAAA'
  15.                 </USQL>
  16.         </UNDO_SQL>
  17.         <DEPENDENT_XIDS>
  18.                 <TRANSACTION XID="0800030094040000">
  19.                 <CHARACTERISTICS>
  20.                 </CHARACTERISTICS>
  21.                 <UNDO_SQL>
  22.                         <USQL exec="no">
  23.                          update "HR"."T_NONCONFLICT_ONLY" set "ID" = '33' where "ID" = '333' and ROWID = 'AAATGWAAEAAAAJFAAC'
  24.                         </USQL>
  25.                         <USQL exec="no">
  26.                          update "HR"."T_NONCONFLICT_ONLY" set "ID" = '22' where "ID" = '222' and ROWID = 'AAATGWAAEAAAAJFAAB'
  27.                         </USQL>
  28.                 </UNDO_SQL>
  29.                 <DEPENDENT_XIDS>
  30.                         <TRANSACTION XID="03001000D9030000">
  31.                         <CHARACTERISTICS>
  32.                         </CHARACTERISTICS>
  33.                         <UNDO_SQL>
  34.                                 <USQL exec="no">
  35.                                  update "HR"."T_NONCONFLICT_ONLY" set "ID" = '222' where "ID" = '22' and ROWID = 'AAATGWAAEAAAAJFAAB'
  36.                                 </USQL>
  37.                         </UNDO_SQL>
  38.                         <DEPENDENT_XIDS>
  39.                         </DEPENDENT_XIDS>
  40.                         </TRANSACTION>
  41.                 </DEPENDENT_XIDS>
  42.                 </TRANSACTION>
  43.         </DEPENDENT_XIDS>
  44.         </TRANSACTION>
  45. <EXECUTED_UNDO_SQL>
  46. <EXEC_USQL>update "HR"."T_NONCONFLICT_ONLY" set "ID" = '1' where "ID" = '11' and ROWID = 'AAATGWAAEAAAAJFAAA'
  47. </EXEC_USQL>
  48. </EXECUTED_UNDO_SQL>
  49. </COMP_XID_REPORT>
复制代码
  1. SQL> select  * from t_nonconflict_only;

  2.         ID
  3. ----------
  4.          1
  5.         22
  6.        333
复制代码

----------------------------------------------
t_nocascade_force:

  1. select * from flashback_transaction_query ftq
  2. where ftq.logon_user='HR' and ftq.table_name='T_NOCASCADE_FORCE'
  3. order by commit_Scn;

  4. begin
  5. dbms_flashback.transaction_backout(numtxns => 1,
  6. xids => xid_array('09000800E2030000'),
  7. options => dbms_flashback.nocascade_force);
  8. end;

  9. select * from dba_flashback_txn_report;

  10. commit;
复制代码
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <COMP_XID_REPORT XID="02001500AF030000" NAME="_SYS_COMP_TXN_458772_TIM_1528235102">
  3.         <TRANSACTION XID="09000800E2030000">
  4.         <CHARACTERISTICS>
  5.         </CHARACTERISTICS>
  6.         <UNDO_SQL>
  7.                 <USQL exec="yes">
  8.                  update "HR"."T_NOCASCADE_FORCE" set "ID" = '3' where "ID" = '33' and ROWID = 'AAATGXAAEAAAAJNAAC'
  9.                 </USQL>
  10.                 <USQL exec="yes">
  11.                  update "HR"."T_NOCASCADE_FORCE" set "ID" = '2' where "ID" = '22' and ROWID = 'AAATGXAAEAAAAJNAAB'
  12.                 </USQL>
  13.                 <USQL exec="yes">
  14.                  update "HR"."T_NOCASCADE_FORCE" set "ID" = '1' where "ID" = '11' and ROWID = 'AAATGXAAEAAAAJNAAA'
  15.                 </USQL>
  16.         </UNDO_SQL>
  17.         <DEPENDENT_XIDS>
  18.                 <TRANSACTION XID="0400150025030000">
  19.                 <CHARACTERISTICS>
  20.                 </CHARACTERISTICS>
  21.                 <UNDO_SQL>
  22.                         <USQL exec="no">
  23.                          update "HR"."T_NOCASCADE_FORCE" set "ID" = '33' where "ID" = '333' and ROWID = 'AAATGXAAEAAAAJNAAC'
  24.                         </USQL>
  25.                         <USQL exec="no">
  26.                          update "HR"."T_NOCASCADE_FORCE" set "ID" = '22' where "ID" = '222' and ROWID = 'AAATGXAAEAAAAJNAAB'
  27.                         </USQL>
  28.                 </UNDO_SQL>
  29.                 <DEPENDENT_XIDS>
  30.                         <TRANSACTION XID="03001A00DF030000">
  31.                         <CHARACTERISTICS>
  32.                         </CHARACTERISTICS>
  33.                         <UNDO_SQL>
  34.                                 <USQL exec="no">
  35.                                  update "HR"."T_NOCASCADE_FORCE" set "ID" = '222' where "ID" = '22' and ROWID = 'AAATGXAAEAAAAJNAAB'
  36.                                 </USQL>
  37.                         </UNDO_SQL>
  38.                         <DEPENDENT_XIDS>
  39.                         </DEPENDENT_XIDS>
  40.                         </TRANSACTION>
  41.                 </DEPENDENT_XIDS>
  42.                 </TRANSACTION>
  43.         </DEPENDENT_XIDS>
  44.         </TRANSACTION>
  45. <EXECUTED_UNDO_SQL>
  46. <EXEC_USQL>update "HR"."T_NOCASCADE_FORCE" set "ID" = '3' where "ID" = '33' and ROWID = 'AAATGXAAEAAAAJNAAC'
  47. </EXEC_USQL>
  48. <EXEC_USQL>update "HR"."T_NOCASCADE_FORCE" set "ID" = '2' where "ID" = '22' and ROWID = 'AAATGXAAEAAAAJNAAB'
  49. </EXEC_USQL>
  50. <EXEC_USQL>update "HR"."T_NOCASCADE_FORCE" set "ID" = '1' where "ID" = '11' and ROWID = 'AAATGXAAEAAAAJNAAA'
  51. </EXEC_USQL>
  52. </EXECUTED_UNDO_SQL>
  53. </COMP_XID_REPORT>
复制代码
  1. SQL> select * from t_nocascade_force ;

  2.         ID
  3. ----------
  4.          1
  5.          2
  6.        333
复制代码










回复

使用道具 举报

1

主题

9

帖子

81

积分

注册会员

Rank: 2

积分
81
发表于 2018-6-7 11:05:23 | 显示全部楼层
唐老师单点闪回不指定条件不行吗。原先这个是24000的,我改成25000,然后闪回。他并没有变回24000
QQ图片20180607110310.png
回复 支持 反对

使用道具 举报

1

主题

9

帖子

81

积分

注册会员

Rank: 2

积分
81
发表于 2018-6-7 11:08:11 | 显示全部楼层
我大概知道,毕竟单点
回复 支持 反对

使用道具 举报

730

主题

1100

帖子

7995

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7995
 楼主| 发表于 2018-6-7 15:42:00 | 显示全部楼层
chenmd 发表于 2018-6-7 11:08
我大概知道,毕竟单点

闪回的时间为1天,可能没有UNDO支持。
回复 支持 反对

使用道具 举报

1

主题

9

帖子

81

积分

注册会员

Rank: 2

积分
81
发表于 2018-6-9 10:20:18 | 显示全部楼层
唐老师,关于闪回技术3映射表空间的语句是啥,没有映射无法进行下一步操作
回复 支持 反对

使用道具 举报

730

主题

1100

帖子

7995

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7995
 楼主| 发表于 2018-6-9 16:06:48 | 显示全部楼层
chenmd 发表于 2018-6-9 10:20
唐老师,关于闪回技术3映射表空间的语句是啥,没有映射无法进行下一步操作

select versions_xid, versions_startscn, versions_operation, salary from employees
  2  versions between scn minvalue and maxvalue
  3  where employee_id=100;

哪里需要表空间?
回复 支持 反对

使用道具 举报

1

主题

9

帖子

81

积分

注册会员

Rank: 2

积分
81
发表于 2018-6-11 20:13:01 | 显示全部楼层
botang 发表于 2018-6-9 16:06
select versions_xid, versions_startscn, versions_operation, salary from employees
  2  versions b ...

这条命令我无法执行
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|手机版|Botang唐波's Oracle Station   

GMT+8, 2018-10-20 04:25 , Processed in 0.104484 second(s), 26 queries .

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