channel的解析和配置方法

RMAN channel是指RMAN和数据库server session的连接。RMAN本身不会做备份还原操作,当我们连接RMAN的时候,RMAN会在目标数据库上分配server sessions。channel把数据读取到PGA,经过处理后写到设备中。大多数RMAN命令都是channels在执行。
在配置channel的时候,如果在次配置channel,那么以前的channel配置会被覆盖
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G;


new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/%U';


old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G;
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/home/oracle/%U';
new RMAN configuration parameters are successfully stored


在默认情况下,RMAN只会为一个磁盘分配一个channel处理所有操作。
也可以使用allocate channel指定channel
比如运行脚本
RUN 
[oracle@lzl ~]$ cat rman.script 
RUN 
{
  ALLOCATE CHANNEL c1 DEVICE TYPE DISK format '/home/oracle/c1.bakset';
  BACKUP TABLESPACE users;
  ALLOCATE CHANNEL c2 DEVICE TYPE DISK format '/home/oracle/c2.bakset';
  BACKUP spfile;
}
指定了两channel处理两个任务

RMAN> @/home/oracle/rman.script


RMAN> RUN 
2> {
3>   ALLOCATE CHANNEL c1 DEVICE TYPE DISK format '/home/oracle/c1.bakset';
4>   BACKUP TABLESPACE users;
5>   ALLOCATE CHANNEL c2 DEVICE TYPE DISK format '/home/oracle/c2.bakset';
6>   BACKUP spfile;
7> }
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1 device type=DISK


Starting backup at 2017-07-23 23:49:58
channel c1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
output file name=/home/oracle/c1.bakset tag=TAG20170723T234958 RECID=2 STAMP=950140201
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 2017-07-23 23:50:01


allocated channel: c2
channel c2: SID=42 device type=DISK


Starting backup at 2017-07-23 23:50:02
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 2017-07-23 23:50:02
RMAN-03009: failure of backup command on c1 channel at 07/23/2017 23:50:02
ORA-19504: failed to create file "/home/oracle/c1.bakset"
ORA-27038: created file already exists
Additional information: 1
channel c1 disabled, job failed on it will be run on another channel
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c2: starting piece 1 at 2017-07-23 23:50:02
channel c2: finished piece 1 at 2017-07-23 23:50:03
piece handle=/home/oracle/c2.bakset tag=TAG20170723T235002 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-23 23:50:03
released channel: c1
released channel: c2


RMAN> **end-of-file**




[oracle@lzl ~]$ ls -lrth *.bakset
-rw-r----- 1 oracle oinstall 409M Jul 23 23:50 c1.bakset
-rw-r----- 1 oracle oinstall  96K Jul 23 23:50 c2.bakset











来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31461640/viewspace-2142455/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31461640/viewspace-2142455/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值