[20161101]rman備份與資料檔案變化4.txt

lfree發表於2016-11-01

[20161101]rman備份與資料檔案變化4.txt

--想象一下,如果備份檔案時間很長,而這個時候資料檔案大小發生了變化,oracle的備份如何解決這個問題呢?

--前面我已經做了增大資料檔案,參考連結:http://blog.itpub.net/267265/viewspace-2127386/
--這次測試減少資料檔案大小看看。
--早上的測試太亂了,重複做1次看看。

1.環境:
SCOTT@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

CREATE TABLESPACE SUGAR DATAFILE
  '/mnt/ramdisk/book/sugar01.dbf' SIZE 40M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

create table t1 tablespace sugar as select rownum id ,lpad('A',32,'A') name from dual connect by level<=1e5;
--建立大小5M的表。

create table t2 tablespace sugar as select rownum id ,lpad('B',32,'B') name from dual connect by level<=2e5;
create table t3 tablespace sugar as select rownum id ,lpad('C',32,'C') name from dual connect by level<=2e5;
alter system checkpoint;

SCOTT@book> select sum(bytes) from dba_extents where owner=user and segment_name like 'T%';
  SUM(BYTES)
------------
    26214400

--大約佔用26214400/1024/1024=25m。

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 41951232 2016-11-01 11:18:21 /mnt/ramdisk/book/sugar01.dbf
--當前大小40M+8k。 40*1024*1024+8192=41951232

2.備份:

RMAN>  CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128 K;
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128 K;
new RMAN configuration parameters are successfully stored
--//主要目的減慢備份速度。

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

--開始備份:
RMAN> backup datafile 6 format '/u01/backup/d6_X_%U' ;
.....

--切換會話刪除表T2,T3,操作有點多,寫入1個指令碼abc.sql執行它。
drop table t2 purge ;
host sleep 1.5
drop table t3 purge ;
host sleep 1
alter system checkpoint;
ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M;
alter system checkpoint;

$ ls -l /u01/backup/d6_X*
-rw-r----- 1 oracle oinstall 41975808 2016-11-01 11:20:09 /u01/backup/d6_X_1drjqm2h_1_1
--可以發現是先產生備份檔案的大小,然後再寫入操作。

--指令碼執行期間遇到
SCOTT@book> @ abc.sql
Table dropped.
Table dropped.
System altered.
ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M
*
ERROR at line 1:
ORA-19567: cannot shrink file /mnt/ramdisk/book/sugar01.dbf because it is being backed up or copied
System altered.
--可以發現在備份期間不能shrink表。
==============
$ oerr ora 19567
19567, 00000, "cannot shrink file %s because it is being backed up or copied"
// *Cause:  An ALTER statement attempted to reduce the size of the indicated
//          file while the same file is being backed up or copied.
// *Action: Retry the resize after the backup or copy is complete.
====================================

SCOTT@book> ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M;
Database altered.

--奇怪我手工執行又ok。非常奇怪。
--說明:這裡我重複多次,都是先報錯ora-19567,第2次執行都可以透過,估計是bug嗎?
--再次證明第2次ok,說明oracle這裡應該是bug。

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 41951232 2016-11-01 11:20:03 /mnt/ramdisk/book/sugar01.dbf

--但是檔案大小沒有改變。而且出現這種情況備份很慢,比原來增加4分鐘。

RMAN> backup datafile 6 format '/u01/backup/d6_X_%U' ;

Starting backup at 2016-11-01 11:19:44
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=68 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-01 11:19:45
channel ORA_DISK_1: finished piece 1 at 2016-11-01 11:25:10
piece handle=/u01/backup/d6_X_1drjqm2h_1_1 tag=TAG20161101T111944 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:25
channel ORA_DISK_1: throttle time: 0:05:20
Finished backup at 2016-11-01 11:25:10

Starting Control File and SPFILE Autobackup at 2016-11-01 11:25:10
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_11_01/o1_mf_s_926767510_d1j2rp4w_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2016-11-01 11:25:11
--需要將近5分20秒.

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 41951232 2016-11-01 11:20:03 /mnt/ramdisk/book/sugar01.dbf
--可以發現檔案並沒有shrink到10m。

