[20190228]Backup Restore Throttle sleep.txt
[20190228]Backup Restore Throttle sleep.txt
--//別人的系統提供awr報表,看一下發現Backup Restore Throttle sleep等待事件.找到如下連結:
--//http://blog.itpub.net/28211342/viewspace-2141191/=>rman備份產生等待事件.
--//檢查後面的引數resource_manager_plan非空,估計resource_manager_plan對磁碟有一定限制,導致出現該等待事件.
--//從字面上裡面,感覺限制rman備份的速率也可以重演該等待事件,測試看看.
1.環境:
SYS@book> @ 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
--//修改rman配置如下:
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 3 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 CHANNEL 1 DEVICE TYPE DISK clear ;
2.測試:
RMAN> backup as copy datafile 1 format '/u01/backup/%b';
Starting backup at 2019-02-28 16:38:28
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=94 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/mnt/ramdisk/book/system01.dbf
--//慢
SYS@book> @ wait
P1RAW P2RAW P3RAW P1 P2 P3 SID SERIAL# SEQ# EVENT STATUS STATE WAIT_TIME_MICRO SECONDS_IN_WAIT WAIT_CLASS
---------------- ---------------- ----- -- --- --- ---- ------- ---- ----------------------------- -------- ------- --------------- --------------- ----------
000000000000005E 000000000000000B 00 94 11 0 94 11 3127 Backup Restore Throttle sleep ACTIVE WAITING 913277 1 Other
SYS@book> @ wait
P1RAW P2RAW P3RAW P1 P2 P3 SID SERIAL# SEQ# EVENT STATUS STATE WAIT_TIME_MICRO SECONDS_IN_WAIT WAIT_CLASS
---------------- ---------------- ----- -- --- --- ---- ------- ---- ----------------------------- -------- ------- --------------- --------------- ----------
000000000000005E 000000000000000B 00 94 11 0 94 11 3129 Backup Restore Throttle sleep ACTIVE WAITING 400255 0 Other
--//可以發現出現Backup Restore Throttle sleep等待事件,也就是講限制磁碟IO也會導致該等待事件.
user interrupt received
Finished backup at 2019-02-28 16:42:30
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03099: job cancelled at user request
--//太慢了,取消操作.
3.擴充套件知識:
--//我有看一些連結,發現dbms_backup_restore包裡面自帶一個sleep函式.
--//估計呼叫這個函式也能演示出這個等待事件.
SYS@book> @ desc_proc sys DBMS_BACKUP_RESTORE SLEEP
OWNER PACKAGE_NAME OBJECT_NAME SEQUENCE ARGUMENT_NAME DATA_TYPE IN_OUT DEFAULTED
---------- -------------------- ----------- -------- -------------------- -------------------- --------- ----------
SYS DBMS_BACKUP_RESTORE SLEEP 1 SECS BINARY_INTEGER IN N
--//執行如下:
SYS@book> exec sys.DBMS_BACKUP_RESTORE.SLEEP( 100 );
...
--//開啟新回話:
SYS@book> @ wait
P1RAW P2RAW P3RAW P1 P2 P3 SID SERIAL# SEQ# EVENT STATUS STATE WAIT_TIME_MICRO SECONDS_IN_WAIT WAIT_CLASS
---------------- ---------------- ----- -- -- --- ---- ------- ----- ----------------------------- -------- ------- --------------- --------------- ----------
0000000000000036 0000000000000047 00 54 71 0 54 71 40 Backup Restore Throttle sleep ACTIVE WAITING 1343560 1 Other
--//估計正確.
4.跟蹤rman看看:
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 20M;
old RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 10 M;
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK RATE 20 M;
new RMAN configuration parameters are successfully stored
$ strace -fttx -o /tmp/a1 rman target /
RMAN> backup as copy datafile 1 format '/u01/backup/%b_o';
Starting backup at 2019-03-01 09:00:21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=54 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/mnt/ramdisk/book/system01.dbf
output file name=/u01/backup/system01.dbf_o tag=TAG20190301T090022 RECID=21 STAMP=1001754060
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: throttle time: 0:00:34
channel ORA_DISK_1: starting datafile copy
copying current control file
channel ORA_DISK_1: throttle time: 0:00:34
$ grep 'nanosleep(' /tmp/a1 | cut -f1 -d" " | sort | uniq -c
7 16036
34 16053
--//程式16053,呼叫 nanosleep({1, 0}, NULL) = 0,34次(也就是34秒),與rman的輸出一致.
--//跟蹤如何呼叫有點蠻煩放棄!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2637256/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DBMS_BACKUP_RESTORE.DBMS_BACKUP_RESTORE用於特殊情況下的恢復REST
- db2備份恢復(backup restore)DB2REST
- cdc目標端資料庫初始化(backup restore)資料庫REST
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- You may fail to backup log or restore log after TDE certification/key rotation.AIREST
- Oracle rac使用nid和dbms_backup_restore包修改dbid和dbnameOracleREST
- DBMS_BACKUP_RESTORE用於特殊情況下的恢復(轉)REST
- guarantee restore points-Flashback after RMAN restoreREST
- canvas restore()CanvasREST
- 20190228 學習筆記——廖雪峰 git筆記Git
- SQLBackupAndFTP12.0 failed to backup database with full backup typeSQLFTPAIDatabase
- canvas save()和restore()CanvasREST
- DOCKER特性 - LIVE RESTOREDockerREST
- Laravel API throttle 原理分析LaravelAPI
- 基於Nodejs的前端灰度釋出方案_20190228NodeJS前端
- md_backup
- debounce(防抖) & throttle(節流)
- [LeetCode] 93. Restore IP AddressesLeetCodeREST
- git操作之二:git restoreGitREST
- provider for back&restore app datyaIDERESTAPP
- Using V$BACKUP_ASYNC_IO / V$BACKUP_SYNC_IO to Monitor RMAN PerformanceORM
- 【每日一包0020】throttle-debounce
- 前端效能優化之節流-throttle前端優化
- python leetcode 93. Restore IP AddressesPythonLeetCodeREST
- git restore極簡使用記錄GitREST
- Crunchy PostgreSQL database restore via pgo commandSQLDatabaseRESTGo
- Reboot Restore Rx Pro中文版bootREST
- BACKUP PENDING狀態的解除
- milvus-backup安裝部署
- recover database using backup controlfile理解Database
- Veritas Backup Exec™ 21.3 Multilingual (Windows)Windows
- 函式防抖debounce與節流throttle函式
- 理解並優化函式節流Throttle優化函式
- Lumen 使用 throttle 限制介面訪問頻率
- 【譯】通過例子解釋 Debounce 和 Throttle
- 節流函式throttle是什麼鬼?函式
- 效能優化之節流函式---throttle優化函式
- 實現圖片懶載入(throttle, debounce)