[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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL Server Backup & RestoreSQLServerREST
- TFS Express backup and restoreExpressREST
- backup and restore tipsREST
- Cold backup and restore the entire databaseRESTDatabase
- DBMS_BACKUP_RESTORE.DBMS_BACKUP_RESTORE用於特殊情況下的恢復REST
- read only tablespace backup restoreREST
- 轉貼_RMAN-DBMS_BACKUP_RESTOREREST
- db2備份恢復(backup restore)DB2REST
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- Manually Backup - Restore or Clone a Database to Another Node [ID 562556.1]RESTDatabase
- 使用RMAN backup和restore方式部署物理備庫REST
- 備份恢復統計資訊 backup and restore statsREST
- 11g asm md_backup md_restoreASMREST
- 通過dbms_backup_restore修改oracle的dbidRESTOracle
- 【ASM】ASMCMD 之md_backup,md_restore介紹ASMREST
- RMAN-06100: no channel to restore a backup or copy of datafileREST
- cdc目標端資料庫初始化(backup restore)資料庫REST
- 使用dbms_backup_restore進行資料庫恢復REST資料庫
- RMAN-06023 no backup or copy of datafile 1 found to restoreREST
- You may fail to backup log or restore log after TDE certification/key rotation.AIREST
- 【MOS】How to backup or restore OLR in 11.2/12c Grid InfrastructureRESTASTStruct
- backup or restore OLR in 11.2 Grid Infrastructure (Doc ID 1193643.1)RESTASTStruct
- ORA-19550: cannot use backup/restore functions while using dispatcherRESTFunctionWhile
- RMAN : Consistent Backup, Restore and Recovery using RMAN (Doc ID 162855.1)REST
- DBMS_BACKUP_RESTORE用於特殊情況下的恢復REST
- DBMS_BACKUP_RESTORE用於特殊情況下的恢復(轉)REST
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- Oracle rac使用nid和dbms_backup_restore包修改dbid和dbnameOracleREST
- 使用DBMS_BACKUP_RESTORE來還原控制檔案和資料檔案REST
- java-console(NetBackup-Java )只能訪問 “ (Backup, Archive, and Restore)”JavaHiveREST
- 應對 "RMAN-06023: no backup or copy of datafile 1 found to restore"錯誤REST
- oracle 11gR2 asmcmd 工具增加md_backup和md_restore命令OracleASMREST
- 20151101使用dbms_backup_restore刪除檔案REST
- Laravel API throttle 原理分析LaravelAPI
- js之debounce和throttleJS
- 應對RMAN-06026錯誤,使用dbms_backup_restore進行恢復REST
- guarantee restore points-Flashback after RMAN restoreREST
- 由某公司案例進一步掌握rman備份與恢復backup restore recovery系列一REST