Friday, August 24, 2012

rman LOG and APPEND commands

This example was tested on Oracle 11.2 and shows how to create a log of an rman session. First display your $ORACLE_SID to show you are pointing to a database:
 
Solaris > echo $ORACLE_SID
ANDREW01
Solaris >
 
Show that you are already in the directory containing the log file:
 
Solaris > pwd
/database/Andrew/ANDREW01
Solaris >
 
Show the existing contents of the log file:
 
Solaris > cat rman.log
If this works, the output from my rman session will appear below.
Solaris >
 
Now start an rman session, which will append its output to the log file. Notice that no output appears on the screen:
 
Solaris > rman target / LOG //database/Andrew/ANDREW01/rman.log APPEND
RMAN> list backup;
RMAN> exit
Solaris >
 
Finally, display the new contents of the log file to show the output from the list backup command:
 
Solaris > cat rman.log
If this works, the output from my rman session will appear below.
 
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Aug 23 17:51:55 2012
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
 
connected to target database: ANDREW01 (DBID=385736687)
 
RMAN>
using target database control file instead of recovery catalog
 
List of Backup Sets
===================
 
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    943.45M    DISK        00:00:27     22-AUG-12
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20120822T155255
        Piece Name: /database/Andrew/ANDREW01/backupset/2012_08_22/o1_mf_nnndf_TAG20120822T155255_839wl8dj_.bkp
  List of Datafiles in backup set 3
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 947201     22-AUG-12 /database/Andrew/ANDREW01/system01.dbf
  2       Full 947201     22-AUG-12 /database/Andrew/ANDREW01/sysaux01.dbf
  3       Full 947201     22-AUG-12 /database/Andrew/ANDREW01/undotbs01.dbf
  4       Full 947201     22-AUG-12 /database/Andrew/ANDREW01/users01.dbf
 
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    9.33M      DISK        00:00:00     22-AUG-12
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20120822T155255
        Piece Name: /database/Andrew/ANDREW01/backupset/2012_08_22/o1_mf_ncnnf_TAG20120822T155255_839wmdo5_.bkp
  Control File Included: Ckp SCN: 947201       Ckp time: 22-AUG-12
 
RMAN>
 
Recovery Manager complete.
Solaris >

No comments: