[20190510]rman備份的疑問7.txt

来源:https://www.cnblogs.com/lfree/archive/2019/05/10/10843199.html
-Advertisement-
Play Games

[20190510]rman備份的疑問7.txt--//上午測試rman備份時備份文件大小回縮的測試.鏈接:--//http://blog.itpub.net/267265/viewspace-2643804/ => [20190509]rman備份的疑問5.txt --//自己又認真會看自己以前寫 ...


[20190510]rman備份的疑問7.txt

--//上午測試rman備份時備份文件大小回縮的測試.鏈接:
--//http://blog.itpub.net/267265/viewspace-2643804/ => [20190509]rman備份的疑問5.txt
--//自己又認真會看自己以前寫的文章:
--//http://blog.itpub.net/267265/viewspace-2148246/=>[20171204]關於rman備份疑問4.txt
--//突然有所感悟,rman的備份input buffer是否並非完全按照文檔的結束那樣,每個備份文件對應2M.(當文件數量大於4時)
--//而是總的input buffer=16M,然後根據備份文件集的數量平均分配.
--//我前面測試是一個備份集合5個文件的情況,如果一個備份集合3個文件.

--//一個備份集文件數量小於等於4,每個文件分配4個緩存,每個input buffer memory=1M.
--//每個文件input buffer memory 按照 floor(16/N)*1024

--//一個備份集文件數量大於4與小於等於8,每個文件分配4個緩存,每個input buffer memory=512K.
--//按照 floor(16/N*1024/512)*512

--//一個備份集文件數量大於8,每個文件分配4個緩存,每個input buffer memory=512K.
--//按照 floor(16/8*1024)= 2M

--//output buffer 4個,每個1M.

--//比較難表達.還是通過測試說明問題.
--//如果N=3, floor(16/3)1024
--//如果N=5, floor(16/N*1024/512)*512 = 3072.

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

$ cat d3.sql
drop tablespace t01 including contents and datafiles;
drop tablespace t02 including contents and datafiles;
drop tablespace t03 including contents and datafiles;

CREATE TABLESPACE T01 DATAFILE '/mnt/ramdisk/book/T01.dbf' SIZE 11M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T02 DATAFILE '/mnt/ramdisk/book/T02.dbf' SIZE 11M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T03 DATAFILE '/mnt/ramdisk/book/T03.dbf' SIZE 11M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;

create table t01 tablespace t01 as select rownum id ,to_char(rownum,'FM000000')||lpad('A',26,'A') name from dual connect by level<=2e5;
create table t02 tablespace t02 as select rownum id ,to_char(rownum,'FM000000')||lpad('B',26,'B') name from dual connect by level<=2e5;
create table t03 tablespace t03 as select rownum id ,to_char(rownum,'FM000000')||lpad('C',26,'C') name from dual connect by level<=2e5;

alter system checkpoint;
alter system checkpoint;
alter system checkpoint;

--//修改rman配置:
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 512 K;

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 256 K;
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 512 K;
new RMAN configuration parameters are successfully stored
--//主要目的減慢備份速度。這樣2秒讀取1M.

RMAN> 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> CONFIGURE CONTROLFILE AUTOBACKUP OFF;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

RMAN> report schema;

Report of database schema for database with db_unique_name BOOK

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    760      SYSTEM               ***     /mnt/ramdisk/book/system01.dbf
2    1160     SYSAUX               ***     /mnt/ramdisk/book/sysaux01.dbf
3    865      UNDOTBS1             ***     /mnt/ramdisk/book/undotbs01.dbf
4    128      USERS                ***     /mnt/ramdisk/book/users01.dbf
5    346      EXAMPLE              ***     /mnt/ramdisk/book/example01.dbf
6    6        TEA                  ***     /mnt/ramdisk/book/tea01.dbf
7    16       UNDOTBS1             ***     /mnt/ramdisk/book/undotbs02.dbf
8    16       UNDOTBS1             ***     /mnt/ramdisk/book/undotbs03.dbf
9    11       T01                  ***     /mnt/ramdisk/book/T01.dbf
10   11       T02                  ***     /mnt/ramdisk/book/T02.dbf
11   11       T03                  ***     /mnt/ramdisk/book/T03.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    414      TEMP                 4096        /mnt/ramdisk/book/temp01.dbf

2.測試腳本:
--//測試備份3個數據文件的作為一個備份集合的情況:

$ cat t3.sh
#! /bin/bash
rman target / <<EOF  >> /tmp/t6.txt &
backup  datafile 9,10,11 format '/home/oracle/backup/t123_%t_%U' ;
quit
EOF
echo "sleep $1  "
sleep $1
sqlplus -s scott/book <<EOF
set numw 12
update t01 set name=lower(name) where mod(id,100)=0;
update t02 set name=lower(name) where mod(id,100)=0;
update t03 set name=lower(name) where mod(id,100)=0;
commit;
alter system checkpoint;
alter system checkpoint;
alter system checkpoint;
alter system checkpoint;
@ &r/scn
EOF

--//備份時手工執行如下命令:
--//$ echo -e  'aaaaa\n' 'bbbbb\n' 'ccccc\n' | xargs  -I{} -P 3 bash -c "strings -t d /home/oracle/backup/t123_* | grep {} | head -1" | sort -n

--//如果在一個備份集3個數據文件,每個數據文件前面1M是os,文件頭,點陣圖區.需要2秒完成(前面我設置disk rate 512).這樣至少6秒才讀取到表數據.
--//我分別測試延遲1,2,3,4,5的情況,實際上你可以不用等備份結束(當然備份文件集也不存在了,我按ctrl+c中斷).
--//只要出現小寫aaaaa,bbbbb,ccccc就ok了.
--//註意每次測試完成,執行d3.txt腳本,刪除重新建立表空間等,重新測試.

3.測試:
$ . t3.sh 1
--//$ echo -e  'aaaaa\n' 'bbbbb\n' 'ccccc\n' | xargs  -I{} -P 3 bash -c "strings -t d /home/oracle/backup/t123_* | grep {} | head -1" | sort -n
3150022  000100aaaaaaaaaaaaaaaaaaaaaaaaaa,
4198598  000100bbbbbbbbbbbbbbbbbbbbbbbbbb,
5247174  000100cccccccccccccccccccccccccc,

$ . t3.sh 2
5247174  000100cccccccccccccccccccccccccc,
16771561        & 083700bbbbbbbbbbbbbbbbbbbbbbbbbb,
18871501 1 104800aaaaaaaaaaaaaaaaaaaaaaaaaa,

$ . t3.sh 3
5247174  000100cccccccccccccccccccccccccc,
16771561        & 083700bbbbbbbbbbbbbbbbbbbbbbbbbb,
18871501 1 104800aaaaaaaaaaaaaaaaaaaaaaaaaa,

$ . t3.sh 4
17820137        & 083700cccccccccccccccccccccccccc,
18871501 1 104800aaaaaaaaaaaaaaaaaaaaaaaaaa,
19920077 1 104800bbbbbbbbbbbbbbbbbbbbbbbbbb,

$ . t3.sh 5
 $ echo -e  'aaaaa\n' 'bbbbb\n' 'ccccc\n' | xargs  -I{} -P 3 bash -c "strings -t d /home/oracle/backup/t123_* | grep {} | head -1" | sort -n
17820137        & 083700cccccccccccccccccccccccccc,
18871501 1 104800aaaaaaaaaaaaaaaaaaaaaaaaaa,
19920077 1 104800bbbbbbbbbbbbbbbbbbbbbbbbbb,

--//實際上查詢如下也可以確定:
  SELECT set_count
        ,device_type
        ,TYPE
        ,filename
        ,buffer_size
        ,buffer_count
        ,open_time
        ,close_time
    FROM v$backup_async_io
   WHERE set_count = 78
ORDER BY set_count
        ,TYPE
        ,open_time
        ,close_time;

