当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
使用PIPE进行rman备份
发布时间:2010/9/17 11:45:55 来源:城市学习网 编辑:ziteng
  在sqlplus 或是应用程序中,可以使用rman的PIPE来进行备,相当方便
  1,启动一下ramn ,rman pipe abc  target / nocatalog  。这条命令会启动二个名为ORA$RMAN_pipe_IN/OUT的PIPE,此例启动了ORA$RAMN_ABC_IN和ORA$RAMN_ABC_OUT两个pipe,ORA$RAMN_ABC_IN用来接收用户的消息,ORA$RAMN_ABC_OUT用来读取消息,可以查询v$db_pipes来得想PIPE的相关信息
  2,向pipe发送RMAN命令,PL/SQL代码如下:
  declare
  i integer;
  begin
  dbms_pipe.pack_message('backup database;');
  i:=dbms_pipe.send_message('ORA$RMAN_ABC_IN');
  end;
  3,从pipe读取信息;
  declare
  i integer;
  j integer;
  ch varchar2(200);
  begin
  for j in 1..100 loop
  i:=dbms_pipe.receive_message('ORA$RAMN_ABC_OUT',100);
  dbms_pipe.unpack_message(ch);
  dbms_output.put_line(ch);
  end loop;
  end;
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved