1. 程式人生 > >手工指定CHANNEL與設定PARALLELISM引數的異同以及FILESPERSET引數的作用

手工指定CHANNEL與設定PARALLELISM引數的異同以及FILESPERSET引數的作用

感謝大臉貓的實驗分析結果。

下面以實驗的方式,展示在RUN塊中手工指定多通道(CHANNEL,也有稱之為“通道”) 與設定並行度PARALLELISM引數 的異同,以及FILESPERSET引數的作用。
RMAN備份時,為了加快備份的速度,提供了並行處理的方式。一種是設定多個通道,另一種是設定PARALLELISM引數。那麼這兩種方式有什麼不同呢?今天在實驗的方式來加深理解。 首先,我們來實驗第一種方式,即設定多個通道的方式。為了比較增加通道後的效果,我們先做一次單通道的備份操作。 [[email protected] ~]$ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Sat Jan 25 15:22:13 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: ORCL (DBID=1347935162) RMAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; }2> 3> 4> 5> using target database control file instead of recovery catalog allocated channel: c1 channel c1: sid=158 devtype=DISK Starting backup at 20140125 15:27:37 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel c1: starting piece 1 at 20140125 15:27:38 channel c1: finished piece 1 at 20140125 15:28:23 piece handle=/oradata/orcl/databak1/8iouvaba_1_1 tag=TAG20140125T152737 comment=NONE channel c1: backup set complete, elapsed time: 00:00:45 Finished backup at 20140125 15:28:23 Starting Control File and SPFILE Autobackup at 20140125 15:28:23 piece handle=/oradata/orcl/databak/c-1347935162-20140125-08 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 15:28:26 released channel: c1 可見,資料庫的備份時間約為49秒(15:27:37至15:28:26)。
下面我們設定2個通道,來執行備份。 RMAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c2 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; release channel c2; }2> 3> 4> 5> 6> 7> allocated channel: c1 channel c1: sid=158 devtype=DISK allocated channel: c2 channel c2: sid=147 devtype=DISK Starting backup at 20140125 15:31:45 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf channel c1: starting piece 1 at 20140125 15:31:45 channel c2: starting full datafile backupset channel c2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel c2: starting piece 1 at 20140125 15:31:45 channel c2: finished piece 1 at 20140125 15:32:00 piece handle=/oradata/orcl/databak1/8louvaj1_1_1 tag=TAG20140125T153145 comment=NONE channel c2: backup set complete, elapsed time: 00:00:15 channel c1: finished piece 1 at 20140125 15:32:35 piece handle=/oradata/orcl/databak1/8kouvaj1_1_1 tag=TAG20140125T153145 comment=NONE channel c1: backup set complete, elapsed time: 00:00:50 Finished backup at 20140125 15:32:35 Starting Control File and SPFILE Autobackup at 20140125 15:32:35 piece handle=/oradata/orcl/databak/c-1347935162-20140125-09 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 15:32:38 released channel: c1 released channel: c2 2個通道的情況下,備份時間約為53秒(15:31:45至15:32:38)。時間上還要慢了一些。
而且,我們發現,組成資料庫的資料檔案一共有6個,當用2個通道備份時,其自動分成了兩組,每組3個檔案。 備份結束後,每個通道生成一個備份檔案,共兩個備份檔案。 我們再試試3個通道時的情況 RMAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c2 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c3 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; release channel c2; release channel c3; }2> 3> 4> 5> 6> 7> 8> 9> allocated channel: c1 channel c1: sid=158 devtype=DISK allocated channel: c2 channel c2: sid=147 devtype=DISK allocated channel: c3 channel c3: sid=138 devtype=DISK Starting backup at 20140125 15:39:06 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel c1: starting piece 1 at 20140125 15:39:07 channel c2: starting full datafile backupset channel c2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel c2: starting piece 1 at 20140125 15:39:07 channel c3: starting full datafile backupset channel c3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf channel c3: starting piece 1 at 20140125 15:39:07 channel c2: finished piece 1 at 20140125 15:39:14 piece handle=/oradata/orcl/databak1/8oouvb0r_1_1 tag=TAG20140125T153906 comment=NONE channel c2: backup set complete, elapsed time: 00:00:07 channel c1: finished piece 1 at 20140125 15:39:59 piece handle=/oradata/orcl/databak1/8nouvb0r_1_1 tag=TAG20140125T153906 comment=NONE channel c1: backup set complete, elapsed time: 00:00:52 channel c3: finished piece 1 at 20140125 15:39:59 piece handle=/oradata/orcl/databak1/8pouvb0r_1_1 tag=TAG20140125T153906 comment=NONE channel c3: backup set complete, elapsed time: 00:00:52 Finished backup at 20140125 15:39:59 Starting Control File and SPFILE Autobackup at 20140125 15:39:59 piece handle=/oradata/orcl/databak/c-1347935162-20140125-0a comment=NONE Finished Control File and SPFILE Autobackup at 20140125 15:40:02 released channel: c1 released channel: c2 released channel: c3 3個通道的情況下,備份時間約為56秒(15:39:06至15:40:02)
而且,6個數據檔案也被分成了三組,每組2個檔案。那麼如果我設成4個通道,6個檔案會如何分組呢? RMAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c2 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c3 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c4 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; release channel c2; release channel c3; release channel c4; } 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> allocated channel: c1 channel c1: sid=158 devtype=DISK allocated channel: c2 channel c2: sid=147 devtype=DISK allocated channel: c3 channel c3: sid=138 devtype=DISK allocated channel: c4 channel c4: sid=137 devtype=DISK Starting backup at 20140125 15:42:49 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel c1: starting piece 1 at 20140125 15:42:49 channel c2: starting full datafile backupset channel c2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel c2: starting piece 1 at 20140125 15:42:49 channel c3: starting full datafile backupset channel c3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf channel c3: starting piece 1 at 20140125 15:42:49 channel c2: finished piece 1 at 20140125 15:43:04 piece handle=/oradata/orcl/databak1/8souvb7p_1_1 tag=TAG20140125T154249 comment=NONE channel c2: backup set complete, elapsed time: 00:00:15 channel c3: finished piece 1 at 20140125 15:43:39 piece handle=/oradata/orcl/databak1/8touvb7p_1_1 tag=TAG20140125T154249 comment=NONE channel c3: backup set complete, elapsed time: 00:00:50 channel c1: finished piece 1 at 20140125 15:43:46 piece handle=/oradata/orcl/databak1/8rouvb7p_1_1 tag=TAG20140125T154249 comment=NONE channel c1: backup set complete, elapsed time: 00:00:57 Finished backup at 20140125 15:43:46 Starting Control File and SPFILE Autobackup at 20140125 15:43:46 piece handle=/oradata/orcl/databak/c-1347935162-20140125-0b comment=NONE Finished Control File and SPFILE Autobackup at 20140125 15:43:47 released channel: c1 released channel: c2 released channel: c3 released channel: c4 分配了4個通道,但備份過程中,只實際使用了3個。備份的時間為58秒(15:42:49至15:43:47 )。
到了這裡,看來RMAN是在各個通道間平均分配檔案數量的。推測一下,如果設成6個通道,應該就是一個檔案一個通道了。 RMAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c2 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c3 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c4 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c5 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c6 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; release channel c2; release channel c3; release channel c4; release channel c5; release channel c6; }2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> allocated channel: c1 channel c1: sid=158 devtype=DISK allocated channel: c2 channel c2: sid=147 devtype=DISK allocated channel: c3 channel c3: sid=138 devtype=DISK allocated channel: c4 channel c4: sid=137 devtype=DISK allocated channel: c5 channel c5: sid=156 devtype=DISK allocated channel: c6 channel c6: sid=155 devtype=DISK Starting backup at 20140125 15:57:58 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf channel c1: starting piece 1 at 20140125 15:57:58 channel c2: starting full datafile backupset channel c2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf channel c2: starting piece 1 at 20140125 15:57:58 channel c3: starting full datafile backupset channel c3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf channel c3: starting piece 1 at 20140125 15:57:58 channel c4: starting full datafile backupset channel c4: specifying datafile(s) in backupset input datafile fno=00004 name=/oradata/orcl/users01.dbf channel c4: starting piece 1 at 20140125 15:57:58 channel c5: starting full datafile backupset channel c5: specifying datafile(s) in backupset input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel c5: starting piece 1 at 20140125 15:57:58 channel c6: starting full datafile backupset channel c6: specifying datafile(s) in backupset input datafile fno=00007 name=/oradata/orcl/system02.dbf channel c6: starting piece 1 at 20140125 15:57:58 channel c5: finished piece 1 at 20140125 15:58:01 piece handle=/oradata/orcl/databak1/93ouvc46_1_1 tag=TAG20140125T155758 comment=NONE channel c5: backup set complete, elapsed time: 00:00:03 channel c2: finished piece 1 at 20140125 15:58:08 piece handle=/oradata/orcl/databak1/90ouvc46_1_1 tag=TAG20140125T155758 comment=NONE channel c2: backup set complete, elapsed time: 00:00:10 channel c6: finished piece 1 at 20140125 15:58:08 piece handle=/oradata/orcl/databak1/94ouvc46_1_1 tag=TAG20140125T155758 comment=NONE channel c6: backup set complete, elapsed time: 00:00:10 channel c4: finished piece 1 at 20140125 15:58:11 piece handle=/oradata/orcl/databak1/92ouvc46_1_1 tag=TAG20140125T155758 comment=NONE channel c4: backup set complete, elapsed time: 00:00:13 channel c3: finished piece 1 at 20140125 15:58:36 piece handle=/oradata/orcl/databak1/91ouvc46_1_1 tag=TAG20140125T155758 comment=NONE channel c3: backup set complete, elapsed time: 00:00:39 channel c1: finished piece 1 at 20140125 15:58:52 piece handle=/oradata/orcl/databak1/8vouvc46_1_1 tag=TAG20140125T155758 comment=NONE channel c1: backup set complete, elapsed time: 00:00:54 Finished backup at 20140125 15:58:52 Starting Control File and SPFILE Autobackup at 20140125 15:58:52 piece handle=/oradata/orcl/databak/c-1347935162-20140125-0c comment=NONE Finished Control File and SPFILE Autobackup at 20140125 15:58:55 released channel: c1 released channel: c2 released channel: c3 released channel: c4 released channel: c5 released channel: c6 果然,如推測中的一樣。是一個通道一個檔案,最終生成了6個備份檔案。總用時約57秒(15:57:58至 15:58:55) 經過以上實驗,得出以下結論: 1、增加通道,RMAN會並行處理備份任務,但根據硬體環境的不同,並不是越多越快。以本次實驗來說,備份時間最省的,卻是隻有一個通道的時候。這可能是因為實驗環境為一跑在普通桌上型電腦上的虛擬機器所致,其本身的並行處理能力就低。 2、當設有多個通道時,資料檔案會平均分配至各個通道上。若檔案不能全部均分至所有通道上,則會放棄部分通道的使用。例如上面實驗中的6個數據檔案在4個通道上備份時,則實際上只使用了3個通道。可是,假如組成資料庫的資料檔案的個數是質數(只能被它自己和1整除的數),比如7個檔案。當設定為4個通道時,會如何分配呢?由於無論是用4個,還是3個或2個通道,我們都不能把資料檔案均分到通道上。這裡先賣個關子,為了保證我們下面的實驗可以在相同的環境下完成,這個實驗,我們放到最後。 3、自動備份的控制檔案和引數檔案並沒有備份到通道指定的位置(/oradata/orcl/databak1),而放存放到了RMAN中配置的“控制檔案自動備份”所指定的位置(見下面紅字部分)。 RMAN> show all; RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/orcl/databak/%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/orcl/databak/%U'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/app/oracle/product/10.2/db_1/dbs/snapcf_orcl.f'; # default 現在再來看並行度PARALLELISM這個引數。這個引數要通過輸入以下命令來設定(這裡設定的並行度為3): RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored 我們再執行一個通道的備份,看看是什麼效果。 RMAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; }2> 3> 4> 5> allocated channel: c1 channel c1: sid=158 devtype=DISK Starting backup at 20140125 16:20:32 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel c1: starting piece 1 at 20140125 16:20:32 channel c1: finished piece 1 at 20140125 16:21:17 piece handle=/oradata/orcl/databak1/9bouvdeg_1_1 tag=TAG20140125T162032 comment=NONE channel c1: backup set complete, elapsed time: 00:00:45 Finished backup at 20140125 16:21:17 Starting Control File and SPFILE Autobackup at 20140125 16:21:17 piece handle=/oradata/orcl/databak/c-1347935162-20140125-0f comment=NONE Finished Control File and SPFILE Autobackup at 20140125 16:21:18 released channel: c1 嘿嘿,在RUN塊中指定通道時,這個引數是不管用的。也就是說,你在RUN塊內指定了幾個通道,就用幾個通道去備份,與這個PARALLELISM這個引數無關。 那我們直接在RMAN中輸入BACKUP DATABASE;會是什麼效果呢? RMAN> backup database; Starting backup at 20140125 16:24:41 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=158 devtype=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: sid=147 devtype=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: sid=138 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel ORA_DISK_1: starting piece 1 at 20140125 16:24:42 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 16:24:42 channel ORA_DISK_3: starting full datafile backupset channel ORA_DISK_3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf channel ORA_DISK_3: starting piece 1 at 20140125 16:24:42 channel ORA_DISK_2: finished piece 1 at 20140125 16:24:49 piece handle=/oradata/orcl/databak/9eouvdma_1_1 tag=TAG20140125T162441 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: finished piece 1 at 20140125 16:25:24 piece handle=/oradata/orcl/databak/9douvdma_1_1 tag=TAG20140125T162441 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:42 channel ORA_DISK_3: finished piece 1 at 20140125 16:25:24 piece handle=/oradata/orcl/databak/9fouvdma_1_1 tag=TAG20140125T162441 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:42 Finished backup at 20140125 16:25:24 Starting Control File and SPFILE Autobackup at 20140125 16:25:24 piece handle=/oradata/orcl/databak/c-1347935162-20140125-10 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 16:25:27 RMAN自動建立了三個通道,ORA_DISK_1至3。備份時間為46秒(16:24:41至16:25:27)。這個時間要比我們手工指定三個通道(56秒)時快。 再設定並行度為4看看效果。 RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored released channel: ORA_DISK_1 released channel: ORA_DISK_2 released channel: ORA_DISK_3 RMAN> backup database; Starting backup at 20140125 16:26:38 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=158 devtype=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: sid=147 devtype=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: sid=138 devtype=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: sid=137 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel ORA_DISK_1: starting piece 1 at 20140125 16:26:38 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 16:26:38 channel ORA_DISK_3: starting full datafile backupset channel ORA_DISK_3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf channel ORA_DISK_3: starting piece 1 at 20140125 16:26:39 channel ORA_DISK_2: finished piece 1 at 20140125 16:26:54 piece handle=/oradata/orcl/databak/9iouvdpu_1_1 tag=TAG20140125T162638 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:16 channel ORA_DISK_1: finished piece 1 at 20140125 16:27:29 piece handle=/oradata/orcl/databak/9houvdpu_1_1 tag=TAG20140125T162638 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:51 channel ORA_DISK_3: finished piece 1 at 20140125 16:27:29 piece handle=/oradata/orcl/databak/9jouvdpu_1_1 tag=TAG20140125T162638 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:51 Finished backup at 20140125 16:27:29 Starting Control File and SPFILE Autobackup at 20140125 16:27:29 piece handle=/oradata/orcl/databak/c-1347935162-20140125-11 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 16:27:32 和我們手工指定4個通道時類似,備份時只實際使用了3個通道。備份的時間為54秒(16:26:38至16:27:32),和上面手工指定4個通道所用時間來比,稍快一點兒。但比剛才自動3通道的要慢。 再設定並行度為7看看效果。 RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 7 BACKUP TYPE TO BACKUPSET; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 7 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored released channel: ORA_DISK_1 released channel: ORA_DISK_2 released channel: ORA_DISK_3 released channel: ORA_DISK_4 RMAN> backup database; Starting backup at 20140125 16:29:00 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=158 devtype=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: sid=147 devtype=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: sid=138 devtype=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: sid=137 devtype=DISK allocated channel: ORA_DISK_5 channel ORA_DISK_5: sid=156 devtype=DISK allocated channel: ORA_DISK_6 channel ORA_DISK_6: sid=155 devtype=DISK allocated channel: ORA_DISK_7 channel ORA_DISK_7: sid=134 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf channel ORA_DISK_1: starting piece 1 at 20140125 16:29:02 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 16:29:02 channel ORA_DISK_3: starting full datafile backupset channel ORA_DISK_3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf channel ORA_DISK_3: starting piece 1 at 20140125 16:29:02 channel ORA_DISK_4: starting full datafile backupset channel ORA_DISK_4: specifying datafile(s) in backupset input datafile fno=00004 name=/oradata/orcl/users01.dbf channel ORA_DISK_4: starting piece 1 at 20140125 16:29:02 channel ORA_DISK_5: starting full datafile backupset channel ORA_DISK_5: specifying datafile(s) in backupset input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel ORA_DISK_5: starting piece 1 at 20140125 16:29:02 channel ORA_DISK_6: starting full datafile backupset channel ORA_DISK_6: specifying datafile(s) in backupset input datafile fno=00007 name=/oradata/orcl/system02.dbf channel ORA_DISK_6: starting piece 1 at 20140125 16:29:02 channel ORA_DISK_6: finished piece 1 at 20140125 16:29:09 piece handle=/oradata/orcl/databak/9qouvdue_1_1 tag=TAG20140125T162902 comment=NONE channel ORA_DISK_6: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_5: finished piece 1 at 20140125 16:29:16 piece handle=/oradata/orcl/databak/9pouvdue_1_1 tag=TAG20140125T162902 comment=NONE channel ORA_DISK_5: backup set complete, elapsed time: 00:00:14 channel ORA_DISK_2: finished piece 1 at 20140125 16:29:19 piece handle=/oradata/orcl/databak/9mouvdue_1_1 tag=TAG20140125T162902 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:17 channel ORA_DISK_4: finished piece 1 at 20140125 16:29:22 piece handle=/oradata/orcl/databak/9oouvdue_1_1 tag=TAG20140125T162902 comment=NONE channel ORA_DISK_4: backup set complete, elapsed time: 00:00:20 channel ORA_DISK_3: finished piece 1 at 20140125 16:29:47 piece handle=/oradata/orcl/databak/9nouvdue_1_1 tag=TAG20140125T162902 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:45 channel ORA_DISK_1: finished piece 1 at 20140125 16:29:54 piece handle=/oradata/orcl/databak/9louvdue_1_1 tag=TAG20140125T162902 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:52 Finished backup at 20140125 16:29:54 Starting Control File and SPFILE Autobackup at 20140125 16:29:54 piece handle=/oradata/orcl/databak/c-1347935162-20140125-12 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 16:29:57 因為只有6個檔案,所以,只實際使用了6個通道。備份時間為57秒(16:29:00至16:29:57),和手工指定6通道時的用時完全一樣。 綜上,我們可以看出,這個並行度的引數與手工指定通道的作用是類似的。只不過一個是由RMAN自動分配,一個由人工指定。 FILESPERSET這個引數又是做什麼用的呢?還是來做實驗。 我們把並行度改回2 RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 7 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored 根據我們前邊做實驗的經驗,如果這時執行backup database;命令,會自動通過兩個通道來備份。 如果我們執行 backup database filesperset 2; 又會是什麼結果呢? RMAN> backup database filesperset 2; Starting backup at 20140125 16:58:48 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=158 devtype=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: sid=147 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel ORA_DISK_1: starting piece 1 at 20140125 16:58:48 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 16:58:48 channel ORA_DISK_2: finished piece 1 at 20140125 16:58:55 piece handle=/oradata/orcl/databak/9vouvfm8_1_1 tag=TAG20140125T165848 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00004 name=/oradata/orcl/users01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 16:58:55 channel ORA_DISK_1: finished piece 1 at 20140125 16:59:40 piece handle=/oradata/orcl/databak/9uouvfm8_1_1 tag=TAG20140125T165848 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:52 channel ORA_DISK_2: finished piece 1 at 20140125 16:59:40 piece handle=/oradata/orcl/databak/a0ouvfmf_1_1 tag=TAG20140125T165848 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:45 Finished backup at 20140125 16:59:40 Starting Control File and SPFILE Autobackup at 20140125 16:59:40 piece handle=/oradata/orcl/databak/c-1347935162-20140125-14 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 16:59:43 看到了嗎,加了filesperset 2 這個引數後,每次每通道只讀取2個數據檔案了。最終6個數據檔案,生成了3個備份檔案。 換句話說,每個備份集裡,最多隻能包含兩個原始檔。如果我們設為 filesperset 1的話,由於一個備份集中只能有1個原始檔,所以,實驗環境下的這6個數據檔案就要生成6個備份集了。 驗證一下: RMAN> backup database filesperset 1; Starting backup at 20140125 17:01:01 using channel ORA_DISK_1 using channel ORA_DISK_2 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf channel ORA_DISK_1: starting piece 1 at 20140125 17:01:01 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 17:01:01 channel ORA_DISK_2: finished piece 1 at 20140125 17:01:08 piece handle=/oradata/orcl/databak/a3ouvfqd_1_1 tag=TAG20140125T170101 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 17:01:08 channel ORA_DISK_1: finished piece 1 at 20140125 17:01:43 piece handle=/oradata/orcl/databak/a2ouvfqd_1_1 tag=TAG20140125T170101 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:42 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00004 name=/oradata/orcl/users01.dbf channel ORA_DISK_1: starting piece 1 at 20140125 17:01:43 channel ORA_DISK_2: finished piece 1 at 20140125 17:01:43 piece handle=/oradata/orcl/databak/a4ouvfqk_1_1 tag=TAG20140125T170101 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:35 channel ORA_DISK_2: starting full datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel ORA_DISK_2: starting piece 1 at 20140125 17:01:43 channel ORA_DISK_1: finished piece 1 at 20140125 17:01:44 piece handle=/oradata/orcl/databak/a5ouvfrn_1_1 tag=TAG20140125T170101 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00007 name=/oradata/orcl/system02.dbf channel ORA_DISK_1: starting piece 1 at 20140125 17:01:44 channel ORA_DISK_2: finished piece 1 at 20140125 17:01:44 piece handle=/oradata/orcl/databak/a6ouvfrn_1_1 tag=TAG20140125T170101 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: finished piece 1 at 20140125 17:01:45 piece handle=/oradata/orcl/databak/a7ouvfro_1_1 tag=TAG20140125T170101 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 20140125 17:01:45 Starting Control File and SPFILE Autobackup at 20140125 17:01:46 piece handle=/oradata/orcl/databak/c-1347935162-20140125-15 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 17:01:47 果然。 現在,我們回過頭來,把當需要備份的檔案個數為質數時,如何在多個通道中分配的實驗做了。 為了滿足這個條件,我們在資料庫中再新增一個表空間,並在該表空間中新增一個數據檔案,從而形成7個數據檔案。 SQL> create tablespace demo datafile '/oradata/orcl/demo01.dbf' size 10M; Tablespace created. SQL> create table demo (id int) tablespace demo; Table created. SQL> insert into demo values(1); 1 row created. SQL> commit; Commit complete. SQL> select file_name,file_id,bytes/1024/1024 "size(M)" from dba_data_files; FILE_NAME FILE_ID size(M) ---------------------------------------- ---------- ---------- /oradata/orcl/system01.dbf 1 400 /oradata/orcl/undotbs01.dbf 2 320 /oradata/orcl/sysaux01.dbf 3 190 /oradata/orcl/users01.dbf 4 21.25 /oradata/orcl/hrtbs01.dbf 5 10 /oradata/orcl/demo01.dbf 6 10 /oradata/orcl/system02.dbf 7 10 7 rows selected. 再回到RMAN中,以手工指定4個通道的方式來進行資料庫備份。 MAN> run { allocate channel c1 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c2 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c3 device type disk format '/oradata/orcl/databak1/%U'; allocate channel c4 device type disk format '/oradata/orcl/databak1/%U'; backup database; release channel c1; release channel c2; release channel c3; release channel c4; }2> 3> 4> 5> 6> 7> 8> 9> 10> 11> released channel: ORA_DISK_1 released channel: ORA_DISK_2 allocated channel: c1 channel c1: sid=158 devtype=DISK allocated channel: c2 channel c2: sid=147 devtype=DISK allocated channel: c3 channel c3: sid=138 devtype=DISK allocated channel: c4 channel c4: sid=137 devtype=DISK Starting backup at 20140125 17:41:56 channel c1: starting full datafile backupset channel c1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf channel c1: starting piece 1 at 20140125 17:41:56 channel c2: starting full datafile backupset channel c2: specifying datafile(s) in backupset input datafile fno=00002 name=/oradata/orcl/undotbs01.dbf input datafile fno=00007 name=/oradata/orcl/system02.dbf channel c2: starting piece 1 at 20140125 17:41:56 channel c3: starting full datafile backupset channel c3: specifying datafile(s) in backupset input datafile fno=00003 name=/oradata/orcl/sysaux01.dbf input datafile fno=00006 name=/oradata/orcl/demo01.dbf channel c3: starting piece 1 at 20140125 17:41:56 channel c4: starting full datafile backupset channel c4: specifying datafile(s) in backupset input datafile fno=00004 name=/oradata/orcl/users01.dbf input datafile fno=00005 name=/oradata/orcl/hrtbs01.dbf channel c4: starting piece 1 at 20140125 17:41:56 channel c4: finished piece 1 at 20140125 17:41:57 piece handle=/oradata/orcl/databak1/agouvi74_1_1 tag=TAG20140125T174156 comment=NONE channel c4: backup set complete, elapsed time: 00:00:01 channel c2: finished piece 1 at 20140125 17:42:12 piece handle=/oradata/orcl/databak1/aeouvi74_1_1 tag=TAG20140125T174156 comment=NONE channel c2: backup set complete, elapsed time: 00:00:16 channel c3: finished piece 1 at 20140125 17:42:27 piece handle=/oradata/orcl/databak1/afouvi74_1_1 tag=TAG20140125T174156 comment=NONE channel c3: backup set complete, elapsed time: 00:00:31 channel c1: finished piece 1 at 20140125 17:42:34 piece handle=/oradata/orcl/databak1/adouvi74_1_1 tag=TAG20140125T174156 comment=NONE channel c1: backup set complete, elapsed time: 00:00:38 Finished backup at 20140125 17:42:34 Starting Control File and SPFILE Autobackup at 20140125 17:42:34 piece handle=/oradata/orcl/databak/c-1347935162-20140125-18 comment=NONE Finished Control File and SPFILE Autobackup at 20140125 17:42:37 released channel: c1 released channel: c2 released channel: c3 released channel: c4 實驗證明,當需備份的檔案數不能均分至多個通道時,RMAN會以一種近似平均的方法來處理。那麼為什麼6個檔案4個通道時,RMAN沒有采用1-1-2-2的方式來使用4個通道呢?個人推測是由於當按這種方式分配時,最多的一個通道上還是要有2個檔案,那麼這時,就不如把6個檔案分配在3個通道上(即2-2-2的分配方式)即節省了通道數,又能保證總體的備份時間不會延長。同時,在進行檔案分配時,檔案的大小,也是其進行分配的一個考慮因素,RMAN會在首先保證各通道處理的檔案個數接近的前提下,使每個通道上分配到的總的檔案大小也儘量均衡。

