Search This Blog

Total Pageviews

Saturday, 23 January 2021

ORA-19912: cannot recover to target incarnation


ORA-19912: cannot recover to target incarnation

 

RMAN> reset database to incarnation 3;



RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 01/23/2021 10:55:21
ORA-00283: recovery session canceled due to errors
ORA-19912: cannot recover to target incarnation 3



1.
RMAN>
restore controlfile from '/u01/app/oracle/RmanBackup/ORCL_20210123_9_1_CONTROL';
RMAN>

Starting restore at 23-JAN-21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORCL/controlfile/control.crtl
*.db_block_size=8192
*.db_create_file_dest=
output file name=/u01/app/oracle/oradata'
Finished restore at 23-JAN-21


2.
RMAN> alter database mount ;


check incarnation !!!!!!!!!!!

export NLS_DATE_FORMAT='dd-mm-yyyy hh24:mi:ss';    !!!!!!!!!!!!!!!!!!

rman target /
list incarnation;

RMAN> list incarnation;


Recovery Manager complete.
[oracle@ORA-19C-DR controlfile]$ export NLS_DATE_FORMAT='dd-mm-yyyy hh24:mi:ss';
[oracle@ORA-19C-DR controlfile]$ rman target /

Recovery Manager: Release 18.0.0.0.0 - Production on Sat Jan 23 17:27:14 2021
Version 18.12.0.0.0

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

connected to target database: ORCL (DBID=1588126891, not open)





RMAN> list incarnation;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       ORCL     1588126891       PARENT  1          26-01-2017 13:52:29
2       2       ORCL     1588126891       CURRENT 1408558    28-12-2020 12:35:58
5       5       ORCL     1588126891       ORPHAN  5571101    23-01-2021 11:53:40
4       4       ORCL     1588126891       ORPHAN  5571101    23-01-2021 11:06:43
3       3       ORCL     1588126891       ORPHAN  5571490    23-01-2021 10:43:24



No idea why incarnation messed up !!!!!!!!!!


I did restore database . 

RMAN> RESTORE DATABASE;

Starting restore at 23-01-2021 17:28:41
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 device type=DISK

skipping datafile 7; already restored to file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_hymn895b_.dbf
skipping datafile 5; already restored to file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymnby5w_.dbf
skipping datafile 6; already restored to file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymnby55_.dbf
skipping datafile 8; already restored to file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymnby62_.dbf
skipping datafile 9; already restored to file /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_system_hymnsy7h_.dbf
skipping datafile 10; already restored to file /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_sysaux_hymnsy7z_.dbf
skipping datafile 11; already restored to file /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_undotbs1_hymnsy80_.dbf
skipping datafile 12; already restored to file /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_users_hymnv6o1_.dbf
skipping datafile 13; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_system_hymz1hkc_.dbf
skipping datafile 14; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymz1hko_.dbf
skipping datafile 15; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymz1hko_.dbf
skipping datafile 25; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_users_hyoxo51g_.dbf
skipping datafile 16; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_system_hymzdm1q_.dbf
skipping datafile 17; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymzdm1r_.dbf
skipping datafile 18; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymzdm1r_.dbf
skipping datafile 27; already restored to file /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_users_hypg2fww_.dbf
skipping datafile 22; already restored to file /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_system_hymnby5w_.dbf
skipping datafile 23; already restored to file /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_sysaux_hymnby55_.dbf
skipping datafile 24; already restored to file /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_undotbs1_hymnby62_.dbf
skipping datafile 26; already restored to file /u01/app/oracle/oradata/ORCL/VIHAAN2/vihaan2_users01.dbf
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 00001 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymn44tg_.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymn6t87_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymn87yy_.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/RmanBackup/ORCL_20210123_1_1_FULL
channel ORA_DISK_1: piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_1_1_FULL tag=ORCLEE_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 23-01-2021 17:29:57



