Wednesday, January 18, 2012

rman command

1. create spfile backup and control file backup
backup spfile format '/tmp/spfileorcl.ora';
backup current controlfile format '/tmp/controlorcl.copy';

2. restore spfile and control file
rman target /
starup force nomount
restore spfile from '/tmp/spfilecolouat2012_01_12.ora';

shutdown
startup nomount
restore controlfile from '/tmp/controlcolouat2012_01_12.ctl';
alter database mount

3.
RUN {
ALLOCATE CHANNEL ch1 TYPE
DISK FORMAT '/u01/backup/DB10G/%d_DB_%u_%s_%p';
BACKUP DATABASE PLUS ARCHIVELOG;
RELEASE CHANNEL ch1;
}
EXIT;
4. run scripts
#!/bin/bash

rman target / < LIST ARCHIVELOG ALL;
RMAN> LIST BACKUP OF ARCHIVELOG ALL;
RMAN> LIST BACKUP;
RMAN> LIST BACKUP OF DATABASE;
RMAN> LIST BACKUP OF DATAFILE 1;
RMAN> LIST BACKUP SUMMARY;
RMAN> LIST INCARNATION;
RMAN> LIST BACKUP BY FILE;
RMAN> LIST COPY OF DATABASE ARCHIVELOG ALL;
RMAN> LIST COPY OF DATAFILE 1, 2, 3;
RMAN> LIST BACKUP OF DATAFILE 11 SUMMARY;
RMAN> LIST BACKUP OF ARCHIVELOG FROM SEQUENCE 1437;
RMAN> LIST CONTROLFILECOPY "/tmp/cntrlfile.copy";
RMAN> LIST BACKUPSET OF DATAFILE 1;
RMAN> LIST FAILURE;
RMAN> LIST FAILURE 641231 detail;





reference:
http://www.oracle-base.com/articles/misc/OracleShellScripting.php
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmconfa.htm
http://ss64.com/ora/rman_list.html






No comments:

Post a Comment