SCOTT@book> ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M;
Database altered.

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 41951232 2016-11-01 11:20:03 /mnt/ramdisk/book/sugar01.dbf
--可以發現這個時候已經出現異常,無法shrink。或者內部一些字典已經修改了。

BBED>  p /d dba 6,1  kcvfhhdr.kccfhfsz
ub4 kccfhfsz                                @44       5120

--可以發現執行ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M;是失敗的。
-- 5120*8192+8192=41951232

$ ls -l  /u01/backup/d6_X_1drjqm2h_1_1
-rw-r----- 1 oracle oinstall 26083328 2016-11-01 11:25:05 /u01/backup/d6_X_1drjqm2h_1_1

$ strings  /u01/backup/d6_X* | grep 'BBBB'|wc
200000  340080 7243655
$ strings  /u01/backup/d6_X* | grep 'CCCC'|wc
200000  340080 7243655
$ strings  /u01/backup/d6_X* | grep 'AAAA'|wc
100000  170040 3624269

--可以發現備份也做了T2,T3備份。

SCOTT@book> select file#,CHECKPOINT_CHANGE#,ABSOLUTE_FUZZY_CHANGE#,CREATION_TIME from v$backup_datafile;
     FILE# CHECKPOINT_CHANGE# ABSOLUTE_FUZZY_CHANGE# CREATION_TIME
---------- ------------------ ---------------------- -------------------
         6            2410456                      0 2016-11-01 11:18:01

--而且備份期間沒有出現高於檢查點scn高於2410456的scn號。如果在備份期間,某個沒有資料塊寫盤,SCN高於2410456,會記錄在ABSOLUTE_FUZZY_CHANGE#最高的SCN。

SCOTT@book> SELECT file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE#  , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name  FROM v$datafile_header where file#=6;
FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME     CREATION_CHANGE# RESETLOGS_CHANGE# STATUS  CHECKPOINT_COUNT FUZ NAME                                               TABLESPACE_NAME
----- ------------------ ------------------- ---------------- ----------------- ------- ---------------- --- -------------------------------------------------- ------------------------------
    6            2410525 2016-11-01 11:20:03          2409950           2002065 ONLINE                 8 YES /mnt/ramdisk/book/sugar01.dbf                      SUGAR

--從這裡可以看出備份時視乎已經確定要備份檔案的大小,而且我覺得備份期間讀取了點陣圖資訊,僅僅非NULL的塊已經確定,應該是從文
--件頭點陣圖確定,這個時候實際上不能縮小資料檔案的。
--你可以看出我已經發出了檢查點,但是T2的資訊,T3的資訊依舊出現備份集中。
--而且從前面的測試,明視訊記憶體在問題,建議不要在備份期間做shrink資料檔案的錯誤。資料字典已經不一致。

3.這個時候做一個備份看看:
RMAN> backup datafile 6 format '/u01/backup/d6_Y_%U' ;

Starting backup at 2016-11-01 11:36:55
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-01 11:36:56
channel ORA_DISK_1: finished piece 1 at 2016-11-01 11:42:21
piece handle=/u01/backup/d6_Y_1grjqn2o_1_1 tag=TAG20161101T113655 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:25
channel ORA_DISK_1: throttle time: 0:05:20
Finished backup at 2016-11-01 11:42:21
Starting Control File and SPFILE Autobackup at 2016-11-01 11:42:21
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_11_01/o1_mf_s_926768541_d1j3rx58_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2016-11-01 11:42:22

--很奇怪依舊需要5分鐘,估計是讀太多了。

$ ls -l  /u01/backup/d6_*
-rw-r----- 1 oracle oinstall 26083328 2016-11-01 11:25:05 /u01/backup/d6_X_1drjqm2h_1_1
-rw-r----- 1 oracle oinstall 21880832 2016-11-01 11:42:16 /u01/backup/d6_Y_1grjqn2o_1_1

--可以備份大小存在問題,正常不應該備份T2,T3對應的塊,實際上現在存在問題的。

$ strings -t d /u01/backup/d6_Y_1grjqn2o_1_1 | grep BBBB |wc
116438  314501 5189314
$ strings -t d /u01/backup/d6_Y_1grjqn2o_1_1 | grep CCCC |wc
200000  540080 9043655
$ strings -t d /u01/backup/d6_Y_1grjqn2o_1_1 | grep AAAA |wc
100000  270040 4424269

