Wednesday, 30 August 2017

Repair corrupt block using RMAN in Oracle step by step


The purpose of this is to recover corrupted blocks from a backup set using RMAN.

Description

In this activity, you will identify the corrupt block in a data file and recover the corrupt block using an RMAN backup.

In this activity, you: 

Create a full database backup
Identify the corrupt block
Recover the corrupt block


Step .1----------------Backup of Full Database with archive Backup-------------

[oracle@exacell01 dbs]$ rman target / nocatalog

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Feb 7 15:47:22 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB3 (DBID=600505155)
using target database control file instead of recovery catalog

RMAN> backup database plus archive l   elog
2> ;


Starting backup at 07-FEB-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=56 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=25 RECID=4 STAMP=903190203
input archived log thread=1 sequence=26 RECID=5 STAMP=903190221
input archived log thread=1 sequence=27 RECID=6 STAMP=903196104
channel ORA_DISK_1: starting piece 1 at 07-FEB-16
channel ORA_DISK_1: finished piece 1 at 07-FEB-16
piece handle=/u01/CDB3/backupset/2016_02_07/o1_mf_annnn_TAG20160207T154825_ccg6hkcp_.bkp tag=TAG20160207T154825 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-FEB-16

Starting backup at 07-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/CDB3/DATAFILE/system01.dbf
input datafile file number=00003 name=/u01/CDB3/DATAFILE/sysaux01.dbf
input datafile file number=00005 name=/u01/CDB3/DATAFILE/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 07-FEB-16
channel ORA_DISK_1: finished piece 1 at 07-FEB-16
piece handle=/u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T154826_ccg6hllg_.bkp tag=TAG20160207T154826 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/CDB3/DATAFILE/pdbseed/system01.dbf
input datafile file number=00004 name=/u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 07-FEB-16
channel ORA_DISK_1: finished piece 1 at 07-FEB-16
piece handle=/u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T154826_ccg6jcoj_.bkp tag=TAG20160207T154826 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-FEB-16

Starting backup at 07-FEB-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=28 RECID=7 STAMP=903196132
channel ORA_DISK_1: starting piece 1 at 07-FEB-16
channel ORA_DISK_1: finished piece 1 at 07-FEB-16
piece handle=/u01/CDB3/backupset/2016_02_07/o1_mf_annnn_TAG20160207T154852_ccg6jdt4_.bkp tag=TAG20160207T154852 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-FEB-16

Starting Control File and SPFILE Autobackup at 07-FEB-16
piece handle=/u01/CDB3/autobackup/2016_02_07/o1_mf_s_903196133_ccg6jg1v_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 07-FEB-16

RMAN> backup current controlfile;

Starting backup at 07-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 07-FEB-16
channel ORA_DISK_1: finished piece 1 at 07-FEB-16
piece handle=/u01/CDB3/backupset/2016_02_07/o1_mf_ncnnf_TAG20160207T154918_ccg6k742_.bkp tag=TAG20160207T154918 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-FEB-16

Starting Control File and SPFILE Autobackup at 07-FEB-16
piece handle=/u01/CDB3/autobackup/2016_02_07/o1_mf_s_903196160_ccg6k8c8_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 07-FEB-16

Step 2----------------------To check backup Details---------------------------

