RMAN Restore Clause

RMAN Restore Clause

Restore RMAN backups and copies.

Syntax:

   RESTORE
   [(] restoreObject [(restoreSpecOperand [restoreSpecOperand]...] [)]... 
   [ CHANNEL ['] channel_id ['] 
   | PARMS [=] 'channel_parms' 
   | FROM { BACKUPSET | DATAFILECOPY } 
   | untilClause 
   | FROM TAG [=] ['] tag_name ['] 
   | VALIDATE 
   | DEVICE TYPE deviceSpecifier [, deviceSpecifier]... 
   .
   .
   .
   ]...;

   restoreObject::=
     { CONTROLFILE [TO 'filename']
     | DATABASE 
       [SKIP [FOREVER] TABLESPACE 
        ['] tablespace_name ['] [, ['] tablespace_name [']]...
       ]
     | DATAFILE datafileSpec [, datafileSpec]...
     | TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]...
     | archivelogRecordSpecifier
     | SPFILE [TO [PFILE] 'filename']
     }

   restoreSpecOperand::=
     { CHANNEL ['] channel_id [']
     | FROM TAG [=] ['] tag_name [']
     | PARMS [=] 'channel_parms'
     | FROM 
       { AUTOBACKUP 
         [{ MAXSEQ | MAXDAYS } [=] integer)]... 
       | 'media_handle'
       }
     }

Examples

Full DR recovery - Full Example (restoring to a different machine)
Point in time recovery - Full Example (restoring to the same machine / different date/time)

Restore and recover the whole Database:

 RMAN> STARTUP FORCE MOUNT;
 RMAN> RESTORE DATABASE;
 RMAN> RECOVER DATABASE;
 RMAN> ALTER DATABASE OPEN;

Restore and recover a Tablespace:

 RMAN> SQL 'ALTER TABLESPACE users OFFLINE';
 RMAN> RESTORE TABLESPACE users;
 RMAN> RECOVER TABLESPACE users;
 RMAN> SQL 'ALTER TABLESPACE users ONLINE';

Restore and recover a Datafile:

 RMAN> SQL 'ALTER DATABASE DATAFILE 64 OFFLINE';
 RMAN> RESTORE DATAFILE 64;
 RMAN> RECOVER DATAFILE 64;
 RMAN> SQL 'ALTER DATABASE DATAFILE 64 ONLINE';

Restore the Control file, (to all locations specified in the parameter file) then restore the database, using that control file:

STARTUP NOMOUNT;
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
RESTORE CONTROLFILE;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
}

Restore Validation confirms that a restore could be run, by confirming that all database files exist and are free of physical and logical corruption, this does not generate any output.
Example:

 RMAN> RESTORE DATABASE VALIDATE;

"Don't count the days, make the days count" - Muhammad Ali

Related Commands:

BACKUP - Back up database files, archive logs, backups, or copies.
CROSSCHECK
- Check whether backup items still exist.
LIST
- List backups and copies
RECOVER
- Perform. media recovery from RMAN backups and copies.
REPORT
- Report backup status: database, files, backups
RUN
- Some RMAN commands are only valid inside a RUN block.
SET
- Settings for the current RMAN session.
SHOW
- Display the current configuration

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23898243/viewspace-694025/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23898243/viewspace-694025/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值