--可以發現很奇怪的現象。

SCOTT@book> ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M;
Database altered.

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 41951232 2016-11-01 11:36:56 /mnt/ramdisk/book/sugar01.dbf
--//無效!!

SCOTT@book> ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 11M;
Database altered.

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 41951232 2016-11-01 11:36:56 /mnt/ramdisk/book/sugar01.dbf
--//無效!!

--僅僅設定9M,50M有效。

SCOTT@book> ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 50M;
Database altered.

$ ls -l /mnt/ramdisk/book/sugar01.dbf
-rw-r----- 1 oracle oinstall 52436992 2016-11-01 11:49:51 /mnt/ramdisk/book/sugar01.dbf
--//有效!!

--//繼續做備份測試:

RMAN> backup datafile 6 format '/u01/backup/d6_Z_%U' ;
Starting backup at 2016-11-01 11:50:42
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-01 11:50:42
channel ORA_DISK_1: finished piece 1 at 2016-11-01 11:57:27
piece handle=/u01/backup/d6_Z_1irjqnsi_1_1 tag=TAG20161101T115042 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:06:45
channel ORA_DISK_1: throttle time: 0:06:40
Finished backup at 2016-11-01 11:57:27
Starting Control File and SPFILE Autobackup at 2016-11-01 11:57:27
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_11_01/o1_mf_s_926769447_d1j4o7g7_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2016-11-01 11:57:28

$ ls -l  /u01/backup/d6_*
-rw-r----- 1 oracle oinstall 26083328 2016-11-01 11:25:05 /u01/backup/d6_X_1drjqm2h_1_1
-rw-r----- 1 oracle oinstall 21880832 2016-11-01 11:42:16 /u01/backup/d6_Y_1grjqn2o_1_1
-rw-r----- 1 oracle oinstall  6111232 2016-11-01 11:57:22 /u01/backup/d6_Z_1irjqnsi_1_1

--這次大小正確了。

$ strings -t d /u01/backup/d6_Z_1irjqnsi_1_1 | grep AAAA |wc
100000  270040 4424269
$ strings -t d /u01/backup/d6_Z_1irjqnsi_1_1 | grep BBBB |wc
      0       0       0
$ strings -t d /u01/backup/d6_Z_1irjqnsi_1_1 | grep CCCC |wc
      0       0       0

--看來以後不要在備份期間做維護操作。

4.重複測試:
SCOTT@book> ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 40M;
Database altered.

SCOTT@book> create table t2 tablespace sugar as select rownum id ,lpad('B',32,'B') name from dual connect by level<=2e5;
Table created.

SCOTT@book> create table t3 tablespace sugar as select rownum id ,lpad('C',32,'C') name from dual connect by level<=2e5;
Table created.

$ cat abc.sql
host sleep 1.5
drop table t2 purge ;
host sleep 1.5
drop table t3 purge ;
host sleep 1
alter system checkpoint;
@ &r/10046on 12
ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M;
@ &r/10046off
alter system checkpoint;

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 128 K;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;


RMAN> backup datafile 6 format '/u01/backup/d6_A1_%U' ;
Starting backup at 2016-11-01 14:54:08
...


SCOTT@book> @ abc.sql
Table dropped.
Table dropped.
System altered.
old   1: alter session set events '10046 trace name context forever, level &1'
new   1: alter session set events '10046 trace name context forever, level 12'
Session altered.
ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M
*
ERROR at line 1:
ORA-19567: cannot shrink file /mnt/ramdisk/book/sugar01.dbf because it is being backed up or copied
Session altered.
System altered.