RMAN> list backup of database
2> ;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    409.59M    DISK        00:00:05     07-FEB-16    
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T135041
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T135041_ccfzlt4b_.bkp
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 388110     07-FEB-16 /u01/CDB3/DATAFILE/system01.dbf
  3       Full 388110     07-FEB-16 /u01/CDB3/DATAFILE/sysaux01.dbf
  5       Full 388110     07-FEB-16 /u01/CDB3/DATAFILE/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    11.81M     DISK        00:00:00     07-FEB-16    
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T135041
        Piece Name: /u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T135041_ccfzmm91_.bkp
  List of Datafiles in backup set 2
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/system01.dbf
  4       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9       Full    409.74M    DISK        00:00:01     07-FEB-16    
        BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T141005
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T141005_ccg0q59m_.bkp
  List of Datafiles in backup set 9
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 389314     07-FEB-16 /u01/CDB3/DATAFILE/system01.dbf
  3       Full 389314     07-FEB-16 /u01/CDB3/DATAFILE/sysaux01.dbf
  5       Full 389314     07-FEB-16 /u01/CDB3/DATAFILE/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10      Full    11.81M     DISK        00:00:00     07-FEB-16    
        BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T141005
        Piece Name: /u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T141005_ccg0qnfl_.bkp
  List of Datafiles in backup set 10
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/system01.dbf
  4       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14      Full    409.53M    DISK        00:00:04     07-FEB-16    
        BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T154826
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T154826_ccg6hllg_.bkp
  List of Datafiles in backup set 14
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 394609     07-FEB-16 /u01/CDB3/DATAFILE/system01.dbf
  3       Full 394609     07-FEB-16 /u01/CDB3/DATAFILE/sysaux01.dbf
  5       Full 394609     07-FEB-16 /u01/CDB3/DATAFILE/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15      Full    11.81M     DISK        00:00:00     07-FEB-16    
        BP Key: 15   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T154826
        Piece Name: /u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T154826_ccg6jcoj_.bkp
  List of Datafiles in backup set 15
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/system01.dbf
  4       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf


Step3 --To check Database Details


RMAN>
RMAN> select file_name from dba_data_files;



FILE_NAME                                                                      
--------------------------------------------------------------------------------

/u01/CDB3/DATAFILE/system01.dbf

/u01/CDB3/DATAFILE/sysaux01.dbf

/u01/CDB3/DATAFILE/undotbs01.dbf


RMAN>

RMAN> creae te tablespace emp datafile '/u01/CDB3/DATAFILE/emp_tbs.dbf' size 100m;

Statement processed

RMAN> exit


-----simulate block corruption-----------------

Recovery Manager complete.
[oracle@exacell01 dbs]$ dd of -=/u01/CDB3/DATAFILE/emp_tbs.dbf' bs=8192 conv=notrunc seek=13 <<EOF
> ;
> /
>
[oracle@exacell01 dbs]$ dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf' bs=8192 conv=notrunc seek=13 <<EOF

;

/

>
[oracle@exacell01 dbs]$ dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf' bs=8192 conv=notrunc seek=13 << EOF
> ;
> ;;
>
>
>
[oracle@exacell01 dbs]$ dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf' bs=8192 conv=notrunc seek=13 << EOF

;

;;



CORRUPT CORRUPT CORRUPT
> EOF
>
>
[oracle@exacell01 dbs]$ dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf' bs=8192 conv=notrunc seek=13 << EOF

CORRUPT CORRUPT CORRUPT

EOF

;                      

;;


CORRUPT CORRUPT CORRUPT

EOF


;                      

;;



<< EOF

;

;;


CORRUPT CORRUPT CORRUPT

EOF



EOF
>

>
[oracle@exacell01 dbs]$ dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf' bs=8192 conv=notrunc seek=13 << EOF

CORRUPT CORRUPT CORRUPT EOF


\\\\


dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf bs=8192 conv=notrunc seek=13 << EOF

CORRUPT CORRUPT CORRUPT EOF


> EOF
0+1 records in
0+1 records out
29 bytes (29 B) copied, 5.3e-05 seconds, 547 kB/s
[oracle@exacell01 dbs]$ dd of=/u01/CDB3/DATAFILE/emp_tbs.dbf bs=8192 conv=notrunc seek=13 << EOF/u01/CDB3/DATAFILE/emp_tbs.dbf/u01/CDB3/DATAFILE/emp_tbs.dbf
/u01/CDB3/DATAFILE/emp_tbs.dbf
/u01/CDB3/DATAFILE/emp_tbs.dbf
/u01/CDB3/DATAFILE/emp_tbs.dbf
/u01/CDB3/DATAFILE/emp_tbs.dbf
d/u01/CDB3/DATAFILE/emp_tbs.dbf
b/u01/CDB3/DATAFILE/emp_tbs.dbf
v/u01/CDB3/DATAFILE/emp_tbs.dbf
e/u01/CDB3/DATAFILE/emp_tbs.dbf
r/u01/CDB3/DATAFILE/emp_tbs.dbfi/u01/CDB3/DATAFILE/emp_tbs.dbff/u01/CDB3/DATAFILE/emp_tbs.dbfy/u01/CDB3/DATAFILE/emp_tbs.dbf /u01/CDB3/DATAFILE/emp_tbs.dbf blocksieze =8192
-bash: dbverify: command not found


