SAINORA

HomeBlogsRMAN

RMAN

How will you restore a backupset into new server from different location.

1. Create the pfile in the new server.
2. startup the database in nomount stage;
3. connect to rman and restore the controlfile using the below command.
[oracle@rman ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jul 27 20:04:10 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: sss (not mounted)

RMAN> list backup;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 07/27/2012 20:04:21
ORA-01507: database not mounted

RMAN> restore controlfile from '/sss1/rman/c-1406605833-20120727-00';

Starting restore at 27-JUL-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=39 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/gopi/sss.ctl
Finished restore at 27-JUL-12

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> list backup;

List of Backup Sets
===================

BS Key  Type LV Size   Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1     Full  247.37M     DISK        00:00:10    27-JUL-12     
BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20120727T190801
Piece Name: /sss/rman/SSS_01nh5moh_1
List of Datafiles in backup set 1
File LV Type Ckp SCN  Ckp Time  Name
---- -- ---- ---------- --------- ----
1         Full 167927       27-JUL-12 /sss/oradata/system.dbf
2         Full 167927       27-JUL-12 /sss/oradata/undotbs1.dbf
3         Full 167927       27-JUL-12 /sss/oradata/sysaux.dbf

RMAN> catalog backuppiece '/sss1/rman/SSS_01nh5moh_1';    

cataloged backuppiece
backup piece handle=/sss1/rman/SSS_01nh5moh_1 recid=2 stamp=789768718

RMAN> list backup;

List of Backup Sets
===================

BS Key  Type LV Size
------- ---- -- ----------
1     Full  247.37M
List of Datafiles in backup set 1
File LV Type Ckp SCN  Ckp Time  Name
---- -- ---- ---------- --------- ----
1         Full 167927       27-JUL-12 /sss/oradata/system.dbf
2         Full 167927       27-JUL-12 /sss/oradata/undotbs1.dbf
3         Full 167927       27-JUL-12 /sss/oradata/sysaux.dbf

  Backup Set Copy #1 of backup set 1
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK      00:00:10    27-JUL-12         NO          TAG20120727T190801

      List of Backup Pieces for backup set 1 Copy #1
BP Key  Pc# Status      Piece Name
------- --- ----------- ----------
1     1   AVAILABLE   /sss/rman/SSS_01nh5moh_1

  Backup Set Copy #2 of backup set 1
Device Type Elapsed Time Completion Time Compressed Tag
----------- ------------ --------------- ---------- ---
DISK      00:00:10    27-JUL-12         NO          TAG20120727T190801

      List of Backup Pieces for backup set 1 Copy #2
BP Key  Pc# Status      Piece Name
------- --- ----------- ----------
2     1   AVAILABLE   /sss1/rman/SSS_01nh5moh_1

RMAN>  run {
set newname for datafile 1 to '/sss1/stsrem1.dbf';
set newname for datafile 2 to '/sss1/file2.dbf';
set newname for datafile 3 to '/sss1/file3.dbf';
sql "alter database rename file ''/sss/oradata/redo1.log'' to ''/sss1/redo1.log'' ";
sql "alter database rename file ''/sss/oradata/redo2.log'' to ''/sss1/redo2.log'' ";
restore database from tag='TAG20120727T190801';
switch datafile all;
recover database  from tag='TAG20120727T190801';
alter database open resetlogs;
}

Recovery Manager

How will take the database backup.

Taking database level backup

 BACKUP DATABASE;
BACKUP CURRENT CONTROLFILE;
backup database plus archivelog;

Datafiles backup :
backup as backupset datafile '/DATA/pad/oradata/system.dbf','/DATA/pad/oradata/undotbs1.dbf';

configure retention policy to redundancy 1
configure retention policy to recovery windows of 10 days

backup archivelog time between sysdate-1 and sysdate;
backup archivelog time between sysdate-1 and sysdate;
backup tablespace system;

backup spfile;

backup backupset all  - takes all the backup including the backup;

validate

 backup validate database archivelog all; - to check the logical and physical corruption for  database and archivelog;
backup validate tablespace system;
backup validate datafile 'path';
backup validate spfile;

BACKUP DATABASE UNTIL 'SYSDATE+365' NOLOGS;
crosscheck

RMAN> CROSSCHECK BACKUP;
RMAN> CROSSCHECK COPY;
RMAN> CROSSCHECK backup of database;
RMAN> CROSSCHECK backup of controlfile;
RMAN> CROSSCHECK archivelog all;
crosscheck backup of spfile;
crosscheck backup of tablespace users1;

restore

restore ARCHIVELOG FROM TIME 'SYSDATE-1' UNTIL TIME 'SYSDATE';
delete backup no.

list backup;

report obsolete;

VIEWS

V$FLASHBACK_DATABASE_LOGFILE
V$FLASHBACK_DATABASE_LOG
V$FLASHBACK_DATABASE_STAT
V$BACKUP
V$BACKUP_SET
V$BACKUP_PIECE
V$BACKUP_DATAFILE
V$BACKUP_SPFILE
V$BACKUP_REDOLOG
V$BACKUP_CORRUPTION
V$BACKUP_DEVICE
V$BACKUP_SYNC_IO
V$BACKUP_ASYNC_IO
V$LOGMNR_CALLBACK
V$BACKUP_FILES
V$RMAN_BACKUP_SUBJOB_DETAILS
V$RMAN_BACKUP_JOB_DETAILS
V$BACKUP_SET_DETAILS
V$BACKUP_PIECE_DETAILS
V$BACKUP_COPY_DETAILS
V$BACKUP_DATAFILE_DETAILS
V$BACKUP_CONTROLFILE_DETAILS
V$BACKUP_ARCHIVELOG_DETAILS
V$BACKUP_SPFILE_DETAILS
V$BACKUP_SET_SUMMARY
V$BACKUP_DATAFILE_SUMMARY
V$BACKUP_CONTROLFILE_SUMMARY
V$BACKUP_ARCHIVELOG_SUMMARY
V$BACKUP_SPFILE_SUMMARY
V$BACKUP_COPY_SUMMARY
V$UNUSABLE_BACKUPFILE_DETAILS
V$RMAN_BACKUP_TYPE

           

Published on 9th May 2012

Published by Gopinathan D