暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Rman Troubleshooting

DB小榴莲 2018-12-18
891


1. Set NLS_DATE_FORMAT correctly


Ensure you have set environment variable NLS_DATE_FORMAT with timestamp included,so rman log or rman trace can also capture the timestamp,which is very helpful in rman performance troubleshooting.

 

On windows operating system,you can set nls_date_format by following command


set NLS_DATE_FORMAT=DD-MON-YYYY.HH24:MI:SS


On unix borne/bash shell,you can set nls_date_format by following command


export NLS_DATE_FORMAT=”DD-MON-YYYY.HH24:MI:SS”;

export NLS_DATE_FORMAT


On unix c shell, you can set nls_date_format by following command


setenv NLS_DATE_FORMAT=”DD-MON-YYYY.HH24:MI:SS”;



2. To generate rman log


spool log to ‘/u01/rman01.log’;

rman command;

spool log off


Or you can generate the rman log as bellow


rman target <connection> catalog <connection> log=/u01/rman02.log

rman command;

exit;

 

 

3. To generate debug trace file


rman target <connection> catalog <connection> dubug trace=/u01/rman03.trc log=/u01/rman04.log

rman command;

exit;

 

In the above command,the debug trace for the rman session is collected in u01/rman03.trc and rman session log is collected in in u01/rman04.log

 


4. To collect 10046 trace


For some issues which mostly performance related,we might also need to collect 10046 trace for the rman session in addition to 10046 debug trace.


To collect the 10046 trace,the command as bellow


rman target <connection> catalog <connection> debug trace=/u01/rman05.trc log=/u01/rman06.log

sql “alter session set tracefile identifier=’’rman_10046’’”;

sql “alter session set events ‘’10046 trace name context forever,level 12’’”;

rman command;

exit;

 


5. To collect 10046 trace in catalog database


Make the connection to target database and catalog database as below but do not run any command


rman target <connection> catalog <connection> debug trace=/u01/rman07.trc log=/u01/rman08.log


Leave the ramn session as it is and connect as sys to the catalog database in another window,then run the command as below


select sid,schemaname,machine from v$session where lower(program) like ‘rman%’;

 

And then,get the ospid once you have the sid for the rman connection from the target


select p.spid from v$process p,v$session s where s.paddr = p.addr and s.sid=&session_id;

 

Use this ospid to set 10046 trace at the catalog database


oradebug setospid 3885

oradebug unlimit

oradebug event 10046 trace name context forever,level 12

 

Now,go back to rman session and run the commands that need to be traced,the 10046 trace file can be found in the directory defined by user_dump_dest initialization parameter of catalog database

 

6. To trace rman channel


The actual io is performed by rman channels,you can trace rman channel as bellow


Disk Channel:

run {

allocate channel ch1 type disk DEBUG=5 TRACE=1;

your-commands; }


Tape Channel:

run {

allocate channel ch1 type sbt DEBUG=5 TRACE=5;

your-commands; }


the trace file will be generated in the directory that defined by user_dump_dest in initialization parameter of database as well.

最后修改时间:2020-01-14 09:44:22
文章转载自DB小榴莲,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论