首先创建极限的脚本的文件如下:注意属主和权限
/opt/oracle> more gen_stb.rcv
run{
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate auxiliary channel stby1 type disk;
allocate auxiliary channel stby2 type disk;
allocate auxiliary channel stby3 type disk;
duplicate target database for standby from active database nofilenamecheck;
}
然后在生产端执行如下命令:会生成对应的日志在对应的文件,请注意属主和权限
nohup rman target sys/<sys password>@<pr_db_alias> auxiliary sys/<sys password>@<dr_db_alias> cmdfile=/opt/oracle/gen_stb.rcv log=/opt/oracle/gen_stb.log &
如下SQL,可以查看基线时的情况
SELECT sid, sofar, totalwork,round(sofar/totalwork*100,2) "% Complete",UNITSFROM v$session_longops
WHERE opname LIKE 'RMAN%' AND opname NOT LIKE '%aggregate%'
AND totalwork != 0
AND sofar <> totalwork;