Running Sql command from RMAN and example of tablespace restore and recovery;

you can’t issue a select statement from within RMAN.

RMAN> sql 'alter system switch logfile';

sql statement: alter system switch logfile

RMAN> run
2> {
3> sql "alter tablespace users offline immediate";
4> restore tablespace users;
5> recover tablespace users;
6> sql "alter tablespace users online";
7> }

sql statement: alter tablespace users offline immediate

Starting restore at 04-APR-10
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to D:\11GSOFTWARE\ORADATA\SANDEEP\USERS01.DBF
channel ORA_DISK_1: reading from backup piece D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_04\O1_MF_NNNDF_TAG20100404T142507_5VK4SOZ0_.BKP
channel ORA_DISK_1: piece handle=D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_04\O1_MF_NNNDF_TAG20100404T142507_5VK4SOZ0_.BKP tag=TAG20100404T142507
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 04-APR-10

Starting recover at 04-APR-10
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:02

Finished recover at 04-APR-10

sql statement: alter tablespace users online


1 comment:

  1. After I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and
    now every time a comment is added I receive 4 emails with the exact same comment.

    Perhaps there is a way you can remove me from that service?

    my weblog; experiencing hair loss (