SET_COUNT DEVICE_TYPE TYPE      FILENAME                                           BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME
--------- ----------- --------- -------------------------------------------------- ----------- ------------ ------------------- -------------------
       78 DISK        AGGREGATE                                                              0            0 2019-05-10 09:50:08 2019-05-10 09:51:14
       78 DISK        INPUT     /mnt/ramdisk/book/T01.dbf                              1048576            5 2019-05-10 09:50:08 2019-05-10 09:51:14
       78 DISK        INPUT     /mnt/ramdisk/book/T02.dbf                              1048576            5 2019-05-10 09:50:08 2019-05-10 09:51:14
       78 DISK        INPUT     /mnt/ramdisk/book/T03.dbf                              1048576            5 2019-05-10 09:50:10 2019-05-10 09:51:14
       78 DISK        OUTPUT    /home/oracle/backup/t123_1007891408_2eu16cug_1_1       1048576            4 2019-05-10 09:50:08 2019-05-10 09:51:14
--//註意OPEN_TIME(filename=/mnt/ramdisk/book/T03.dbf).自己真笨!!根本不需要這麼複雜的分析.每個輸入緩存的總數量就是5.
--//輸出緩存的總數量就是4.每個1M.
--//順便附上rman的記錄:
RMAN>
Starting backup at 2019-05-10 09:50:07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=212 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=00009 name=/mnt/ramdisk/book/T01.dbf
input datafile file number=00010 name=/mnt/ramdisk/book/T02.dbf
input datafile file number=00011 name=/mnt/ramdisk/book/T03.dbf
channel ORA_DISK_1: starting piece 1 at 2019-05-10 09:50:08
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
channel ORA_DISK_1: finished piece 1 at 2019-05-10 09:51:23
piece handle=/home/oracle/backup/t123_1007891408_2eu16cug_1_1 tag=TAG20190510T095007 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: throttle time: 0:01:06
Finished backup at 2019-05-10 09:51:23
--//備份啟動2019-05-10 09:50:08,而 /mnt/ramdisk/book/T03.dbf的打開是延遲了2秒(OPEN_TIME=2019-05-10 09:50:10)

4.分析:
--//字母a b c 前數字對應id,行號.註意看的數字:100,83700,104800僅僅出現3種.表的建立方式一樣的,出現在塊中位置也應該一樣.
COTT@book> select DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid) block ,t01.* from t01 where id in (100,83700,104800);
     BLOCK         ID NAME
---------- ---------- ----------------------------------------
       131        100 000100aaaaaaaaaaaaaaaaaaaaaaaaaa
       642      83700 083700aaaaaaaaaaaaaaaaaaaaaaaaaa
       770     104800 104800aaaaaaaaaaaaaaaaaaaaaaaaaa

--//131*8192/1024/1024=1.0234375 0.0234375*1024*1024/8192 = 3
--//為什麼是3,因為128,129,130 都是assm的點陣圖區.130是段頭(三級點陣圖).也就是131前面3塊沒有aaaa字元串.
SCOTT@book> select SEGMENT_NAME,HEADER_FILE,HEADER_BLOCK from dba_segments where segment_name='T01';
SEGMENT_NAME         HEADER_FILE HEADER_BLOCK
-------------------- ----------- ------------
T01                            9          130

--//642*8192/1024/1024 = 5.01562500000000000000, 0.015625*1024*1024/8192 = 2
--//770*8192/1024/1024 = 6.01562500000000000000  0.015625*1024*1024/8192 = 2

--//畫一個表格(出現小寫首次位置在數據文件中):
延遲時間     t01    t02   t03
------------------------------
1             1     1       1
2             6     5       1
3             6     5       1
4             6     6       5
5             6     6       5
------------------------------

--//總之不是一上來各個緩存全部裝滿,而是慢慢平衡到每個文件5M的input buffer.

--//我自己測試6個數據文件的情況:
  SELECT set_count
        ,device_type
        ,TYPE
        ,filename
        ,buffer_size
        ,buffer_count
        ,open_time
        ,close_time
    FROM v$backup_async_io
   where set_count=79
ORDER BY set_count
        ,TYPE
        ,open_time
        ,close_time;

 SET_COUNT DEVICE_TYPE TYPE      FILENAME                                            BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME
---------- ----------- --------- --------------------------------------------------- ----------- ------------ ------------------- -------------------
        79 DISK        AGGREGATE                                                              0            0 2019-05-10 10:08:58 2019-05-10 10:10:10
        79 DISK        INPUT     /mnt/ramdisk/book/T01.dbf                               524288            5 2019-05-10 10:08:58 2019-05-10 10:10:10
        79 DISK        INPUT     /mnt/ramdisk/book/T02.dbf                               524288            5 2019-05-10 10:08:58 2019-05-10 10:10:10
        79 DISK        INPUT     /mnt/ramdisk/book/T03.dbf                               524288            5 2019-05-10 10:08:59 2019-05-10 10:10:10
        79 DISK        INPUT     /mnt/ramdisk/book/T04.dbf                               524288            5 2019-05-10 10:09:00 2019-05-10 10:10:10
        79 DISK        INPUT     /mnt/ramdisk/book/T05.dbf                               524288            5 2019-05-10 10:09:01 2019-05-10 10:10:10
        79 DISK        INPUT     /mnt/ramdisk/book/T06.dbf                               524288            5 2019-05-10 10:09:02 2019-05-10 10:10:10
        79 DISK        OUTPUT    /home/oracle/backup/t123456_1007892538_2fu16e1q_1_1     1048576           4 2019-05-10 10:08:58 2019-05-10 10:10:10
8 rows selected.
--//512k*5=2.5M.

--//5個數據文件的情況:
SET_COUNT DEVICE_TYPE TYPE      FILENAME                                             BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME
--------- ----------- --------- ---------------------------------------------------- ----------- ------------ ------------------- -------------------
       80 DISK        AGGREGATE                                                                0            0 2019-05-10 10:12:34 2019-05-10 10:13:34
       80 DISK        INPUT     /mnt/ramdisk/book/T01.dbf                                 524288            6 2019-05-10 10:12:34 2019-05-10 10:13:34
       80 DISK        INPUT     /mnt/ramdisk/book/T02.dbf                                 524288            6 2019-05-10 10:12:34 2019-05-10 10:13:34
       80 DISK        INPUT     /mnt/ramdisk/book/T03.dbf                                 524288            6 2019-05-10 10:12:35 2019-05-10 10:13:34
       80 DISK        INPUT     /mnt/ramdisk/book/T04.dbf                                 524288            6 2019-05-10 10:12:36 2019-05-10 10:13:34
       80 DISK        INPUT     /mnt/ramdisk/book/T05.dbf                                 524288            6 2019-05-10 10:12:37 2019-05-10 10:13:34
       80 DISK        OUTPUT    /home/oracle/backup/t123456_1007892754_2gu16e8i_1_1      1048576            4 2019-05-10 10:12:34 2019-05-10 10:13:34
7 rows selected.
--//註意看OPEN_TIME時間. 512k*6=3M.

--//10個數據文件的情況:
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 512 K;
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1

