如果怀疑rman性能问题
-
rem -------------------------------
-
rem script to monitor rman backup/restore operations
-
rem to run from sqlplus: @monitor ''
-
rem example:
-
--sql>spool monitor.out
-
--sql>@monitor 'yyyy-mm-dd 16:38:03'
-
rem where <date> is the start time of your rman backup or restore job
-
rem run monitor script periodically to confirm rman is progessing
-
rem -------------------------------
-
-
alter session set nls_date_format='dd-mon-rr hh24:mi:ss';
-
set lines 1500
-
set pages 100
-
col cli_info format a10
-
col spid format a5
-
col ch format a20
-
col seconds format 999999.99
-
col filename format a65
-
col bfc format 9
-
col "% complete" format 999.99
-
col event format a40
-
set numwidth 10
-
-
select sysdate from dual;
-
-
rem gv$session_longops (channel level)
-
-
prompt
-
prompt channel progress - gv$session_longops:
-
prompt
-
select s.inst_id, o.sid, client_info ch, context, sofar, totalwork,
-
round(sofar/totalwork*100,2) "% complete"
-
from gv$session_longops o, gv$session s
-
where opname like 'rman%'
-
and opname not like '%aggregate%'
-
and o.sid=s.sid
-
and totalwork != 0
-
and sofar <> totalwork;
-
-
rem check wait events (rman sessions) - this is for current waits only
-
rem use the following for 11g
-
prompt
-
prompt session progess - current wait events and time in wait so far:
-
prompt
-
select inst_id, sid, client_info ch, seq#, event, state, wait_time_micro/1000000 seconds
-
from gv$session where program like '%rman%' and
-
wait_time = 0 and
-
not action is null;
-
-
rem use the following for 10g
-
--select inst_id, sid, client_info ch, seq#, event, state, seconds_in_wait secs
-
--from gv$session where program like '%rman%' and
-
--wait_time = 0 and
-
--not action is null;
-
-
rem gv$backup_async_io
-
prompt
-
prompt disk (file and backuppiece) progress - includes tape backuppiece
-
prompt if backup_tape_io_slaves=true:
-
prompt
-
select s.inst_id, a.sid, client_info ch, a.status,
-
open_time, round(bytes/1024/1024,2) "sofar mb" , round(total_bytes/1024/1024,2)
-
totmb, io_count,
-
round(bytes/total_bytes*100,2) "% complete" , a.type, filename
-
from gv$backup_async_io a, gv$session s
-
where not a.status in ('unknown')
-
and a.sid=s.sid and open_time > to_date('&1', 'yyyy-mm-dd hh24:mi:ss') order by 2,7;
-
-
rem gv$backup_sync_io
-
prompt
-
prompt tape backuppiece progress (only if backup_tape_io_slaves=false):
-
prompt
-
select s.inst_id, a.sid, client_info ch, filename, a.type, a.status, buffer_size bsz, buffer_count bfc,
-
open_time open, io_count
-
from gv$backup_sync_io a, gv$session s
-
where
-
a.sid=s.sid and
-
open_time > to_date('&1', 'yyyy-mm-dd hh24:mi:ss') ;
-
rem -------------------------------
-
调用方法
sql> @mon '2021-11-11 20:30:00'
这个时间表示备份开始的大致时间即可,可多次执行。
阅读(807) | 评论(0) | 转发(0) |