I have checked the status of all the datafiles i.e FHRBA_SEQ=73 ... so we are good ...


set linesize 300 pagesize 300
col FILE_NAME for a80
select fhdbn,fhdbi,hxfil,fhsta,fhscn,fhafs,fhrba_seq,fhtnm tbs_name,substr(HXFNM,1,70) file_name from x$kcvfh;

FHDBN          FHDBI      HXFIL      FHSTA FHSCN                FHAFS                 FHRBA_SEQ TBS_NAME                       FILE_NAME
--------- ---------- ---------- ---------- -------------------- -------------------- ---------- ------------------------------ --------------------------------------------------------------------------------
ORCL      1588126891          1       8192 5571100              0                            73 SYSTEM                         /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymn44tg_.dbf
ORCL      1588126891          3          0 5571100              0                            73 SYSAUX                         /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymn6t87_.dbf
ORCL      1588126891          4          0 5571100              0                            73 UNDOTBS1                       /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymn87yy_.dbf
ORCL      1588126891          5       8192 5557030              0                            73 SYSTEM                         /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymnby5w_.dbf
ORCL      1588126891          6          0 5557030              0                            73 SYSAUX                         /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymnby55_.dbf
ORCL      1588126891          7          0 5571100              0                            73 USERS                          /u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_hymn895b_.dbf
ORCL      1588126891          8          0 5557030              0                            73 UNDOTBS1                       /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymnby62_.dbf
ORCL      1588126891          9       8192 5568989              0                            73 SYSTEM                         /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile
ORCL      1588126891         10          0 5568989              0                            73 SYSAUX                         /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile
ORCL      1588126891         11          0 5568989              0                            73 UNDOTBS1                       /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile
ORCL      1588126891         12          0 5568989              0                            73 USERS                          /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile
ORCL      1588126891         13       8192 5568990              0                            73 SYSTEM                         /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile
ORCL      1588126891         14          0 5568990              0                            73 SYSAUX                         /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile
ORCL      1588126891         15          0 5568990              0                            73 UNDOTBS1                       /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile
ORCL      1588126891         16       8192 5569012              0                            73 SYSTEM                         /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile
ORCL      1588126891         17          0 5569012              0                            73 SYSAUX                         /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile
ORCL      1588126891         18          0 5569012              0                            73 UNDOTBS1                       /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile
ORCL      1588126891         22       8192 5569017              0                            73 SYSTEM                         /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_system_hymnby5w_.d
ORCL      1588126891         23          0 5569017              0                            73 SYSAUX                         /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_sysaux_hymnby55_.d
ORCL      1588126891         24          0 5569017              0                            73 UNDOTBS1                       /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_undotbs1_hymnby62_
ORCL      1588126891         25          0 5568990              0                            73 USERS                          /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile
ORCL      1588126891         26          0 5569017              0                            73 VIHAAN2_USERS                  /u01/app/oracle/oradata/ORCL/VIHAAN2/vihaan2_users01.dbf
ORCL      1588126891         27          0 5569012              0                            73 USERS                          /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile

23 rows selected.


SQL>  alter database backup controlfile to trace;

Database altered.


SQL> shutdown immediate ;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.


SQL> startup nomount ;  !!!!!!!!!!!!!!!!!!!!!!!!!!
ORACLE instance started.

Total System Global Area 2080372000 bytes
Fixed Size                  8897824 bytes
Variable Size            1191182336 bytes
Database Buffers          872415232 bytes
Redo Buffers                7876608 bytes




check the trace file control file statement 

Create control file !!!!!!

CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_hymn9g57_.log',
    '/u01/app/oracle/fast_recovery_area/orcl/ORCL/onlinelog/o1_mf_1_hymn9h56_.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 2 (
    '/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_hymn9g9j_.log',
    '/u01/app/oracle/fast_recovery_area/orcl/ORCL/onlinelog/o1_mf_2_hymn9hfx_.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 3 (
    '/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_hymnb0fq_.log',
    '/u01/app/oracle/fast_recovery_area/orcl/ORCL/onlinelog/o1_mf_3_hymnb157_.log'
  ) SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymn44tg_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymn6t87_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymn87yy_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymnby5w_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymnby55_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_hymn895b_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymnby62_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_system_hymnsy7h_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_sysaux_hymnsy7z_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_undotbs1_hymnsy80_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_users_hymnv6o1_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_system_hymz1hkc_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymz1hko_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymz1hko_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_system_hymzdm1q_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymzdm1r_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymzdm1r_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_system_hymnby5w_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_sysaux_hymnby55_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_undotbs1_hymnby62_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_users_hyoxo51g_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/vihaan2_users01.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_users_hypg2fww_.dbf'
CHARACTER SET AL32UTF8
;


SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  ARCHIVELOG
  2      MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
  3    4    5      MAXINSTANCES 8
    MAXLOGHISTORY 292
  6    7  LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_hymn9g57_.log',
    '/u01/app/oracle/fast_recovery_area/orcl/ORCL/onlinelog/o1_mf_1_hymn9h56_.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 2 (
    '/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_hymn9g9j_.log',
    '/u01/app/oracle/fast_recovery_area/orcl/ORCL/onlinelog/o1_mf_2_hymn9hfx_.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 3 (
    '/u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_hymnb0fq_.log',
    '/u01/app/oracle/fast_recovery_area/orcl/ORCL/onlinelog/o1_mf_3_hymnb157_.log'
  ) SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymn44tg_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymn6t87_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymn87yy_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymnby5w_.dbf',
  8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26    '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymnby55_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_hymn895b_.dbf',
  '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymnby62_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_system_hymnsy7h_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_sysaux_hymnsy7z_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_undotbs1_hymnsy80_.dbf',
  '/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_users_hymnv6o1_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_system_hymz1hkc_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymz1hko_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymz1hko_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_system_hymzdm1q_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymzdm1r_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymzdm1r_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_system_hymnby5w_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_sysaux_hymnby55_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_undotbs1_hymnby62_.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_users_hyoxo51g_.dbf',
  '/u01/app/oracle/oradata/ORCL/VIHAAN2/vihaan2_users01.dbf',
  '/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_users_hypg2fww_.dbf'
CHARACTER SET AL32UTF8
; 27   28   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45   46

Control file created.


SQL> alter database open resetlogs ;

Database altered.




RMAN> list incarnation;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       ORCL     1588126891       PARENT  1408558    28-12-2020 12:35:58
2       2       ORCL     1588126891       CURRENT 5571101    23-01-2021 17:39:25

!!!!!!!!!!!!!!
You must perform a level 0 backup immediately, because older backups will not work with this new database incarnations.
!!!!!!!!!!!!!!!

TAke new backup !!!!!!!

RMAN> list backup;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
1       Full    18.23M     DISK        00:00:01     23-01-2021 17:40:02
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20210123T174001
        Piece Name: /u01/app/oracle/fast_recovery_area/orcl/ORCL/autobackup/2021_01_23/o1_mf_n_1062610801_j0rqvl2q_.bkp
  Control File Included: Ckp SCN: 5571573      Ckp time: 23-01-2021 17:40:01


delete backup tag = 'TAG20210123T174001';


RMAN> list backup;

specification does not match any backup in the repository




New backup !!!!!!!!!!