---------------Identify the corrupt block----------------

[oracle@exacell01 dbs]$ dbv =/u01/CDB3/DATAFILE/emp_tbs.dbf blocksize=8192file

DBVERIFY: Release 12.1.0.2.0 - Production on Sun Feb 7 16:19:07 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

DBVERIFY - Verification starting : FILE = /u01/CDB3/DATAFILE/emp_tbs.dbf
Page 13 is marked corrupt
Corrupt block relative dba: 0x0180000d (file 6, block 13)
Bad header found during dbv:
Data in bad block:
 type: 67 format: 7 rdba: 0x20545055
 last change scn: 0x5055.52524f43 seq: 0x54 flg: 0x20
 spare1: 0x52 spare2: 0x52 spare3: 0x5252
 consistency value in tail: 0x087a1e02
 check value in block header: 0x4f43
 block checksum disabled



DBVERIFY - Verification complete

Total Pages Examined         : 12800
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 126
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 12673
Total Pages Marked Corrupt   : 1
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 395386 (0.395386)



----------Validate backup --------------


RMAN> backup validate datafile '/u01/CDB3/DATAFILE/emp_tbs.dbf'
2> ;

Starting backup at 07-FEB-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/CDB3/DATAFILE/emp_tbs.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
6    FAILED 0              12673        12800           395386  
  File Name: /u01/CDB3/DATAFILE/emp_tbs.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0              
  Index      0              0              
  Other      1              127            

validate found one or more corrupt blocks
See trace file /u01/app/oracle/diag/rdbms/cdb3/CDB3/trace/CDB3_ora_13004.trc for details
Finished backup at 07-FEB-16

RMAN> select * from v$database  _block_corruption;

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO     CON_ID
---------- ---------- ---------- ------------------ --------- ----------
         6         13          1                  0 CORRUPT            0

RMAN> list backup of database
2> ;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    409.59M    DISK        00:00:05     07-FEB-16    
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T135041
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T135041_ccfzlt4b_.bkp
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 388110     07-FEB-16 /u01/CDB3/DATAFILE/system01.dbf
  3       Full 388110     07-FEB-16 /u01/CDB3/DATAFILE/sysaux01.dbf
  5       Full 388110     07-FEB-16 /u01/CDB3/DATAFILE/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    11.81M     DISK        00:00:00     07-FEB-16    
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T135041
        Piece Name: /u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T135041_ccfzmm91_.bkp
  List of Datafiles in backup set 2
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/system01.dbf
  4       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9       Full    409.74M    DISK        00:00:01     07-FEB-16    
        BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T141005
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T141005_ccg0q59m_.bkp
  List of Datafiles in backup set 9
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 389314     07-FEB-16 /u01/CDB3/DATAFILE/system01.dbf
  3       Full 389314     07-FEB-16 /u01/CDB3/DATAFILE/sysaux01.dbf
  5       Full 389314     07-FEB-16 /u01/CDB3/DATAFILE/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10      Full    11.81M     DISK        00:00:00     07-FEB-16    
        BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T141005
        Piece Name: /u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T141005_ccg0qnfl_.bkp
  List of Datafiles in backup set 10
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/system01.dbf
  4       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14      Full    409.53M    DISK        00:00:04     07-FEB-16    
        BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T154826
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T154826_ccg6hllg_.bkp
  List of Datafiles in backup set 14
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 394609     07-FEB-16 /u01/CDB3/DATAFILE/system01.dbf
  3       Full 394609     07-FEB-16 /u01/CDB3/DATAFILE/sysaux01.dbf
  5       Full 394609     07-FEB-16 /u01/CDB3/DATAFILE/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15      Full    11.81M     DISK        00:00:00     07-FEB-16    
        BP Key: 15   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T154826
        Piece Name: /u01/CDB3/2B28F662D23A22C2E053FEFF76097A52/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T154826_ccg6jcoj_.bkp
  List of Datafiles in backup set 15
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/system01.dbf
  4       Full 27538      07-FEB-16 /u01/CDB3/DATAFILE/pdbseed/sysaux01.dbf

