博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SCN试验之二 checkpoin scn 与数据库scn的关系
阅读量:5089 次
发布时间:2019-06-13

本文共 1929 字,大约阅读时间需要 6 分钟。

oracle11g

观察数据库scn:

SQL> select dbms_flashback.get_system_change_number from dual;

GET_SYSTEM_CHANGE_NUMBER
------------------------
                 1025713
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
           1022214
SQL>

********************************

强制执行checkpoint:

SQL> alter system checkpoint;

System altered.
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
           1025732
可以看到,此时 checkpoint_change# 比刚才的数据库scn 要大一些。这是因为数据库scn 随着时间的增长而增长。

 

SQL> select dbms_flashback.get_system_change_number from dual;

GET_SYSTEM_CHANGE_NUMBER
------------------------
                 1025755
SQL> alter system checkpoint;
System altered.
SQL>

 

SQL> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
           1025765
SQL> select name, checkpoint_change# from v$datafile;      
NAME
--------------------------------------------------------------------------------
CHECKPOINT_CHANGE#
------------------
/u01/app/oracle/oradata/orcl/system01.dbf
           1025765
/u01/app/oracle/oradata/orcl/sysaux01.dbf
           1025765
/u01/app/oracle/oradata/orcl/undotbs01.dbf
           1025765
NAME
--------------------------------------------------------------------------------
CHECKPOINT_CHANGE#
------------------
/u01/app/oracle/oradata/orcl/users01.dbf
           1025765
/u01/app/oracle/oradata/orcl/example01.dbf
           1025765
SQL> select name, checkpoint_change# from v$datafile_header;
NAME
--------------------------------------------------------------------------------
CHECKPOINT_CHANGE#
------------------
/u01/app/oracle/oradata/orcl/system01.dbf
           1025765
/u01/app/oracle/oradata/orcl/sysaux01.dbf
           1025765
/u01/app/oracle/oradata/orcl/undotbs01.dbf
           1025765
NAME
--------------------------------------------------------------------------------
CHECKPOINT_CHANGE#
------------------
/u01/app/oracle/oradata/orcl/users01.dbf
           1025765
/u01/app/oracle/oradata/orcl/example01.dbf
           1025765
SQL>

 

 

转载于:https://www.cnblogs.com/gaojian/p/3663959.html

你可能感兴趣的文章