相關推薦

手工指定CHANNEL設定PARALLELISM引數異同以及FILESPERSET引數作用

感謝大臉貓的實驗分析結果。 下面以實驗的方式,展示在RUN塊中手工指定多通道(CHANNEL,也有稱之為“通道”) 與設定並行度PARALLELISM引數 的異同,以及FILESPERSET引數的作用。 RMAN備份時,為了加快備份的速度,提供了並行處理的方式。一種

面試必問:程序執行緒的異同以及程序間通訊方式

秋招面試必問的題目,感覺今年被問了差不多10次了。 1.程序與執行緒 程序:具有獨立功能的程式關於某個資料集合上的一次執行活動。 執行緒:程序的一個實體。 比喻:一列火車是一個程序,火車的每一節車廂是執行緒。 2.程序與執行緒的聯絡 ①一個執行緒只能屬於一個程序,一個程序

Javascript獲取設定url引數

// 設定 url 中的 QueryString 值 function setUrlParam(url, param, v) { var re = new RegExp("(^|)"+ param +"=([^&]*)(|$)"); var m =

Greenplum/Deepgreen系統配置引數檢視設定

1.檢視系統引數 1)檢視全部引數 可以使用 SHOW ALL 命令來檢視所有系統配置引數的取值,如果是在shell介面,可以執行如下命令: $ psql -c 'show all' -d postgres 如果是在psql介面,可以執行如下命令: pos

