• 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

  • 相关阅读:
    Ubuntu 18.04.3 更改系统语言为简体中文
    Centos7.3、nginx环境下部署hugo博客
    Centos7.3 卸载 Nginx(彻底卸载) 并重新安装 Nginx(RPM源yum安装)
    Centos7.3、nginx环境下部署hexo博客(非git推送方式)
    使用阿里云对象存储OSS+PicGo搭建图床
    Hexo博客添加LiveRe评论系统
    使用 jsDelivr CDN加速Github 仓库的图片
    解决win10一开机占用内存就飙到70%的问题
    [Andriod官方训练教程]管理Activity的生命活动之停止和重启一个Activity
    [Andriod官方训练教程]支持不同的设备之支持不同的语言
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317083.html
Copyright © 2020-2023  润新知