Restore e Recover Database

Il db "primary" è un container mentre il pluggable database che contiene il catalogo, su un altro server, è "rcatpdb" e il pdb che contiene il darafile 23 è "pdb1".

[oracle@rmancat ~]$ rman target sys/system@primary catalog rcatown/rcatown@rcatpdb

Recovery Manager: Release 12.2.0.1.0 - Production on Thu Mar 18 16:17:50 2021

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

connected to target database: ORCL (DBID=1590558615)
connected to recovery catalog database

Vediamo la lista del backup dei datafile permaenti e temporanei del root container e dei pdb.
RMAN> report schema;

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    800      SYSTEM               YES     /u01/app/oracle/oradata/orcl/system01.dbf
3    550      SYSAUX               NO      /u01/app/oracle/oradata/orcl/sysaux01.dbf
4    70       UNDOTBS1             YES     /u01/app/oracle/oradata/orcl/undotbs01.dbf
5    250      PDB$SEED:SYSTEM      NO      /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf


Cancellare il datafile system del pdb SEED dal database primary.
[oracle@primary ~]$ rm /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf


Ritorniamo sul catalog e verifichiamo che il database non è più valido cioè può essere "backuppato".
RMAN> list failure;

Database Role: PRIMARY

no failures found that match specification

RMAN> validate database;

Starting validate at 18-MAR-21
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=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: validation complete, elapsed time: 00:00:03
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1    OK     0              17186        102402          2850461   
  File Name: /u01/app/oracle/oradata/orcl/system01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              67765           
  Index      0              12607           
  Other      0              4842            

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3    OK     0              19035        70430           2850558   
  File Name: /u01/app/oracle/oradata/orcl/sysaux01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              7444            
  Index      0              6819            
  Other      0              37102           

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4    OK     0              257          8960            2850558   
  File Name: /u01/app/oracle/oradata/orcl/undotbs01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0               
  Index      0              0               
  Other      0              8703            

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
7    OK     0              1            641             30002     
  File Name: /u01/app/oracle/oradata/orcl/users01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0               
  Index      0              0               
  Other      0              639             

channel ORA_DISK_1: starting validation of datafile
channel ORA_DISK_1: specifying datafile(s) for validation
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of validate command on ORA_DISK_1 channel at 03/18/2021 16:29:01
ORA-19505: failed to identify file "/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7

RMAN> list failure;

Database Role: PRIMARY

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

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
4907       CRITICAL OPEN      18-MAR-21     System datafile 5: '/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf' is missing

Collegarsi al container database "primary" e chiudere il DB e poi aprilo in stato mount.

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 2835349504 bytes
Fixed Size     8796816 bytes
Variable Size   721421680 bytes
Database Buffers 2097152000 bytes
Redo Buffers     7979008 bytes
Database mounted.

Collegarsi nuovmanete al catalogo:
[oracle@rmancat ~]$ rman target sys/system@primary catalog rcatown/rcatown@rcatpdb

Recovery Manager: Release 12.2.0.1.0 - Production on Thu Mar 18 16:46:00 2021
Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1590558615, not open)
connected to recovery catalog database

RMAN> run {
 allocate channel c1 device type disk;
 restore database;
 recover database;
 release channel c1;
 }

Se riesego
RMAN> validate database;
RMAN> list failure;

Database Role: PRIMARY
no failures found that match specification

Il file è nuovamente presente sul db primary
[oracle@primary ~]$ ls -lrt /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
-rw-r----- 1 oracle oinstall 262152192 Mar 18 16:50 /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf

Aprimo il database:

SQL> alter database open;



Post popolari in questo blog

ORA-12154: TNS: il listener non è attualmente a conoscenza del servizio richiesto nel descrittore di connessione

Create e Drop Pluggable Database