Monday, October 17, 2011

Oracle: my RMAN recovery note on Oracle 10gR1


. oraenv
comm

sqlplus > alter system set cluster_database=false scope=spfile;

sqlplus > startup force nomount;


# to look at preview summary
RMAN>
run{
    set until time "to_date('16-OCT-2010 04:00:00','DD-MON-YYYY HH24:MI:SS')";
    restore database preview summary;
}


# to force restore
## longest part
RMAN>
run{
    set until time "to_date('16-OCT-2010 04:00:00','DD-MON-YYYY HH24:MI:SS')";
    restore force database;
}

## recover database
RMAN>
run{
    set until time "to_date('16-OCT-2010 04:00:00','DD-MON-YYYY HH24:MI:SS')";
    restore force database;
    recover database;
}


RMAN> alter database open resetlogs;
database opened