Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3693446
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

分类: Oracle

2021-11-11 20:55:28

如果怀疑rman性能问题

  1. REM -------------------------------
  2. REM Script to monitor rman backup/restore operations
  3. REM To run from sqlplus: @monitor ''
  4. REM Example:
  5. --SQL>spool monitor.out
  6. --SQL>@monitor 'yyyy-mm-dd 16:38:03'
  7. REM where <date> is the start time of your rman backup or restore job
  8. REM Run monitor script periodically to confirm rman is progessing
  9. REM -------------------------------

  10. alter session set nls_date_format='dd-mon-rr hh24:mi:ss';
  11. set lines 1500
  12. set pages 100
  13. col CLI_INFO format a10
  14. col spid format a5
  15. col ch format a20
  16. col seconds format 999999.99
  17. col filename format a65
  18. col bfc format 9
  19. col "% Complete" format 999.99
  20. col event format a40
  21. set numwidth 10

  22. select sysdate from dual;

  23. REM gv$session_longops (channel level)

  24. prompt
  25. prompt Channel progress - gv$session_longops:
  26. prompt
  27. select s.inst_id, o.sid, CLIENT_INFO ch, context, sofar, totalwork,
  28.                     round(sofar/totalwork*100,2) "% Complete"
  29.      FROM gv$session_longops o, gv$session s
  30.      WHERE opname LIKE 'RMAN%'
  31.      AND opname NOT LIKE '%aggregate%'
  32.      AND o.sid=s.sid
  33.      AND totalwork != 0
  34.      AND sofar <> totalwork;

  35. REM Check wait events (RMAN sessions) - this is for CURRENT waits only
  36. REM use the following for 11G+
  37. prompt
  38. prompt Session progess - CURRENT wait events and time in wait so far:
  39. prompt
  40. select inst_id, sid, CLIENT_INFO ch, seq#, event, state, wait_time_micro/1000000 seconds
  41. from gv$session where program like '%rman%' and
  42. wait_time = 0 and
  43. not action is null;

  44. REM use the following for 10G
  45. --select inst_id, sid, CLIENT_INFO ch, seq#, event, state, seconds_in_wait secs
  46. --from gv$session where program like '%rman%' and
  47. --wait_time = 0 and
  48. --not action is null;

  49. REM gv$backup_async_io
  50. prompt
  51. prompt Disk (file and backuppiece) progress - includes tape backuppiece
  52. prompt if backup_tape_io_slaves=TRUE:
  53. prompt
  54. select s.inst_id, a.sid, CLIENT_INFO Ch, a.STATUS,
  55. open_time, round(BYTES/1024/1024,2) "SOFAR Mb" , round(total_bytes/1024/1024,2)
  56. TotMb, io_count,
  57. round(BYTES/TOTAL_BYTES*100,2) "% Complete" , a.type, filename
  58. from gv$backup_async_io a, gv$session s
  59. where not a.STATUS in ('UNKNOWN')
  60. and a.sid=s.sid and open_time > to_date('&1', 'yyyy-mm-dd hh24:mi:ss') order by 2,7;

  61. REM gv$backup_sync_io
  62. prompt
  63. prompt Tape backuppiece progress (only if backup_tape_io_slaves=FALSE):
  64. prompt
  65. select s.inst_id, a.sid, CLIENT_INFO Ch, filename, a.type, a.status, buffer_size bsz, buffer_count bfc,
  66. open_time open, io_count
  67. from gv$backup_sync_io a, gv$session s
  68. where
  69. a.sid=s.sid and
  70. open_time > to_date('&1', 'yyyy-mm-dd hh24:mi:ss') ;
  71. REM -------------------------------


调用方法
SQL> @mon '2021-11-11 20:30:00'
这个时间表示备份开始的大致时间即可,可多次执行。
阅读(956) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~