RMAN>

 RUN
 {
 configure controlfile autobackup on;
set command id to 'ORCLEEBackupFull';
ALLOCATE CHANNEL c1 DEVICE TYPE disk;
backup AS COMPRESSED BACKUPSET full database tag ORCLEE_FULL format '/u01/app/oracle/RmanBackup/%d_%T_%s_%p_FULL' ;
sql 'alter system archive log current';
sql 'alter system archive log current';
backup tag ORCLEE_ARCHIVE format '/u01/app/oracle/RmanBackup/%d_%T_%s_%p_ARCHIVE' archivelog all delete all input ;
backup tag ORCLEE_CONTROL current controlfile format '/u01/app/oracle/RmanBackup/%d_%T_%s_%p_CONTROL';
release channel c1;
}


 RUN
 {
 configure controlfile autobackup on;
set command id to 'ORCLEEBackupFull';
RMAN> 2> 3> ALLOCATE CHANNEL c1 DEVICE TYPE disk;
backup AS COMPRESSED BACKUPSET full database tag ORCLEE_FULL format '/u01/app/oracle/RmanBackup/%d_%T_%s_%p_FULL' ;
sql 'alter system archive log current';
sql 'alter system archive log current';
backup tag ORCLEE_ARCHIVE format '/u01/app/oracle/RmanBackup/%d_%T_%s_%p_ARCHIVE' archivelog all delete all input ;
backup tag ORCLEE_CONTROL current controlfile format '/u01/app/oracle/RmanBackup/%d_%T_%s_%p_CONTROL';
release channel c1;
}4> 5> 6> 7> 8> 9> 10> 11> 12>

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

executing command: SET COMMAND ID

released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=59 device type=DISK

Starting backup at 23-01-2021 17:49:45
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymn44tg_.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymn87yy_.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymn6t87_.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_hymn895b_.dbf
channel c1: starting piece 1 at 23-01-2021 17:49:45
channel c1: finished piece 1 at 23-01-2021 17:50:50
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_2_1_FULL tag=ORCLEE_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:01:05
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00017 name=/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymzdm1r_.dbf
input datafile file number=00016 name=/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_system_hymzdm1q_.dbf
input datafile file number=00018 name=/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymzdm1r_.dbf
input datafile file number=00027 name=/u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_users_hypg2fww_.dbf
channel c1: starting piece 1 at 23-01-2021 17:50:50
channel c1: finished piece 1 at 23-01-2021 17:51:35
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_3_1_FULL tag=ORCLEE_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:45
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00014 name=/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymz1hko_.dbf
input datafile file number=00015 name=/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymz1hko_.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_system_hymz1hkc_.dbf
input datafile file number=00025 name=/u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_users_hyoxo51g_.dbf
channel c1: starting piece 1 at 23-01-2021 17:51:35
channel c1: finished piece 1 at 23-01-2021 17:52:20
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_4_1_FULL tag=ORCLEE_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:45
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00022 name=/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_system_hymnby5w_.dbf
input datafile file number=00023 name=/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_sysaux_hymnby55_.dbf
input datafile file number=00024 name=/u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_undotbs1_hymnby62_.dbf
input datafile file number=00026 name=/u01/app/oracle/oradata/ORCL/VIHAAN2/vihaan2_users01.dbf
channel c1: starting piece 1 at 23-01-2021 17:52:21
channel c1: finished piece 1 at 23-01-2021 17:53:06
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_5_1_FULL tag=ORCLEE_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:45
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymnby55_.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymnby5w_.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymnby62_.dbf
channel c1: starting piece 1 at 23-01-2021 17:53:06
channel c1: finished piece 1 at 23-01-2021 17:53:51
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_6_1_FULL tag=ORCLEE_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:45
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_sysaux_hymnsy7z_.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_system_hymnsy7h_.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_undotbs1_hymnsy80_.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_users_hymnv6o1_.dbf
channel c1: starting piece 1 at 23-01-2021 17:53:51
channel c1: finished piece 1 at 23-01-2021 17:54:36
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_7_1_FULL tag=ORCLEE_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:45
Finished backup at 23-01-2021 17:54:36

Starting Control File Autobackup at 23-01-2021 17:54:36
piece handle=/u01/app/oracle/fast_recovery_area/orcl/ORCL/autobackup/2021_01_23/o1_mf_n_1062611676_j0rrpwys_.bkp comment=NONE
Finished Control File Autobackup at 23-01-2021 17:54:37

