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 --
【RMAN】rman的日志输出功能演示
分享好友
分享这个小栈给你的朋友们,一起进步吧。
订阅须知
• 所有用户可根据关注领域订阅专区或所有专区
• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询
• 专区发布评论属默认订阅所评论专区(除付费小栈外)