SET_COUNT DEVICE_TYPE TYPE      FILENAME                                             BUFFER_SIZE BUFFER_COUNT OPEN_TIME           CLOSE_TIME
--------- ----------- --------- ---------------------------------------------------- ----------- ------------ ------------------- -------------------
       82 DISK        AGGREGATE                                                                0            0 2019-05-10 10:28:00 2019-05-10 10:30:00
       82 DISK        INPUT     /mnt/ramdisk/book/T01.dbf                                 524288            4 2019-05-10 10:28:00 2019-05-10 10:29:36
       82 DISK        INPUT     /mnt/ramdisk/book/T02.dbf                                 524288            4 2019-05-10 10:28:00 2019-05-10 10:29:37
       82 DISK        INPUT     /mnt/ramdisk/book/T03.dbf                                 524288            4 2019-05-10 10:28:01 2019-05-10 10:29:38
       82 DISK        INPUT     /mnt/ramdisk/book/T04.dbf                                 524288            4 2019-05-10 10:28:02 2019-05-10 10:29:38
       82 DISK        INPUT     /mnt/ramdisk/book/T05.dbf                                 524288            4 2019-05-10 10:28:03 2019-05-10 10:29:38
       82 DISK        INPUT     /mnt/ramdisk/book/T06.dbf                                 524288            4 2019-05-10 10:28:04 2019-05-10 10:29:38
       82 DISK        INPUT     /mnt/ramdisk/book/T07.dbf                                 524288            4 2019-05-10 10:28:05 2019-05-10 10:29:38
       82 DISK        INPUT     /mnt/ramdisk/book/T08.dbf                                 524288            4 2019-05-10 10:28:06 2019-05-10 10:29:38
       82 DISK        INPUT     /mnt/ramdisk/book/T09.dbf                                 524288            4 2019-05-10 10:29:36 2019-05-10 10:30:00
       82 DISK        INPUT     /mnt/ramdisk/book/T10.dbf                                 524288            4 2019-05-10 10:29:37 2019-05-10 10:30:00
       82 DISK        OUTPUT    /home/oracle/backup/ta_1007893680_2iu16f5g_1_1           1048576            4 2019-05-10 10:28:00 2019-05-10 10:30:00
12 rows selected.
--//512k*4=2M.
--//你可以T09,T10的備份分別是2019-05-10 10:29:36,2019-05-10 10:29:37開始的.你可以看出大於8個文件備份的情況.
--//先備份8個完成後在備份剩餘2個,並且不會因為最後剩下2個改變BUFFER_SIZE的大小.
--//順便說一下書中講的大於8個數據文件的備份不對.
--//鏈接中提到的http://blog.itpub.net/267265/viewspace-2147878/文檔:
■ If the number of files being multiplexed is greater than eight, then RMAN allocates four
   buffers of size 128KB. This ensures that each file being backed up will account for 512KB
   of buffer memory.
--//這個不對.沒有128K的input buffer memory.

