Ocm Use Recover Manager To Perform Complete Database Restore And Recovery Operations Jp


SQL> shutdown immediate;
SQL> startup nomount;
RMAN> restore database;
RMAN> recover database;
RMAN> alter database mount;
RMAN> alter database open;
RMAN> restore database;
Starting restore at 08-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oracle/oracle/oradata/prod/system01.dbf
restoring datafile 00002 to /u01/oracle/oracle/oradata/prod/undotbs01.dbf
restoring datafile 00003 to /u01/oracle/oracle/oradata/prod/sysaux01.dbf
restoring datafile 00004 to /u01/oracle/oracle/oradata/prod/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/oracle/oracle/bkup/prod/rman/PROD_0dkbt1n5_1_1_20090407.bkf
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/oracle/oracle/bkup/prod/rman/PROD_0dkbt1n5_1_1_20090407.bkf tag=L0_INIT
channel ORA_DISK_1: restore complete, elapsed time: 00:00:57
Finished restore at 08-APR-09
# =========ここであえてrecoverせずにalter database open;してみよう =========
RMAN> alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 04/08/2009 16:48:14
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/oracle/oracle/oradata/prod/system01.dbf'
# ===== recover すれば正常にDBをオープンできる =====
RMAN> recover database;
Starting recover at 08-APR-09
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 08-APR-09
RMAN> alter database open;
database opened
[oracle@fy scripts]$ rman target / nocatalog
Recovery Manager: Release - Production on Wed Apr 8 17:34:55 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: PROD (DBID=94882947, not open)
using target database control file instead of recovery catalog
RMAN> drop database;
database name is "PROD" and DBID is 94882947
Do you really want to drop the database (enter YES or NO)? yes
database dropped
RMAN> quit
Recovery Manager complete.