sql statement: alter system archive log current

sql statement: alter system archive log current

Starting backup at 23-01-2021 17:54:38
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1062611678
input archived log thread=1 sequence=2 RECID=2 STAMP=1062611678
input archived log thread=1 sequence=3 RECID=3 STAMP=1062611680
channel c1: starting piece 1 at 23-01-2021 17:54:40
channel c1: finished piece 1 at 23-01-2021 17:54:41
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_9_1_ARCHIVE tag=ORCLEE_ARCHIVE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: deleting archived log(s)
archived log file name=/u01/app/oracle/Archive/Log1_1_1062610765.Arc RECID=1 STAMP=1062611678
archived log file name=/u01/app/oracle/Archive/Log2_1_1062610765.Arc RECID=2 STAMP=1062611678
archived log file name=/u01/app/oracle/Archive/Log3_1_1062610765.Arc RECID=3 STAMP=1062611680
Finished backup at 23-01-2021 17:54:41

Starting backup at 23-01-2021 17:54:41
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 23-01-2021 17:54:43
channel c1: finished piece 1 at 23-01-2021 17:54:44
piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_10_1_CONTROL tag=ORCLEE_CONTROL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-01-2021 17:54:44

Starting Control File Autobackup at 23-01-2021 17:54:44
piece handle=/u01/app/oracle/fast_recovery_area/orcl/ORCL/autobackup/2021_01_23/o1_mf_n_1062611684_j0rrq4h7_.bkp comment=NONE
Finished Control File Autobackup at 23-01-2021 17:54:45

released channel: c1



RMAN> list incarnation;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       ORCL     1588126891       PARENT  1408558    28-12-2020 12:35:58
2       2       ORCL     1588126891       CURRENT 5571101    23-01-2021 17:39:25



delete backup tag ORCLEE_FULL
2> ;




RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
2       B  F  A DISK        23-01-2021 17:50:44 1       1       YES        ORCLEE_FULL
3       B  F  A DISK        23-01-2021 17:51:29 1       1       YES        ORCLEE_FULL
4       B  F  A DISK        23-01-2021 17:52:15 1       1       YES        ORCLEE_FULL
5       B  F  A DISK        23-01-2021 17:53:05 1       1       YES        ORCLEE_FULL
6       B  F  A DISK        23-01-2021 17:53:47 1       1       YES        ORCLEE_FULL
7       B  F  A DISK        23-01-2021 17:54:29 1       1       YES        ORCLEE_FULL
8       B  F  A DISK        23-01-2021 17:54:37 1       1       NO         TAG20210123T175436
9       B  A  A DISK        23-01-2021 17:54:40 1       1       NO         ORCLEE_ARCHIVE
10      B  F  A DISK        23-01-2021 17:54:43 1       1       NO         ORCLEE_CONTROL
11      B  F  A DISK        23-01-2021 17:54:44 1       1       NO         TAG20210123T175444





RMAN> delete backup tag ORCLEE_FULL
2> ;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=59 device type=DISK

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
2       2       1   1   AVAILABLE   DISK        /u01/app/oracle/RmanBackup/ORCL_20210123_2_1_FULL
3       3       1   1   AVAILABLE   DISK        /u01/app/oracle/RmanBackup/ORCL_20210123_3_1_FULL
4       4       1   1   AVAILABLE   DISK        /u01/app/oracle/RmanBackup/ORCL_20210123_4_1_FULL
5       5       1   1   AVAILABLE   DISK        /u01/app/oracle/RmanBackup/ORCL_20210123_5_1_FULL
6       6       1   1   AVAILABLE   DISK        /u01/app/oracle/RmanBackup/ORCL_20210123_6_1_FULL
7       7       1   1   AVAILABLE   DISK        /u01/app/oracle/RmanBackup/ORCL_20210123_7_1_FULL

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_2_1_FULL RECID=2 STAMP=1062611385
deleted backup piece
backup piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_3_1_FULL RECID=3 STAMP=1062611450
deleted backup piece
backup piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_4_1_FULL RECID=4 STAMP=1062611495
deleted backup piece
backup piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_5_1_FULL RECID=5 STAMP=1062611541
deleted backup piece
backup piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_6_1_FULL RECID=6 STAMP=1062611586
deleted backup piece
backup piece handle=/u01/app/oracle/RmanBackup/ORCL_20210123_7_1_FULL RECID=7 STAMP=1062611631
Deleted 6 objects