$ strings /home/oracle/backup/ta_1007893680_2iu16f5g_1_1 | tr 'abcdefghij' 'ABCDEFGHIJK' | egrep 'AAAAA|BBBBB|CCCCC|DDDDD|EEEE|FFFF|FFFF|GGGG|HHHH|IIII|JJJJ'| cut -c20-30 | uniq -c
   9978 AAAAAAAAAAA
   9978 BBBBBBBBBBB
   9978 CCCCCCCCCCC
   9978 DDDDDDDDDDD
   9978 EEEEEEEEEEE
   9978 FFFFFFFFFFF
   9978 GGGGGGGGGGG
   9978 HHHHHHHHHHH
  10080 AAAAAAAAAAA
  10080 BBBBBBBBBBB
  10080 CCCCCCCCCCC
  10080 DDDDDDDDDDD
  10080 EEEEEEEEEEE
  10080 FFFFFFFFFFF
  10080 GGGGGGGGGGG
  10080 HHHHHHHHHHH
  10416 AAAAAAAAAAA
  10416 BBBBBBBBBBB
  10416 CCCCCCCCCCC
  10416 DDDDDDDDDDD
  10416 EEEEEEEEEEE
  10416 FFFFFFFFFFF
  10416 GGGGGGGGGGG
  10416 HHHHHHHHHHH
  10752 AAAAAAAAAAA
  10752 BBBBBBBBBBB
  10752 CCCCCCCCCCC
  10752 DDDDDDDDDDD
  10752 EEEEEEEEEEE
  10752 FFFFFFFFFFF
  10752 GGGGGGGGGGG
  10752 HHHHHHHHHHH
  10416 AAAAAAAAAAA
  10416 BBBBBBBBBBB
  10416 CCCCCCCCCCC
  10416 DDDDDDDDDDD
  10416 EEEEEEEEEEE
  10416 FFFFFFFFFFF
  10416 GGGGGGGGGGG
  10416 HHHHHHHHHHH
  10752 AAAAAAAAAAA
  10752 BBBBBBBBBBB
  10752 CCCCCCCCCCC
  10752 DDDDDDDDDDD
  10752 EEEEEEEEEEE
  10752 FFFFFFFFFFF
  10752 GGGGGGGGGGG
  10752 HHHHHHHHHHH
  10416 AAAAAAAAAAA
  10416 BBBBBBBBBBB
  10416 CCCCCCCCCCC
  10416 DDDDDDDDDDD
  10416 EEEEEEEEEEE
  10416 FFFFFFFFFFF
  10416 GGGGGGGGGGG
  10416 HHHHHHHHHHH
  10752 AAAAAAAAAAA
  10752 BBBBBBBBBBB
  10752 CCCCCCCCCCC
  10752 DDDDDDDDDDD
  10752 EEEEEEEEEEE
  10752 FFFFFFFFFFF
  10752 GGGGGGGGGGG
  10752 HHHHHHHHHHH
  10416 AAAAAAAAAAA
  10416 BBBBBBBBBBB
  10416 CCCCCCCCCCC
  10416 DDDDDDDDDDD
  10416 EEEEEEEEEEE
  10416 FFFFFFFFFFF
  10416 GGGGGGGGGGG
  10416 HHHHHHHHHHH
   6022 AAAAAAAAAAA
   6022 BBBBBBBBBBB
   6022 CCCCCCCCCCC
   6022 DDDDDDDDDDD
   6022 EEEEEEEEEEE
   6022 FFFFFFFFFFF
   6022 GGGGGGGGGGG
   6022 HHHHHHHHHHH
   9978 IIIIIIIIIII
   9978 JJJJJJJJJJJ
  10080 IIIIIIIIIII
  10080 JJJJJJJJJJJ
  10416 IIIIIIIIIII
  10416 JJJJJJJJJJJ
  10752 IIIIIIIIIII
  10752 JJJJJJJJJJJ
  10416 IIIIIIIIIII
  10416 JJJJJJJJJJJ
  10752 IIIIIIIIIII
  10752 JJJJJJJJJJJ
  10416 IIIIIIIIIII
  10416 JJJJJJJJJJJ
  10752 IIIIIIIIIII
  10752 JJJJJJJJJJJ
  10416 IIIIIIIIIII
  10416 JJJJJJJJJJJ
   6022 IIIIIIIIIII
   6022 JJJJJJJJJJJ
--//可以發現T09,T10是最後備份的,這也是我強調設置的filesperset最大=8,小數據可以選擇4.
--//不然如果單獨恢復T09,T10會做大量的無用功.讀取前面大量的無關信息.

5.測試腳本如下:
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK  clear;
old RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 512 K;
old RMAN configuration parameters are successfully deleted
released channel: ORA_DISK_1

--//d10.sql
$ cat d10.sql
drop tablespace t01 including contents and datafiles;
drop tablespace t02 including contents and datafiles;
drop tablespace t03 including contents and datafiles;
drop tablespace t04 including contents and datafiles;
drop tablespace t05 including contents and datafiles;
drop tablespace t06 including contents and datafiles;

CREATE TABLESPACE T01 DATAFILE '/mnt/ramdisk/book/T01.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T02 DATAFILE '/mnt/ramdisk/book/T02.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T03 DATAFILE '/mnt/ramdisk/book/T03.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T04 DATAFILE '/mnt/ramdisk/book/T04.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T05 DATAFILE '/mnt/ramdisk/book/T05.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T06 DATAFILE '/mnt/ramdisk/book/T06.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T07 DATAFILE '/mnt/ramdisk/book/T07.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T08 DATAFILE '/mnt/ramdisk/book/T08.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T09 DATAFILE '/mnt/ramdisk/book/T09.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;
CREATE TABLESPACE T10 DATAFILE '/mnt/ramdisk/book/T10.dbf' SIZE 6M AUTOEXTEND OFF LOGGING ONLINE EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;