SCOTT@book> select * from DBA_DATA_FILES;
FILE_NAME                        FILE_ID TABLESPACE_NAME     BYTES BLOCKS STATUS    RELATIVE_FNO AUT     MAXBYTES    MAXBLOCKS INCREMENT_BY   USER_BYTES  USER_BLOCKS ONLINE_
-------------------------------- ------- --------------- --------- ------ --------- ------------ --- ------------ ------------ ------------ ------------ ------------ -------
/mnt/ramdisk/book/users01.dbf          4 USERS            52428800   6400 AVAILABLE            4 YES  34359721984      4194302          160     51380224         6272 ONLINE
/mnt/ramdisk/book/undotbs01.dbf        3 UNDOTBS1         89128960  10880 AVAILABLE            3 YES   1073741824       131072          640     88080384        10752 ONLINE
/mnt/ramdisk/book/sysaux01.dbf         2 SYSAUX          817889280  99840 AVAILABLE            2 YES  34359721984      4194302         1280    816840704        99712 ONLINE
/mnt/ramdisk/book/system01.dbf         1 SYSTEM          786432000  96000 AVAILABLE            1 YES  34359721984      4194302         1280    785383424        95872 SYSTEM
/mnt/ramdisk/book/example01.dbf        5 EXAMPLE         328335360  40080 AVAILABLE            5 YES  34359721984      4194302           80    327286784        39952 ONLINE
/mnt/ramdisk/book/sugar01.dbf          6 SUGAR            10485760   1280 AVAILABLE            6 YES  34359721984      4194302         2048      9437184         1152 ONLINE
6 rows selected.

--實際上第1次執行ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M,問題已經再現,第2次僅僅是1個假象。

RMAN> backup datafile 6 format '/u01/backup/d6_A1_%U' ;
Starting backup at 2016-11-01 14:54:08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=68 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-01 14:54:08
channel ORA_DISK_1: finished piece 1 at 2016-11-01 14:59:33
piece handle=/u01/backup/d6_A1_1krjr2kg_1_1 tag=TAG20161101T145408 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:25
channel ORA_DISK_1: throttle time: 0:05:20
Finished backup at 2016-11-01 14:59:33
Starting Control File and SPFILE Autobackup at 2016-11-01 14:59:33
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_11_01/o1_mf_s_926780373_d1jhbodd_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2016-11-01 14:59:34

--//跟蹤檔案如下:
=====================
PARSING IN CURSOR #140274325604320 len=66 dep=0 uid=83 oct=35 lid=83 tim=1477983255600631 hv=1840685487 ad='7def9f20' sqlid='58jj94jqvd8dg'
ALTER DATABASE DATAFILE '/mnt/ramdisk/book/sugar01.dbf' RESIZE 10M
END OF STMT
PARSE #140274325604320:c=1000,e=759,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=1477983255600626
WAIT #140274325604320: nam='control file sequential read' ela= 13 file#=0 block#=1 blocks=1 obj#=-1 tim=1477983255601009
WAIT #140274325604320: nam='control file sequential read' ela= 8 file#=1 block#=1 blocks=1 obj#=-1 tim=1477983255601063
WAIT #140274325604320: nam='control file sequential read' ela= 8 file#=0 block#=16 blocks=1 obj#=-1 tim=1477983255601093
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=18 blocks=1 obj#=-1 tim=1477983255601121
WAIT #140274325604320: nam='control file sequential read' ela= 10 file#=0 block#=32 blocks=1 obj#=-1 tim=1477983255601160
WAIT #140274325604320: nam='control file sequential read' ela= 9 file#=0 block#=1 blocks=1 obj#=-1 tim=1477983255601239
WAIT #140274325604320: nam='control file sequential read' ela= 6 file#=1 block#=1 blocks=1 obj#=-1 tim=1477983255601278
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=16 blocks=1 obj#=-1 tim=1477983255601306
WAIT #140274325604320: nam='control file sequential read' ela= 6 file#=0 block#=18 blocks=1 obj#=-1 tim=1477983255601333
WAIT #140274325604320: nam='control file sequential read' ela= 11 file#=0 block#=23 blocks=1 obj#=-1 tim=1477983255601382
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=32 blocks=1 obj#=-1 tim=1477983255601423
WAIT #140274325604320: nam='control file sequential read' ela= 9 file#=0 block#=1 blocks=1 obj#=-1 tim=1477983255601506
WAIT #140274325604320: nam='control file sequential read' ela= 6 file#=1 block#=1 blocks=1 obj#=-1 tim=1477983255601545
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=16 blocks=1 obj#=-1 tim=1477983255601573
WAIT #140274325604320: nam='control file sequential read' ela= 6 file#=0 block#=18 blocks=1 obj#=-1 tim=1477983255601600
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=23 blocks=1 obj#=-1 tim=1477983255601633
WAIT #140274325604320: nam='db file sequential read' ela= 6 file#=6 block#=1 blocks=1 obj#=-1 tim=1477983255601665
WAIT #140274325604320: nam='control file sequential read' ela= 8 file#=0 block#=32 blocks=1 obj#=-1 tim=1477983255601700
WAIT #140274325604320: nam='control file sequential read' ela= 9 file#=0 block#=1 blocks=1 obj#=-1 tim=1477983255601780
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=1 block#=1 blocks=1 obj#=-1 tim=1477983255601819
WAIT #140274325604320: nam='control file sequential read' ela= 6 file#=0 block#=16 blocks=1 obj#=-1 tim=1477983255601846
WAIT #140274325604320: nam='control file sequential read' ela= 6 file#=0 block#=18 blocks=1 obj#=-1 tim=1477983255601874
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=23 blocks=1 obj#=-1 tim=1477983255601931
WAIT #140274325604320: nam='control file sequential read' ela= 7 file#=0 block#=32 blocks=1 obj#=-1 tim=1477983255601961
WAIT #140274325604320: nam='db file sequential read' ela= 6 file#=6 block#=1 blocks=1 obj#=-1 tim=1477983255601991
WAIT #140274325604320: nam='Disk file operations I/O' ela= 420 FileOperation=2 fileno=0 filetype=2 obj#=-1 tim=1477983255602438
WAIT #140274325604320: nam='Disk file operations I/O' ela= 11 FileOperation=5 fileno=0 filetype=2 obj#=-1 tim=1477983255602543
EXEC #140274325604320:c=2000,e=1977,p=0,cr=0,cu=2,mis=0,r=0,dep=0,og=1,plh=0,tim=1477983255602708
ERROR #140274325604320:err=19567 tim=1477983255602733
=====================

