例:ライブラリからのバックアップをメインライブラリに戻します。


備蓄庫でバックアップし、メインライブラリでcontrol fileとrecovery catalogの同期を回復する。
rman target / catalog rco/[email protected]/test1
run{
allocate channel c1 type 'sbt_tape' parms='
SBT_LIBRARY=/opt/scutech/dbackup3/lib/libobk.so,
ENV=(URL=http://192.168.87.155:50306/d2/data/0d36020eecec11ea8000b49691622ac4/c7873e9aed0811ea8000b49691622ac4,
EXTRA=X-Access-Key:ea5350ac00fa61d08533a729da808de0)' trace=0;
backup tablespace ex1;
}
LIST DB_UNIQUE_NAME OF DATABASE;
list backup summary  for db_unique_name 'orcl1by';
changebackup tag='standby_backup_1' for db_unique_name orcl reset db_unique_name;
RMAN> host 'rm /u01/app/oracle/oradata/orcl/ex1.dbf';
host command complete
RMAN> validate datafile 13;

Starting validate at Sep 09 2020 11:51:13  
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=378 device type=DISK
channel ORA_DISK_1: starting validation of datafile
channel ORA_DISK_1: specifying datafile(s) for validation
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of validate command on ORA_DISK_1 channel at 09/09/2020 11:51:14
ORA-01122: database file 13 failed verification check
ORA-01110: data file 13: '/u01/app/oracle/oradata/orcl/ex1.dbf'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/orcl/ex1.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

RMAN> list failure;

Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected        Summary
---------- -------- --------- -------------------- -------
1642       HIGH     OPEN      Sep 09 2020 11:46:03 One or more non-system datafiles are missing

RMAN> advise failure;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status    Time Detected        Summary
---------- -------- --------- -------------------- -------
1642       HIGH     OPEN      Sep 09 2020 11:46:03 One or more non-system datafiles are missing

analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
analyzing automatic repair options complete

Mandatory Manual Actions
========================
1. If file /u01/app/oracle/oradata/orcl/ex1.dbf was unintentionally renamed or moved, restore it
2. If you have an export of tablespace EX1, then drop and re-create the tablespace and import the data.
3. Contact Oracle Support Services if the preceding recommendations cannot be used, or if they do not fix the failures selected for repair

Optional Manual Actions
=======================
1. Shut down, mount the database and try flush redo using ALTER SYSTEM FLUSH REDO TO 'standby name' command.  Then perform a Data Guard role change (failover).  Available standbys: orcl1by.

Automated Repair Options
========================
no automatic repair options available

RMAN> RMAN> 

RMAN> ALTER TABLESPACE ex1 offline immediate;

Statement processed

RMAN> run{
     
allocate channel c1 type 'sbt_tape' parms='
SBT_LIBRARY=/opt/scutech/dbackup3/lib/libobk.so,
ENV=(URL=http://192.168.87.155:50306/d2/data/0d36020eecec11ea8000b49691622ac4/c7873e9aed0811ea8000b49691622ac4,
EXTRA=X-Access-Key:ea5350ac00fa61d08533a729da808de0)' trace=0;
restore tablespace ex1;
}
2> 3> 4> 5> 6> 7> 
released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=378 device type=SBT_TAPE
channel c1: DBackup3 Oracle MMS Library

Starting restore at Sep 09 2020 11:51:45

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00013 to /u01/app/oracle/oradata/orcl/ex1.dbf
channel c1: reading from backup piece 66v9vp9q_1_1
channel c1: piece handle=66v9vp9q_1_1 tag=TAG20200909T114458
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
Finished restore at Sep 09 2020 11:51:48
released channel: c1

RMAN>  recover tablespace ex1;

Starting recover at Sep 09 2020 11:53:12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=378 device type=DISK

starting media recovery

archived log for thread 1 with sequence 279 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_08/o1_mf_1_279_hogz5ylq_.arc
archived log for thread 1 with sequence 280 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_08/o1_mf_1_280_hoh3qxk1_.arc
archived log for thread 1 with sequence 281 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_08/o1_mf_1_281_hoh7bow0_.arc
archived log for thread 1 with sequence 282 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_09/o1_mf_1_282_hohw8y8y_.arc
archived log for thread 1 with sequence 283 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_09/o1_mf_1_283_hoj818t1_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_08/o1_mf_1_279_hogz5ylq_.arc thread=1 sequence=279
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_08/o1_mf_1_280_hoh3qxk1_.arc thread=1 sequence=280
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2020_09_08/o1_mf_1_281_hoh7bow0_.arc thread=1 sequence=281
media recovery complete, elapsed time: 00:00:01
Finished recover at Sep 09 2020 11:53:14

RMAN> ALTER TABLESPACE ex1 online;

Statement processed

RMAN> validate tablespace ex1;

Starting validate at Sep 09 2020 11:53:35
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile
channel ORA_DISK_1: specifying datafile(s) for validation
input datafile file number=00013 name=/u01/app/oracle/oradata/orcl/ex1.dbf
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
13   OK     0              1            129             2488395   
  File Name: /u01/app/oracle/oradata/orcl/ex1.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0               
  Index      0              0               
  Other      0              127             

Finished validate at Sep 09 2020 11:53:37
RMAN>