Sunday, May 15, 2011

RMAN SCRIPT : DISASTER RECOVERY


[ disaster_recovery.scp]
# The commands below assume that all initialization parameters files are in place and the complete directory structure for the datafiles is recreated
# Ensure uou set your NLS_LANG environment variable
# e.g in unix (csh);
# >setenv NLS_LANG amarican_america.we8dec

# Start RMAN without the target option, and use the following commands to restor
e and recover the database

# SET DBID; use database if from RMAN output
# not required if using recovery catalog

        connect target sys/password@omr
        startup nomount;
        run
        {
# you need to allocate channels if not using recovery catalog.

        allocate channel c1 type disk;

# optionally you can set newname and switch commands to restore datafiles to a new location

        restore controlfile from autobackup;
        alter database mount;
        restore database;
        reocver database;
        alter database open resetlogs;

# you must take  a new whole database backup after resetlogs, since backups of previous incarnatin are not easily usable.

No comments:

Post a Comment