SYS@book> execute dbms_space_admin.tablespace_dump_bitmaps('SUGAR');
PL/SQL procedure successfully completed.

--跟蹤檔案內容:
Header Control:
RelFno: 6, Unit: 8, Size: 1280, Flag: 9
AutoExtend: YES, Increment: 2048, MaxSize: 4194302
Initial Area: 126, Tail: 1279, First: 0, Free: 64
Deallocation scn: 2417402.0
Header Opcode:
Save: No Pending Op
File Space Bitmap Block:
BitMap Control:
RelFno: 6, BeginBlock: 128, Flag: 0, First: 80, Free: 63408
FFFFFFFFFFFFFFFF FFFF000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000

-- 1bit 表示 64K。 F(0x1111) 表示4 bits.
-- 20*4*64*1024/8192=640塊 ,640*8192/1024/1024=5M, 點陣圖資訊對的。

SYS@book> alter session set events 'immediate trace name controlf level 12';
Session altered.

--跟蹤檔案內容:
DATA FILE #6:
  name #10: /mnt/ramdisk/book/sugar01.dbf
creation size=5120 block size=8192 status=0xe head=10 tail=10 dup=1
tablespace 7, index=7 krfil=6 prev_file=0
unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
Checkpoint cnt:15 scn: 0x0000.0024e303 11/01/2016 14:54:15
Stop scn: 0xffff.ffffffff 11/01/2016 11:18:01
Creation Checkpointed at scn:  0x0000.0024c5de 11/01/2016 11:18:01
thread:1 rba:(0x15.12e7a.10)
enabled  threads:  01000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000
Offline scn: 0x0000.00000000 prev_range: 5
Online Checkpointed at scn:  0x0000.00000000
thread:0 rba:(0x0.0.0)
enabled  threads:  00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000
Hot Backup end marker scn: 0x0000.00000000
aux_file is NOT DEFINED
Plugged readony: NO
Plugin scnscn: 0x0000.00000000
Plugin resetlogs scn/timescn: 0x0000.00000000 01/01/1988 00:00:00
Foreign creation scn/timescn: 0x0000.00000000 01/01/1988 00:00:00
Foreign checkpoint scn/timescn: 0x0000.00000000 01/01/1988 00:00:00
Online move state: 0

--估計存在不一致導致的問題。但是rman備份導致如何決定那些塊需要備份呢,這個超出我的能力範圍,放棄!!

總之:
在資料庫備份期間最好不做資料庫維護方面的工作。

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

相關文章