Monitoring Oracle RMAN Sessions


To identify which server sessions correspond to which RMAN channels, you can query V$SESSION and V$PROCESS. The SPID column of V$PROCESS identifies the operating system ID number for the process or the thread. On UNIX, the SPID column shows the process ID. On Windows, the SPID column shows the thread ID. There are two basic methods for obtaining this information, depending on whether you have multiple RMAN sessions active concurrently. When only one RMAN session is active, execute the following query on the target database while the RMAN job is running:


SQL> COLUMN CLIENT_INFO FORMAT a30
SQL> COLUMN SID FORMAT 999
SQL> COLUMN SPID FORMAT 9999
SQL> SELECT s.sid, p.spid, s.client_info
  2  FROM v$process p, v$session s
  3  WHERE p.addr = s.paddr
  4  AND CLIENT_INFO LIKE 'rman%';

When multiple RMAN sessions are running, it helps to correlate a process with a channel during a backup by using the SET COMMAND ID command as shown below:
1.           In each session, set the command ID to a different value and then back up the desired object. For example, enter the following in session 1:

RUN
{
SET COMMAND ID TO 'sess1';
BACKUP DATABASE;
}

Set the command ID to a string such as sess2 in the job running in session 2:

RUN
{
SET COMMAND ID TO 'sess2';
BACKUP DATABASE;
}

2.       Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views while the RMAN job is being executed. For example, enter:

SELECT SID, SPID, CLIENT_INFO
FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE '%id=sess%';

If you run the SET COMMAND ID command in the RMAN job, then the CLIENT_INFO column is displayed in the following format:

id=command_id,rman channel=channel_id