執行alter system flush buffer_cache一定會產生檢查點嗎?

LuiseDalian發表於2014-01-12

點選(此處)摺疊或開啟

  1. --檢視資料清空buffer cache
  2. --結論:沒有產生檢查點
  3. sys@TESTDB11>select * from scott.emp;

  4.      EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
  5. ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
  6.       7369 SMITH CLERK 7902 17-DEC-80 800 20
  7.       7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
  8.       7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
  9.       7566 JONES MANAGER 7839 02-APR-81 2975 20
  10.       7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
  11.       7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
  12.       7782 CLARK MANAGER 7839 09-JUN-81 2450 10
  13.       7788 SCOTT ANALYST 7566 19-APR-87 3000 20
  14.       7839 KING PRESIDENT 17-NOV-81 5000 10
  15.       7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
  16.       7876 ADAMS CLERK 7788 23-MAY-87 1100 20
  17.       7900 JAMES CLERK 7698 03-DEC-81 950 30
  18.       7902 FORD ANALYST 7566 03-DEC-81 3000 20
  19.       7934 MILLER CLERK 7782 23-JAN-82 1300 10

  20. 14 rows selected.

  21. sys@TESTDB11>select file#, ts#, checkpoint_change# from v$datafile;

  22.      FILE# TS# CHECKPOINT_CHANGE#
  23. ---------- ---------- ------------------
  24.          1 0 2813140
  25.          2 1 2813140
  26.          3 2 2813140
  27.          4 4 2813140
  28.          5 6 2813140

  29. sys@TESTDB11>select file#, checkpoint_change# from v$datafile_header;

  30.      FILE# CHECKPOINT_CHANGE#
  31. ---------- ------------------
  32.          1 2813140
  33.          2 2813140
  34.          3 2813140
  35.          4 2813140
  36.          5 2813140

  37. sys@TESTDB11>alter system flush buffer_cache;

  38. System altered.

  39. sys@TESTDB11>select file#, ts#, checkpoint_change# from v$datafile;

  40.      FILE# TS# CHECKPOINT_CHANGE#
  41. ---------- ---------- ------------------
  42.          1 0 2813140
  43.          2 1 2813140
  44.          3 2 2813140
  45.          4 4 2813140
  46.          5 6 2813140

  47. sys@TESTDB11>alter system flush buffer_cache;

  48. System altered.

  49. sys@TESTDB11>select file#, checkpoint_change# from v$datafile_header;

  50.      FILE# CHECKPOINT_CHANGE#
  51. ---------- ------------------
  52.          1 2813140
  53.          2 2813140
  54.          3 2813140
  55.          4 2813140
  56.          5 2813140

  57. --更新資料,結論也沒有產生檢查點
  58. sys@TESTDB11>update scott.emp set sal = sal * 2;

  59. 14 rows updated.

  60. sys@TESTDB11>select file#, checkpoint_change# from v$datafile_header;

  61.      FILE# CHECKPOINT_CHANGE#
  62. ---------- ------------------
  63.          1 2813140
  64.          2 2813140
  65.          3 2813140
  66.          4 2813140
  67.          5 2813140

  68. sys@TESTDB11>alter system flush buffer_cache;

  69. System altered.

  70. sys@TESTDB11>select file#, checkpoint_change# from v$datafile_header;

  71.      FILE# CHECKPOINT_CHANGE#
  72. ---------- ------------------
  73.          1 2813140
  74.          2 2813140
  75.          3 2813140
  76.          4 2813140
  77.          5 2813140

  78. sys@TESTDB11>select file#, ts#, checkpoint_change# from v$datafile;

  79.      FILE# TS# CHECKPOINT_CHANGE#
  80. ---------- ---------- ------------------
  81.          1 0 2813140
  82.          2 1 2813140
  83.          3 2 2813140
  84.          4 4 2813140
  85.          5 6 2813140

  86. --手工產生檢查點
  87. sys@TESTDB11>alter system checkpoint;

  88. System altered.

  89. sys@TESTDB11>select file#, ts#, checkpoint_change# from v$datafile;

  90.      FILE# TS# CHECKPOINT_CHANGE#
  91. ---------- ---------- ------------------
  92.          1 0 2814217
  93.          2 1 2814217
  94.          3 2 2814217
  95.          4 4 2814217
  96.          5 6 2814217


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17013648/viewspace-1069756/,如需轉載,請註明出處,否則將追究法律責任。

相關文章