Backup and Restore using RMAN on Windows

Backup
Open a command prompt

  1. c:\>RMAN
  2. RMAN>connect target username/password@database
  3. RMAN>shutdown immediate
  4. RMAN> startup mount
  5. run {
    allocate channel Channel1 type disk format ‘c:\backup\oracle\%d_%T’;
    backup
    ( database include current controlfile );
    }

Restore

  1. Open a command prompt
  2. c:\>RMAN
  3. RMAN>connect target username/password@database
  4. RMAN>shutdown immediate
  5. RMAN>startup mount
  6. run {
    allocate channel Channel1 type disk format ‘C:\backup\orcle\%d_%T’; use the database file name
    restore ( database);
    }
  7. RMAN>recover database;
  8. RMAN>alter database open;
  9. If you receive the message “already restored to file” this means RMAN thinks the database files are in a correct state. Use the following command to overwrite the files Restore Force (database); instead of restore (database);.

New Restore
RMAN>Shutdown immediate
RMAN>Startup nomount
RMAN>restore controlfile from ‘c:\backup\oracle\DB_20050214’;

RMAN>Shutdown immediate
RMAN>Startup mount

run {
allocate channel Channel1 type disk format ‘C:\backup\oracle\%d_%T’; use the database file name
restore ( database);
}

RMAN>recover database;
RMAN>alter database open resetlogs;