ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【RMAN】rman的日志输出功能演示

【RMAN】rman的日志输出功能演示

原创 Linux操作系统 作者:secooler 时间:2009-07-21 08:44:32 0 删除 编辑
RMAN的日志输出功能一般情况下很少使用,不过如果在编写并在后台运行比较复杂的RMAN脚本时,为了排查错误,日志功能就显得非常重要了(当然您也可以使用shell的标准输出功能写日志)。

Ok,下面演示一下这个写日志的过程,给大家一个感性认识

ora10g@testdb /home/oracle$ rman target / log rman_log.txt
RMAN> backup database;
RMAN> list backup summary;
RMAN> exit;
ora10g@testdb /home/oracle$ cat rman_log.txt

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jul 21 08:38:11 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: ORA10G (DBID=4010369505)

RMAN>
Starting backup at 21-JUL-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=134 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/ora10g/system01.dbf
input datafile fno=00003 name=/oracle/oradata/ora10g/sysaux01.dbf
input datafile fno=00002 name=/oracle/oradata/ora10g/undotbs01.dbf
input datafile fno=00011 name=/oracle/oradata/ora10g/tbs_spotlight01.dbf
input datafile fno=00005 name=/oracle/oradata/ora10g/tbs_sec_d01.dbf
input datafile fno=00006 name=/oracle/oradata/ora10g/tbs_sec_i01.dbf
input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
input datafile fno=00012 name=/oracle/oradata/ora10g/tbs_part01.dbf
input datafile fno=00013 name=/oracle/oradata/ora10g/tbs_part02.dbf
input datafile fno=00014 name=/oracle/oradata/ora10g/tbs_part03.dbf
input datafile fno=00015 name=/oracle/oradata/ora10g/tbs_part04.dbf
input datafile fno=00016 name=/oracle/oradata/ora10g/tbs_part05.dbf
channel ORA_DISK_1: starting piece 1 at 21-JUL-09
channel ORA_DISK_1: finished piece 1 at 21-JUL-09
piece handle=/oracle/app/oracle/flash_recovery_area/ORA10G/backupset/2009_07_21/o1_mf_nnndf_TAG20090721T083821_56b3hy22_.bkp tag=TAG20090721T083821 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-JUL-09
channel ORA_DISK_1: finished piece 1 at 21-JUL-09
piece handle=/oracle/app/oracle/flash_recovery_area/ORA10G/backupset/2009_07_21/o1_mf_ncsnf_TAG20090721T083821_56b3k1k7_.bkp tag=TAG20090721T083821 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-JUL-09

RMAN>

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1       B  F  A DISK        21-JUL-09       1       1       NO         TAG20090721T082830
2       B  F  A DISK        21-JUL-09       1       1       NO         TAG20090721T083821
3       B  F  A DISK        21-JUL-09       1       1       NO         TAG20090721T083821

RMAN>

Recovery Manager complete.
ora10g@testdb /home/oracle$
ora10g@testdb /home/oracle$

发现了吧,在使用日志输出功能过程中,屏幕上不再输出命令结果,所有的操作记录均被记录到日志文件
rman_log.txt中。

secooler
09.07.21

-- The End --

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

请登录后发表评论 登录
全部评论
Oracle ACE 总监,阿里云MVP,北京大学理学硕士,恩墨学院创始人,教育专家,中国区 Cloudera 首位官方授权大数据讲师,金牌培训专家,BDA大数据联盟创始人,OCM联盟创始人,ACCUG创始人、ACOUG核心专家,Blogger。

注册时间:2008-03-16

  • 博文量
    797
  • 访问量
    7973613