Linux查看設定別名

編輯 linu 設定 記得 命令別名 生效 .bashrc 永久 環境變量 1.alias :查看系統中所有的命令別名 2.設定別名 alias 別名=‘原命令‘ 3.刪除別名 unalias 別名 4.使別名永久生效 vi ~/.bashrc 寫

TVS的參數&穩壓管異同對比

str pin 有效 color mage 抗變 src ansi ransient 分為兩個部分:1,TVS與穩壓管的異同;2,TVS與穩壓管的參數講解,並有實際的物料釋例。 TVS與穩壓管異同: TVS=Transient Voltage Suppressor; TVS

PHP中CookieSession的異同以及使用

重寫 不容易 包含 ron pat 指示 修改表 持久 pri Cookie與Session的異同: 一、cookie機制 Cookies是服務器在本地機器上存儲的小段文本並隨每一個請求發送至同一個服務器。IETF RFC 2965 HTTP State Managemen

LINUX系統服務器上搭建DHCP服務,實現兩大基本功能:1,自動分配ip;2,手工指定ip

完成 重啟 釋放 p地址 進行 基本功 blog process 自動 在linux系統服務器上搭建DHCP服務,實現兩大基本功能:1,自動分配ip地址;2,手動指定ip地址。首先準備兩臺虛擬機作為實驗對象,一個linux系統作為服務器,一個windows7系統作為客戶機,

