您的位置:首页 > 其它

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

2013-10-06 22:09 429 查看
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:/article/1629009.html

当有多个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 the
V$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 which
SID
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:

In an active session, run the RMAN job as usual and examine the output to get the
sid
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

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 query
V$SESSION.CLIENT_INFO
for this string.
To correlate a process with a channel during a backup:

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;
}

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 the
CLIENT_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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: