|
Summarize :
1 The article illustrates why the uses must put tablespace(s) in backup mode ,when the users want to backup the tablespace(s) online,even your database runs in archived log mode .
2 When your tablespace(s) is in backup mode , the information that is recoded in redo logfile will increase. And this will consume more redo log buffer and create more archived logfile .
3 When your tablespace(s) run in backup mode, their datafile can be modified at the same time .
SQL> create table tapes (name varchar2(32)) tablespace test;
Table created.
SQL> insert into tapes values ('DLT');
1 row created
SQL> commit;
Commit complete.
SQL> alter system checkpoint;
System altered.
Now we ask Oracle what block number contains the new value:
SQL> select dbms_rowid.rowid_block_number(rowid) blk, name from tapes;
BLK NAME
------- ----------------
3 DLT
The value "DLT" is recorded in the third data block. Allowing nine blocks for the datafile headers, we can read the third block of data with dd and run strings on it to actually see that the value is there:
$ dd if=/db/Oracle/a/oradata/crash/test01.dbf ibs=8192 skip=11 count=1|strings
1+0 records in
16+0 records out
DLT
Now we place the tablespace in hot-backup mode:
SQL> alter tablespace test begin backup ;
Tablespace altered.
Now we update the table, commit the update, and force a global checkpoint on the database:
SQL> update tapes set name = 'AIT';
1 row updated
SQL> commit;
Commit complete.
SQL> alter system checkpoint;
System altered.
Now we extract the same block of data to show the new value was actually written to disk:
$ dd if=/db/Oracle/a/oradata/crash/test01.dbf ibs=8192 skip=11 count=1|strings
1+0 records in
16+0 records out
DLT,
AIT
We now can take the tablespace out of backup mode:
SQL> alter tablespace test end backup;
This test proves that datafiles are indeed being written to during hot backups.
4 Why dose oracle must lock the datafile header when the tablepspace(s) run(s) in backup mode .
Someone says that it give the alter tablespace end backup command all the redo generated during the backup is applied to the datafile to advance the datafile SCN to database SCN.
I donot aggree that .
SQL> select * from a;
A
----------
1
1
1
1
1
1
1
1
1
1
1
已选择11行。
SQL> select tablespace_name from dba_tables where table_name='A';
TABLESPACE_NAME
------------------------------
TEST_TS
SQL> alter tablespace test_ts begin backup ;
表空间已更改。
SQL> delete from a;
已删除11行。
SQL> commit ;
提交完成。
SQL> alter system switch logfile ;
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> archive log list;
数据库日志模式 存档模式
自动存档 启用
存档终点 c:
最早的概要日志序列 34
下一个存档日志序列 36
当前日志序列 36
SQL> /
系统已更改。
SQL> alter system switch logfile ;
系统已更改。
SQL> archive log list;
数据库日志模式 存档模式
自动存档 启用
存档终点 c:
最早的概要日志序列 36
下一个存档日志序列 38
当前日志序列 38
======================================
= here I deleted manually all of the archived log
=====================================
SQL> alter tablespace test_ts end backup ;
表空间已更改。
Here we can understand that oracle dose not use the archived logfile to keep the sync of datafile with database .
Maybe someone can give more explains .
THanks ! |
|