RMAN中set command id to 'rman'是什么意思?主要起什么作用?
解决方案 »
- 使用excel生成insert into批量插入语句问题
- 一个查询条件,求助!!!
- 菜鸟请教oracle9i问题
- 大家探讨这个问题,:)
- 请教:oracle8.1.6存储过程问题?
- 超难SQL语句求救!!在线!
- 一个比较麻烦的查询时间SQL语句,请进。
- 新手请教sql语句写法
- 在删除和创建11g dbconsole 提示oracle.sysman.emcp.exception.EMConfigException: 数据库实例不可用
- oracle中存储过程一条查询语句怎么加锁可以在commit之后才可以再次执行这条查询语句
- 这个为什么是第二范式?
- 创建控制文件Create Controlfile错误?
run{
allocate channel ch1 type disk;
set command id to 'rman';
copy datafile 4 to 'c:\rman\backup\users01.dbf.bk';
release channel ch1;
}
我就是不理解其中的set command id to 'rman'是什么意思,rman是我的恢复目录数据库.
这个命令我也之前也没见过,刚查了一文档,说:set command id to 'rman'; 这个命令之后,从v$session的CLIENT_INFO列可以看到这个值,即可以查看session是哪个命令的
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:
RMAN> RUN
{
ALLOCATE CHANNEL c1 TYPE sbt;
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:
SQL> 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.