create table t01 tablespace t01 as select rownum id ,to_char(rownum,'FM000000')||lpad('A',26,'A') name from dual connect by level<=1e5;
create table t02 tablespace t02 as select rownum id ,to_char(rownum,'FM000000')||lpad('B',26,'B') name from dual connect by level<=1e5;
create table t03 tablespace t03 as select rownum id ,to_char(rownum,'FM000000')||lpad('C',26,'C') name from dual connect by level<=1e5;
create table t04 tablespace t04 as select rownum id ,to_char(rownum,'FM000000')||lpad('D',26,'D') name from dual connect by level<=1e5;
create table t05 tablespace t05 as select rownum id ,to_char(rownum,'FM000000')||lpad('E',26,'E') name from dual connect by level<=1e5;
create table t06 tablespace t06 as select rownum id ,to_char(rownum,'FM000000')||lpad('F',26,'F') name from dual connect by level<=1e5;
create table t07 tablespace t07 as select rownum id ,to_char(rownum,'FM000000')||lpad('G',26,'G') name from dual connect by level<=1e5;
create table t08 tablespace t08 as select rownum id ,to_char(rownum,'FM000000')||lpad('H',26,'H') name from dual connect by level<=1e5;
create table t09 tablespace t09 as select rownum id ,to_char(rownum,'FM000000')||lpad('I',26,'I') name from dual connect by level<=1e5;
create table t10 tablespace t10 as select rownum id ,to_char(rownum,'FM000000')||lpad('J',26,'J') name from dual connect by level<=1e5;

alter system checkpoint;
alter system checkpoint;
alter system checkpoint;


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • Redis 有 string、list、set、zset、hash數據類型。string類型是最基礎的,其他類型都是在string類型上去建立的,所以瞭解熟悉string類型的常用操作對於學習redis非常必要。 APPEND:向鍵的值後面追加字元串,並且返回追加後的值長度 SETBIT:設置或清除 ...
  • sql語句其實不難,尤其對於那些英語稍好一些的人來說! 最最最重要的就是搞清楚sql語句的執行順序!!!數據就像沙子, 語句就是篩子, 沙子按照順序經過給定的篩子,留下來的就是你要的!!! 並不是寫在前面的就先執行!!! 如下: SELECT *, SUM(pnum) '商品總數量' (4) FRO ...
  • 介紹 可用於獲取關於 ResultSet 對象中列的類型和屬性信息的對象,在持久框層框架(如:mybatis, hibernate)中被廣泛的應用。 常用方法 int getColumnCount() 返回此 ResultSet 對象中的列數 String getColumnLabel(int co ...
  • 很多人都知道大數據很火,就業很好,薪資很高,想往大數據方向發展。但該學哪些技術,學習路線是什麼樣的呢? 其實就是想告訴你的大數據的三個發展方向,平臺搭建/優化/運維/監控、大數據開發/設計/架構、數據分析/挖掘。請不要問我哪個好學,哪個錢多。 先說一下大數據的4V特征: 數據量大,TB->PB 數據 ...
  • 指定一個日期,獲取其所屬周的開始日期和結束日期。以及前一周和後一周的開始日期和結束日期。 Insus.NET把這個功能寫成一個自定義函數Table-values Functions。 如何使用上面這個函數,列舉例子說明: ...
  • 安裝步驟可借鑒https://www.cnblogs.com/qfb620/p/4577255.html 1、安裝後發現用Navicat無法連接資料庫顯示報錯ORA-28547:connection to server failed,probable Oracle Net admin error 上 ...
  • 進銷存的訂單表設計這裡只討論最簡單的業務流程,採購申請等業務流程不考慮包括主表(表頭)和子表(明細表)主表:主要信息包括單據流水編碼、供應商信息、訂單類型、單據日期、制單人等等子表:主要信息是物料、數量以及價格主表相關設計如下()子表相關設計如下 ...
  • 最近發現一個非常奇怪的阻塞問題,如下截圖所示(來自監控工具DPA),會話583被會話1036阻塞,而且阻塞發生在tempdb,被阻塞的SQL如下截圖所示,會話等待類型為LCK_M_S 因為DPA工具不好截取全部信息,使用下麵SQL語句獲取了阻塞會話的詳細信息如下,來自Microsoft SQL Se... ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...