【RMAN】rman的日誌輸出功能演示

secooler發表於2009-07-21
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章