OCP-1Z0-053-V12.02-94题

94.Multiple RMAN sessions are connected to the database instance.

Examine the following output when backup commands are running in server sessions: What could have

helped you to correlate server sessions with channels?


A. Implement RMAN multiplexing

B. Set the DEBUG ON in the RMAN script

C. Specify the command ID in the RMAN script

D. Use a tag with the RMAN BACKUP command

Answer: C

答案解析:

参考:监控和优化RMAN:http://blog.csdn.net/rlhua/article/details/12510975

当有多个RMAN 会话正在运行时,最好使用 SET COMMAND ID命令在备份期间将某个进程与某个通道相关联,如下所示:
1.在每个会话中,将命令ID 设置为不同的值,然后备份所需的对象。例如,在会话1 中输入下列内容:
RUN
{
SET COMMAND ID TO 'sess1';
BACKUP DATABASE;
}
在会话2 中运行的作业中将命令ID 设置为一个字符串,如sess2:
RUN
{
SET COMMAND ID TO 'sess2';
BACKUP DATABASE;
}
2.启动SQL*Plus 会话,然后在执行RMAN 作业时查询联接的V$SESSION和
V$PROCESS视图。例如,输入:
SELECT SID, SPID, CLIENT_INFO
FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE '%id=sess%';
 
如果在RMAN 作业中运行SET COMMAND ID命令,则CLIENT_INFO列会以下列格式显示:
id=command_id,rman channel=channel_id
例如,下面显示了一个示例输出:
SID SPID CLIENT_INFO
---- ------------ ------------------------------
11 8358 id=sess1
15 8638 id=sess2
14 8374 id=sess1,rman channel=c1
9 8642 id=sess2,rman channel=c1
 
sys@TEST0924> SELECT s.sid, p.spid, s.client_info FROM v$process p, v$session s WHERE p.addr = s.paddr  AND CLIENT_INFO LIKE 'rman%';
 
 
 SID SPID                     CLIENT_INFO
---- ------------------------ ------------------------------
  68 410                      rman channel=ORA_DISK_1
 160 722                      rman channel=ORA_DISK_1
 
sys@TEST0924> SELECT s.sid, p.spid, s.client_info FROM v$process p, v$session s WHERE p.addr = s.paddr  AND CLIENT_INFO like '%id=sess%';
 
 SID SPID                     CLIENT_INFO
---- ------------------------ ------------------------------
   7 653                      id=sess1
 

Matching Server Sessions with Channels in Multiple RMAN Sessions

If more than one RMAN session is active, then it is possible for theV$SESSION.CLIENT_INFO column to yield the same information for a channel in each session. For example:

SID SPID CLIENT_INFO
---- ------------ ------------------------------
14 8374 rman channel=ORA_SBT_TAPE_1
9 8642 rman channel=ORA_SBT_TAPE_1

In this case, you have the following methods for determining which channel corresponds to whichSID value.

Obtaining the Channel ID from the RMAN Output

In this method, you must first obtain the sid values from the RMAN output and then use these values in your SQL query.

To correlate a process with a channel during a backup:

  1. In an active session, run the RMAN job as usual and examine the output to get thesid for the channel. For example, the output may show:

    Starting backup at 21-AUG-01
    allocated channel: ORA_SBT_TAPE_1
    channel ORA_SBT_TAPE_1: sid=14 devtype=SBT_TAPE
  2. Start a SQL*Plus session and then query the joined V$SESSION and V$PROCESS views while the RMAN job is executing. For example, enter:

    COLUMN CLIENT_INFO FORMAT a30
    COLUMN SID FORMAT 999
    COLUMN SPID FORMAT 9999
    SELECT s.SID, p.SPID, s.CLIENT_INFO
    FROM V$PROCESS p, V$SESSION s
    WHERE p.ADDR = s.PADDR
    AND CLIENT_INFO LIKE 'rman%'
    /

    Use the sid value obtained from the first step to determine which channel corresponds to which server session:

    SID SPID CLIENT_INFO
    ---------- ------------ ------------------------------
    14 2036 rman channel=ORA_SBT_TAPE_1
    12 2066 rman channel=ORA_SBT_TAPE_1
Correlating Server Sessions with Channels by Using SET COMMAND ID

In this method, you specify a command ID string in the RMAN backup script. You can then queryV$SESSION.CLIENT_INFO for this string.

To correlate a process with a channel during a backup:

  1. In each session, set the COMMAND ID to a different value after allocating the channels and then back up the desired object. For example, enter the following in session 1:

    RUN
    {
    ALLOCATE CHANNEL c1 TYPE disk;
    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
    {
    ALLOCATE CHANNEL c1 TYPE sbt;
    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 executing. 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 theCLIENT_INFO column displays in the following format:

    id=command_id,rman channel=channel_id

    For example, the following shows sample output:

    SID SPID CLIENT_INFO
    ---- ------------ ------------------------------
    11 8358 id=sess1
    15 8638 id=sess2
    14 8374 id=sess1,rman channel=c1
    9 8642 id=sess2,rman channel=c1

    The rows that contain the string rman channel show the channel performing the backup. The remaining rows are for the connections to the target database.

官方参考:http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmtroub.htm#sthref1769

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值