谷歌瀏覽器移動端部分字型大小設定大小不同

問題描述:為了適配各種移動端裝置,動態設定了viewport縮放,然後動態設定html的font-size大小,用rem佈局。但是在谷歌瀏覽器中檢視的時候出現了問題 1.這個沒問題,font-size設定的.28rem,所以換算成px應該是.28*100=28px;OK,沒毛病,但是下面那行

PHP -- 用TP5實現二維碼和logo的生成設定及路徑儲存等

本文利用TP5實現二維碼的生成與設定,logo的新增與設定。 1. 利用 composer 獲取 qr_code 外掛 composer require endroid/qr-code 我用的編譯器是PhpStorm ,所以在下面的Terminal中可以輸入以上命令即可。如下圖:

CNN:ChannelCore的高H、寬W的權值理解

原理 element span href people 位置 clas user erl 轉自: 知乎問題[能否對卷積神經網絡工作原理做一個直觀的解釋?https://www.zhihu.com/question/39022858]中YJango 的回答; 因總是忘記回答地

Java中eclipse命令列向main函式傳遞引數

  我們知道main函式是java程式的入口,main函式的引數型別是String[]。 1.Eclipse中向main方法傳遞引數 例如: public class Mytest { public static void main(String[] args) {

postgres 連線數檢視設定

PG中有一張表記錄著當前有多少連線 表名:pg_stat_activity 查詢當前連線數: select count(1) from pg_stat_activity; 查詢最大連線數 show max_connections; 最大連線數也可以在pg配置檔案

Mysql 拿指定經緯度資料庫多條經緯度進行距離計算

公式如下,單位米: 第一點經緯度:lng1 lat1 第二點經緯度:lng2 lat2 round(6378.138*2*asin(sqrt(pow(sin( (lat1*pi()/180-lat2*pi()/180)/2),2)+cos(lat1*pi()/180)*cos(lat2*pi()/1

FreeSWITCH的SDP讀取設定

在對接第三方SIP客戶端和閘道器時,常常需要修改手工修改SDP資訊。 下面給出設定修改SDP資訊的兩種方法,如下:  - 通過撥號方案修改SDP資訊  - 通過API命令修改SDP資訊 通過撥號方案修改SDP資訊 Edit sdp channel variables by

Zabbix 3.4.10 服務端的安裝設定

  實驗驗目的:  Zabbix 3.x 服務端的安裝 實驗主機:  m01  (centos 7.4)  IP 10.0.0.61/172.16.1.61 1) 配置yum源, 並用wget命令把相關的軟體包下載到本地, 然後再進行安裝, 如下所示

goroutine和channel死鎖詳解

Go語言中有個概念叫做goroutine, 這類似我們熟知的執行緒,但是更輕。 goroutine和執行緒的具體區別在於: 1. OS的執行緒由OS核心排程,每隔幾毫秒,一個硬體時鐘中斷髮到CPU,CPU呼叫一個排程器核心函式。這個函式暫停當前正在執行的執行緒,把他的暫存器資訊儲存到記憶體中

深度理解TTL電平CMOS電平的異同

一:TTL TTL積體電路的主要型式為電晶體-電晶體邏輯閘(Transistor-Transistor Logic gate),TTL採用5V電源。   1. 輸出高電平Uoh和輸出低電平Uol Uoh≥2.4V,   Uol≤

手機端抓包http/https-Fiddler安裝設定代理

注:本教程適合Windows系統使用者。 通過fiddler代理,我們可以抓包手機的網路請求,也可以通過電腦設定host,實現手機訪問測試內網。 準備 1.安裝fiddler,官網下載,下一步安裝 2.手機和電腦在同一區域網下(連同一個wifi或者手機連電腦開的熱點) 3.檢視自

bootstrap模態框手動開啟關閉設定點選外部不關閉

http://www.cnblogs.com/qlqwjy/p/7491054.html   完整的參考菜鳥教程:http://www.runoob.com/bootstrap/bootstrap-modal-plugin.html   1.手動開啟與關閉模態框的方法