- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
18#
发表于 2013-11-5 23:29:08
ODM FINDING:
Understand SCN movement during online user managed backup;
Before online backup, check current scn, system and datafile scn in controlfile and scn in datafile header.
As expected checkpoint scn are same in controlfile and datafile headers, and it is behind current scn.
SQL> select current_scn, checkpoint_change# from v$database;
CURRENT_SCN CHECKPOINT_CHANGE#
----------- ------------------
325011036 325009912
SQL> select name,checkpoint_change# from v$datafile;
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/system.270.675355175 325009912
+DBA_DATA/dbaprd/datafile/sysaux.269.675355177 325009912
+DBA_DATA/dbaprd/datafile/undotbs1.266.675355179 325009912
+DBA_DATA/dbaprd/datafile/undotbs2.264.675355187 325009912
+DBA_DATA/dbaprd/datafile/users.263.675355189 325009912
+DBA_DATA/dbaprd/datafile/xml_data.262.675355189 325009912
SQL> select name,checkpoint_change# from v$datafile_header where name like '%users%';
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/users.263.675355189 325009912
Start online tablespace backup
Oracle did a checkpoint on USERS tablespace and datafile only, and freeze the checkpoint scn on datafile header.
SQL> alter tablespace users begin backup;
Tablespace altered.
SQL> select current_scn, checkpoint_change# from v$database;
CURRENT_SCN CHECKPOINT_CHANGE#
----------- ------------------
325011196 325009912
SQL> select name,checkpoint_change# from v$datafile;
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/system.270.675355175 325009912
+DBA_DATA/dbaprd/datafile/sysaux.269.675355177 325009912
+DBA_DATA/dbaprd/datafile/undotbs1.266.675355179 325009912
+DBA_DATA/dbaprd/datafile/undotbs2.264.675355187 325009912
+DBA_DATA/dbaprd/datafile/users.263.675355189 325011168
+DBA_DATA/dbaprd/datafile/xml_data.262.675355189 325009912
SQL> select name,checkpoint_change# from v$datafile_header where name like '%users%';
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/users.263.675355189 325011168
during the online backup checkpoint scn is freeze on datafile belongs to USERS tablespace
SQL> alter system checkpoint;
System altered.
SQL> select current_scn, checkpoint_change# from v$database;
CURRENT_SCN CHECKPOINT_CHANGE#
----------- ------------------
325011272 325011243
SQL> select name,checkpoint_change# from v$datafile;
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/system.270.675355175 325011243
+DBA_DATA/dbaprd/datafile/sysaux.269.675355177 325011243
+DBA_DATA/dbaprd/datafile/undotbs1.266.675355179 325011243
+DBA_DATA/dbaprd/datafile/undotbs2.264.675355187 325011243
+DBA_DATA/dbaprd/datafile/users.263.675355189 325011168
+DBA_DATA/dbaprd/datafile/xml_data.262.675355189 325011243
SQL> select name,checkpoint_change# from v$datafile_header where name like '%users%';
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/users.263.675355189 325011168
END online tablespace backup;
Oracle advanced checkpoint scn on USERS tablespace and datafile only to be same as system checkpoint scn
SQL> alter tablespace users end backup;
Tablespace altered.
SQL> select current_scn, checkpoint_change# from v$database;
CURRENT_SCN CHECKPOINT_CHANGE#
----------- ------------------
325011488 325011243
SQL> select name,checkpoint_change# from v$datafile;
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/system.270.675355175 325011243
+DBA_DATA/dbaprd/datafile/sysaux.269.675355177 325011243
+DBA_DATA/dbaprd/datafile/undotbs1.266.675355179 325011243
+DBA_DATA/dbaprd/datafile/undotbs2.264.675355187 325011243
+DBA_DATA/dbaprd/datafile/users.263.675355189 325011243
+DBA_DATA/dbaprd/datafile/xml_data.262.675355189 325011243
9 rows selected.
SQL> select name,checkpoint_change# from v$datafile_header where name like '%users%';
NAME CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
+DBA_DATA/dbaprd/datafile/users.263.675355189 325011243 |
|