RMAN> list backup summary;



List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
8       B  F  A DISK        23-01-2021 17:54:37 1       1       NO         TAG20210123T175436
9       B  A  A DISK        23-01-2021 17:54:40 1       1       NO         ORCLEE_ARCHIVE
10      B  F  A DISK        23-01-2021 17:54:43 1       1       NO         ORCLEE_CONTROL
11      B  F  A DISK        23-01-2021 17:54:44 1       1       NO         TAG20210123T175444






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    1140     SYSTEM               YES     /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymn44tg_.dbf
3    640      SYSAUX               NO      /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymn6t87_.dbf
4    880      UNDOTBS1             YES     /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymn87yy_.dbf
5    400      PDB$SEED:SYSTEM      NO      /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_hymnby5w_.dbf
6    420      PDB$SEED:SYSAUX      NO      /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_hymnby55_.dbf
7    5        USERS                NO      /u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_hymn895b_.dbf
8    350      PDB$SEED:UNDOTBS1    NO      /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_hymnby62_.dbf
9    410      ANUJ:SYSTEM          NO      /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_system_hymnsy7h_.dbf
10   430      ANUJ:SYSAUX          NO      /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_sysaux_hymnsy7z_.dbf
11   325      ANUJ:UNDOTBS1        NO      /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_undotbs1_hymnsy80_.dbf
12   5        ANUJ:USERS           NO      /u01/app/oracle/oradata/ORCL/B786A3874A265B38E0538101A8C01F55/datafile/o1_mf_users_hymnv6o1_.dbf
13   410      PDB2:SYSTEM          NO      /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_system_hymz1hkc_.dbf
14   440      PDB2:SYSAUX          NO      /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymz1hko_.dbf
15   440      PDB2:UNDOTBS1        NO      /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymz1hko_.dbf
16   410      VIHAAN:SYSTEM        NO      /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_system_hymzdm1q_.dbf
17   430      VIHAAN:SYSAUX        NO      /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_sysaux_hymzdm1r_.dbf
18   365      VIHAAN:UNDOTBS1      NO      /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_undotbs1_hymzdm1r_.dbf
22   450      VIHAAN2:SYSTEM       NO      /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_system_hymnby5w_.dbf
23   390      VIHAAN2:SYSAUX       NO      /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_sysaux_hymnby55_.dbf
24   380      VIHAAN2:UNDOTBS1     NO      /u01/app/oracle/oradata/ORCL/VIHAAN2/datafile/o1_mf_undotbs1_hymnby62_.dbf
25   1        PDB2:USERS           NO      /u01/app/oracle/oradata/ORCL/B78913A38EB71376E0538101A8C0C4D4/datafile/o1_mf_users_hyoxo51g_.dbf
26   50       VIHAAN2:VIHAAN2_USERS NO      /u01/app/oracle/oradata/ORCL/VIHAAN2/vihaan2_users01.dbf
27   100      VIHAAN:USERS         NO      /u01/app/oracle/oradata/ORCL/B78913A38EB81376E0538101A8C0C4D4/datafile/o1_mf_users_hypg2fww_.dbf



SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ANUJ                           MOUNTED
         4 PDB2                           MOUNTED
         5 VIHAAN                         MOUNTED
         6 VIHAAN2                        MOUNTED
SQL>

Oracle DBA

anuj blog Archive