RMAN> list backup of archivelog all;


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


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4       33.92M     DISK        00:00:00     07-FEB-16    
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T140313
        Piece Name: /u01/app/oracle/product/12.1.0.2/db_1/dbs/arch_u04qtb591_s4_p1_t903189793

  List of Archived Logs in backup set 4
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    22      374437     07-FEB-16 385630     07-FEB-16
  1    23      385630     07-FEB-16 385638     07-FEB-16
  1    24      385638     07-FEB-16 389082     07-FEB-16

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
8       37.00K     DISK        00:00:00     07-FEB-16    
        BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T141004
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_annnn_TAG20160207T141004_ccg0q43o_.bkp

  List of Archived Logs in backup set 8
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    25      389082     07-FEB-16 389307     07-FEB-16

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
11      2.50K      DISK        00:00:00     07-FEB-16    
        BP Key: 11   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T141021
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_annnn_TAG20160207T141021_ccg0qolc_.bkp

  List of Archived Logs in backup set 11
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    26      389307     07-FEB-16 389323     07-FEB-16

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
13      7.32M      DISK        00:00:00     07-FEB-16    
        BP Key: 13   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T154825
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_annnn_TAG20160207T154825_ccg6hkcp_.bkp

  List of Archived Logs in backup set 13
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    25      389082     07-FEB-16 389307     07-FEB-16
  1    26      389307     07-FEB-16 389323     07-FEB-16
  1    27      389323     07-FEB-16 394600     07-FEB-16

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
16      9.00K      DISK        00:00:00     07-FEB-16    
        BP Key: 16   Status: AVAILABLE  Compressed: NO  Tag: TAG20160207T154852
        Piece Name: /u01/CDB3/backupset/2016_02_07/o1_mf_annnn_TAG20160207T154852_ccg6jdt4_.bkp

  List of Archived Logs in backup set 16
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    28      394600     07-FEB-16 394626     07-FEB-16


--------------------------restore and validate -----------------

RMAN> blockrecover datafile 7 block 13;

Starting recover at 07-FEB-16
using channel ORA_DISK_1

channel ORA_DISK_1: restoring block(s)
channel ORA_DISK_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00007
channel ORA_DISK_1: reading from backup piece /u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T170531_ccgc0350_.bkp
channel ORA_DISK_1: piece handle=/u01/CDB3/backupset/2016_02_07/o1_mf_nnndf_TAG20160207T170531_ccgc0350_.bkp tag=TAG20160207T170531
channel ORA_DISK_1: restored block(s) from backup piece 1
channel ORA_DISK_1: block restore complete, elapsed time: 00:00:01

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

Finished recover at 07-FEB-16

RMAN> backup validate datafile 7
2> ;

Starting backup at 07-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/CDB3/DATAFILE/emp_tbs1.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
7    OK     0              12673        12800           396896  
  File Name: /u01/CDB3/DATAFILE/emp_tbs1.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0              
  Index      0              0              
  Other      0              127            

Finished backup at 07-FEB-16

RMAN>

RMAN> select * from v$database_block_corruption;


no rows selected

RMAN> select * from v$pdbs;

    CON_ID       DBID    CON_UID
---------- ---------- ----------
GUID                                                                          
--------------------------------------------------------------------------------
NAME                           OPEN_MODE  RES
------------------------------ ---------- ---
OPEN_TIME                             CREATE_SCN TOTAL_SIZE BLOCK_SIZE RECOVERY
------------------------------------- ---------- ---------- ---------- --------
SNAPSHOT_PARENT_CON_ID
----------------------
         2 3616173553 3616173553
2B28F662D23A22C2E053FEFF76097A52                                              
PDB$SEED                       READ ONLY  NO
07-FEB-16 02.28.51.342 PM +05:30             234  393216000       8192 ENABLED
                     0

         3  703186418  703186418
2B2FA40595EB3AC5E053FEFF7609E6AF                                              
ORADB                          OPEN      
07-FEB-16 07.40.26.045 PM +05:30          406068          0       8192 ENABLED
                     0


RMAN>
Recovery Manager complete.
[oracle@exacell01 dbs]$ 

No comments:

Post a Comment