27 January, 2022

SQL Execution Statistics -- 1 : A Quick Introduction

 A couple of quick examples of how to obtain SQL Execution Statistics using the GATHER_PLAN_STATISTICS Hint


Here's how you get the Statisitics for an SQL executed from the same session.
SQL> Run query with /*+ gather_plan_statistics */ hint
SQL> Get execution statistics with dbms_xplan.display_cursor(FORMAT=>'ALLSTATS LAST');

For an SQL from another session, you will have to pass the SQL_ID (and, if necessary, the CHILD_NUMBER) as a parameter(s) to the DISPLAY_CURSOR function.

I present a query on DEPARTMENTS and EMPLOYEES with a three different execution plans.  The first is the one automatically generated by the Optimizer and using a Hash Join.  The next two use Nested Loop(s) but differently based on how I specify the LEADING and USE_NL Hints.


The first one using a HASH JOIN :


SQL> select /*+ gather_plan_statistics   */
  2  d.department_id, d.department_name, e.first_name, e.last_name
  3  from hr.departments d join hr.employees e
  4  on d.department_id=e.department_id
  5  order by 1,2,4,3
  6  /

DEPARTMENT_ID DEPARTMENT_NAME                FIRST_NAME           LAST_NAME
------------- ------------------------------ -------------------- -------------------------
           10 Administration                 Jennifer             Whalen
           20 Marketing                      Pat                  Fay
           20 Marketing                      Michael              Hartstein
           30 Purchasing                     Shelli               Baida
           30 Purchasing                     Karen                Colmenares
           30 Purchasing                     Guy                  Himuro
           30 Purchasing                     Alexander            Khoo
           30 Purchasing                     Den                  Raphaely
           30 Purchasing                     Sigal                Tobias
           40 Human Resources                Susan                Mavris
           50 Shipping                       Mozhe                Atkinson
....
....  Intermediate rows deleted from the output presented here
....
          100 Finance                        Ismael               Sciarra
          100 Finance                        Jose Manuel          Urman
          110 Accounting                     William              Gietz
          110 Accounting                     Shelley              Higgins
          280 New Department                 Hemant               Chitale

107 rows selected.

SQL>
SQL> @show_last_sql_statistics.sql
SQL> select * from table(dbms_xplan.display_cursor(format=>'ALLSTATS LAST'))
  2  /

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  59vduj8s28fhn, child number 0
-------------------------------------
select /*+ gather_plan_statistics   */ d.department_id,
d.department_name, e.first_name, e.last_name from hr.departments d join
hr.employees e on d.department_id=e.department_id order by 1,2,4,3

Plan hash value: 207737665

-----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT         |                   |      1 |        |    107 |00:00:00.01 |      14 |       |       |          |
|   1 |  SORT ORDER BY           |                   |      1 |    107 |    107 |00:00:00.01 |      14 | 18432 | 18432 |16384  (0)|
|*  2 |   HASH JOIN              |                   |      1 |    107 |    107 |00:00:00.01 |      14 |  1572K|  1572K| 1652K (0)|
|   3 |    TABLE ACCESS FULL     | DEPARTMENTS       |      1 |     29 |     29 |00:00:00.01 |       6 |       |       |          |
|   4 |    VIEW                  | index$_join$_002  |      1 |    108 |    107 |00:00:00.01 |       8 |       |       |          |
|*  5 |     HASH JOIN            |                   |      1 |        |    107 |00:00:00.01 |       8 |  1610K|  1610K| 1681K (0)|
|   6 |      INDEX FAST FULL SCAN| EMP_DEPARTMENT_IX |      1 |    108 |    107 |00:00:00.01 |       4 |       |       |          |
|   7 |      INDEX FAST FULL SCAN| EMP_NAME_IX       |      1 |    108 |    108 |00:00:00.01 |       4 |       |       |          |
-----------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("D"."DEPARTMENT_ID"="E"."DEPARTMENT_ID")
   5 - access(ROWID=ROWID)


27 rows selected.

SQL> SQL>




The second one with a simple NESTED LOOP using  DEPARTMENTS as the "Outer" table :

SQL> select /*+ gather_plan_statistics  leading(d) use_nl(e) */
  2  d.department_id, d.department_name, e.first_name, e.last_name
  3  from hr.departments d join hr.employees e
  4  on d.department_id=e.department_id
  5  order by 1,2,4,3
  6  /

DEPARTMENT_ID DEPARTMENT_NAME                FIRST_NAME           LAST_NAME
------------- ------------------------------ -------------------- -------------------------
           10 Administration                 Jennifer             Whalen
           20 Marketing                      Pat                  Fay
           20 Marketing                      Michael              Hartstein
           30 Purchasing                     Shelli               Baida
           30 Purchasing                     Karen                Colmenares
           30 Purchasing                     Guy                  Himuro
           30 Purchasing                     Alexander            Khoo
           30 Purchasing                     Den                  Raphaely
           30 Purchasing                     Sigal                Tobias
           40 Human Resources                Susan                Mavris
           50 Shipping                       Mozhe                Atkinson
....
....  Intermediate rows deleted from the output presented here
....
          100 Finance                        Ismael               Sciarra
          100 Finance                        Jose Manuel          Urman
          110 Accounting                     William              Gietz
          110 Accounting                     Shelley              Higgins
          280 New Department                 Hemant               Chitale

107 rows selected.


SQL>
SQL> @show_last_sql_statistics.sql
SQL> select * from table(dbms_xplan.display_cursor(format=>'ALLSTATS LAST'))
  2  /

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8q08zbr367cgg, child number 0
-------------------------------------
select /*+ gather_plan_statistics  leading(d) use_nl(e) */
d.department_id, d.department_name, e.first_name, e.last_name from
hr.departments d join hr.employees e on d.department_id=e.department_id
order by 1,2,4,3

Plan hash value: 2178791499

----------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                   |      1 |        |    107 |00:00:00.01 |      19 |       |       |          |
|   1 |  SORT ORDER BY                |                   |      1 |    107 |    107 |00:00:00.01 |      19 | 22528 | 22528 |20480  (0)|
|   2 |   NESTED LOOPS                |                   |      1 |    107 |    107 |00:00:00.01 |      19 |       |       |          |
|   3 |    NESTED LOOPS               |                   |      1 |    261 |    107 |00:00:00.01 |       9 |       |       |          |
|   4 |     TABLE ACCESS FULL         | DEPARTMENTS       |      1 |     29 |     29 |00:00:00.01 |       6 |       |       |          |
|*  5 |     INDEX RANGE SCAN          | EMP_DEPARTMENT_IX |     29 |      9 |    107 |00:00:00.01 |       3 |       |       |          |
|   6 |    TABLE ACCESS BY INDEX ROWID| EMPLOYEES         |    107 |      4 |    107 |00:00:00.01 |      10 |       |       |          |
----------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access("D"."DEPARTMENT_ID"="E"."DEPARTMENT_ID")


26 rows selected.

SQL> SQL>


And the third, more complicated, Execution Plan for a slightly different SQL :

SQL> select /*+ gather_plan_statistics  leading(e) use_nl(d) */
  2  d.department_id, d.department_name, e.first_name, e.last_name
  3  from hr.departments d join hr.employees e
  4  on d.department_id=e.department_id
  5  order by 1,2,4,3
  6  /

DEPARTMENT_ID DEPARTMENT_NAME                FIRST_NAME           LAST_NAME
------------- ------------------------------ -------------------- -------------------------
           10 Administration                 Jennifer             Whalen
           20 Marketing                      Pat                  Fay
           20 Marketing                      Michael              Hartstein
           30 Purchasing                     Shelli               Baida
           30 Purchasing                     Karen                Colmenares
           30 Purchasing                     Guy                  Himuro
           30 Purchasing                     Alexander            Khoo
           30 Purchasing                     Den                  Raphaely
           30 Purchasing                     Sigal                Tobias
           40 Human Resources                Susan                Mavris
           50 Shipping                       Mozhe                Atkinson
....
....  Intermediate rows deleted from the output presented here
....
          100 Finance                        Ismael               Sciarra
          100 Finance                        Jose Manuel          Urman
          110 Accounting                     William              Gietz
          110 Accounting                     Shelley              Higgins
          280 New Department                 Hemant               Chitale

107 rows selected.

SQL>
SQL> @show_last_sql_statistics.sql
SQL> select * from table(dbms_xplan.display_cursor(format=>'ALLSTATS LAST'))
  2  /

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2kbc7rcpjcu0w, child number 0
-------------------------------------
select /*+ gather_plan_statistics  leading(e) use_nl(d) */
d.department_id, d.department_name, e.first_name, e.last_name from
hr.departments d join hr.employees e on d.department_id=e.department_id
order by 1,2,4,3

Plan hash value: 2010582952

----------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                   |      1 |        |    107 |00:00:00.01 |     119 |       |       |          |
|   1 |  SORT ORDER BY                |                   |      1 |    107 |    107 |00:00:00.01 |     119 | 18432 | 18432 |16384  (0)|
|   2 |   NESTED LOOPS                |                   |      1 |    107 |    107 |00:00:00.01 |     119 |       |       |          |
|   3 |    NESTED LOOPS               |                   |      1 |    108 |    107 |00:00:00.01 |      12 |       |       |          |
|   4 |     VIEW                      | index$_join$_002  |      1 |    108 |    107 |00:00:00.01 |       8 |       |       |          |
|*  5 |      HASH JOIN                |                   |      1 |        |    107 |00:00:00.01 |       8 |  1610K|  1610K| 1539K (0)|
|   6 |       INDEX FAST FULL SCAN    | EMP_DEPARTMENT_IX |      1 |    108 |    107 |00:00:00.01 |       4 |       |       |          |
|   7 |       INDEX FAST FULL SCAN    | EMP_NAME_IX       |      1 |    108 |    108 |00:00:00.01 |       4 |       |       |          |
|*  8 |     INDEX UNIQUE SCAN         | DEPT_ID_PK        |    107 |      1 |    107 |00:00:00.01 |       4 |       |       |          |
|   9 |    TABLE ACCESS BY INDEX ROWID| DEPARTMENTS       |    107 |      1 |    107 |00:00:00.01 |     107 |       |       |          |
----------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(ROWID=ROWID)
   8 - access("D"."DEPARTMENT_ID"="E"."DEPARTMENT_ID")


30 rows selected.

SQL> SQL>


All three executions return exactly the same Result Set.  What are different are the Execution Plans and the Logical Reads.
The first Execution Plan (using a HASH JOIN) required 14 Logical Reads (Buffer Gets).
Note how the Second Execution required 19 Logical Reads  while the Third Execution required 119 Logical Reads  having queried the DEPARTMENTS Table via the Rows from the Nested Loop driven by the intermdiate "view" index$_join$_001  107 times (reading 1 Block each time).  

Since these are extremely small tables, the Actual Time is less than 1second but what matters in the comparison is the number of Logical Reads

("Starts" is the number of times that particular Step (Id) was actually executed, 
"E-Rows" is the Estimated Rows for the Execution Plan,
"A-Rows" is the *Actual* number of Rows retrieved at Runtime,
"A-Time" is the *Actual* Time in Hours:Minutes:Seconds,
"0mem" is the "Estimated Optimal Memory Usage", 
"1mem" is the Estimated 1-pass (one write to temp) Memory Usage 
"Used-Mem" is the Actual Memory Used)


SQL> select table_name, blocks, num_rows
  2  from dba_tables
  3  where owner = 'HR'
  4  and table_name in ('DEPARTMENTS','EMPLOYEES')
  5  order by 1
  6  /

TABLE_NAME                         BLOCKS   NUM_ROWS
------------------------------ ---------- ----------
DEPARTMENTS                             5         29
EMPLOYEES                               5        108

SQL>


Given the sizes of the two tables, I am sure that all the blocks are cached in the Buffer Cache, so I am not interested in Physical I/O statistics and Wait Times.  The Logical Reads consume CPU time.

This is an example of how to read SQL Execution Statistics.  

You may extrapolate to tables with thousands of blocks and tens of thousands of rows.  

Also, consider Memory Usage for the operations when you may have dozens of hundreds of sessions concurrently doing HASH JOINs and SORTs and being limited by PGA_AGGREGATE_TARGET.  Some Memory operations may overflow to the TEMP Tablespace, noticeably increasing total execution time.

23 January, 2022

Refreshable Clone PDB -- 4 Converting it to a Read Write PDB

 As demonstrated in my first post on Refreshable Clone PDBs, the Clone PDB can be opened in only READ ONLY mode.  This is akin to a Basic Materialized View or a Read Only Standby Database, either of which is updated from the source table(s) / database.

Such a Refreshable Clone PDB is useful as a Reporting Database where you can run queries / extracts -- with data AS OF the last Refresh -- without putting load on the running Production (Transactional, Read Write Database).

But if you want to (finally) open the Clone PDB in Read Write mode (and severe any links with the source, thus preventing further Refresh's) you can do so by changing the Refresh Mode.



SQL> alter pluggable database ro_pdb open read only;

Pluggable database altered.

SQL> connect hemant/newhemant@ro_pdb
Connected.
SQL> select count(*) from list_of_objects;

  COUNT(*)
----------
     73645

SQL> connect / as sysdba
Connected.

SQL> alter pluggable database ro_pdb close;  -- close it so that I can do a REFRESH

Pluggable database altered.

SQL>
SQL> alter pluggable database ro_pdb refresh;  -- execute the REFRES

Pluggable database altered.

SQL> alter pluggable database ro_pdb open ;  -- attempt to OPEN, defaulting to READ WRITE mode
alter pluggable database ro_pdb open
*
ERROR at line 1:
ORA-65341: cannot open pluggable database in read/write mode


SQL> alter pluggable database ro_pdb open read write;
alter pluggable database ro_pdb open read write
*
ERROR at line 1:
ORA-65341: cannot open pluggable database in read/write mode


SQL>
SQL> alter pluggable database ro_pdb open read only;  -- open READ ONLY

Pluggable database altered.

SQL> connect hemant/newhemant@ro_pdb
Connected.
SQL> select count(*) from list_of_objects;  -- verify that the database has been refreshed (new rows visible in the source table)

  COUNT(*)
----------
     83645

SQL>
SQL> connect / as sysdba
Connected.
SQL> alter pluggable database ro_pdb close;  -- close it again

Pluggable database altered.

SQL>
SQL> alter pluggable database ro_pdb refresh mode none ;  -- ***DISABLE FURTHER REFRESH's***

Pluggable database altered.

SQL>
SQL> alter pluggable database ro_pdb open read write;  -- open in READ WRITE mode now !!

Pluggable database altered.

SQL>
SQL> connect hemant/newhemant@ro_pdb
Connected.
SQL> select count(*) from list_of_objects;

  COUNT(*)
----------
     83645

SQL> delete list_of_objects where owner = 'HEMANT';  -- proof that the database is now WRITABLE

32 rows deleted.

SQL> commit;

Commit complete.

SQL>
SQL> alter pluggable database ro_pdb close;

Pluggable database altered.

SQL> alter pluggable database ro_pdb refresh;  -- check if it can be REFRESH'ed from the source
alter pluggable database ro_pdb refresh
*
ERROR at line 1:
ORA-65261: pluggable database RO_PDB not enabled for refresh


SQL>


Thus, to enable the PDB to be WRITABLE, REFRESH has to be disabled. 
 Once REFRESH is disabled, the PDB can no longer be refreshed from the source. It has diverged from the source.

These are the alert log messages when REFRESH is disabled :


2022-01-23T15:35:55.766486+08:00
alter pluggable database ro_pdb refresh mode none
2022-01-23T15:35:55.846041+08:00
RO_PDB(6):Pluggable database RO_PDB pseudo opening
RO_PDB(6):SUPLOG: Initialize PDB SUPLOG SGA, old value 0x0, new value 0x18
RO_PDB(6):Autotune of undo retention is turned on.
RO_PDB(6):Endian type of dictionary set to little
RO_PDB(6):Undo initialization recovery: Parallel FPTR failed: start:1511350 end:1511367 diff:17 ms (0.0 seconds)
RO_PDB(6):Undo initialization recovery: err:0 start: 1511329 end: 1511464 diff: 135 ms (0.1 seconds)
RO_PDB(6):[6305] Successfully onlined Undo Tablespace 2.
RO_PDB(6):Undo initialization online undo segments: err:0 start: 1511465 end: 1511507 diff: 42 ms (0.0 seconds)
RO_PDB(6):Undo initialization finished serial:0 start:1511329 end:1511509 diff:180 ms (0.2 seconds)
RO_PDB(6):Database Characterset for RO_PDB is AL32UTF8
2022-01-23T15:35:57.144146+08:00
RO_PDB(6):Pluggable database RO_PDB pseudo closing
RO_PDB(6):JIT: pid 6305 requesting stop
RO_PDB(6):Closing sequence subsystem (1512195729).
RO_PDB(6):Buffer Cache flush started: 6
RO_PDB(6):Buffer Cache flush finished: 6
Completed: alter pluggable database ro_pdb refresh mode none


And these are the messages when it is OPENed in READ WRITE mode :



2022-01-23T15:36:56.085938+08:00
alter pluggable database ro_pdb open read write
2022-01-23T15:36:56.088166+08:00
RO_PDB(6):Pluggable database RO_PDB opening in read write
RO_PDB(6):SUPLOG: Initialize PDB SUPLOG SGA, old value 0x0, new value 0x18
RO_PDB(6):Autotune of undo retention is turned on.
RO_PDB(6):Endian type of dictionary set to little
RO_PDB(6):Undo initialization recovery: Parallel FPTR complete: start:1571711 end:1571732 diff:21 ms (0.0 seconds)
RO_PDB(6):Undo initialization recovery: err:0 start: 1571710 end: 1571732 diff: 22 ms (0.0 seconds)
2022-01-23T15:36:58.249919+08:00
RO_PDB(6):[6305] Successfully onlined Undo Tablespace 2.
RO_PDB(6):Undo initialization online undo segments: err:0 start: 1571732 end: 1573115 diff: 1383 ms (1.4 seconds)
RO_PDB(6):Undo initialization finished serial:0 start:1571710 end:1573161 diff:1451 ms (1.5 seconds)
RO_PDB(6):Deleting old file#9 from file$
RO_PDB(6):Deleting old file#10 from file$
RO_PDB(6):Deleting old file#11 from file$
RO_PDB(6):Deleting old file#12 from file$
RO_PDB(6):Deleting old file#26 from file$
RO_PDB(6):Deleting old file#31 from file$
RO_PDB(6):Deleting old file#32 from file$
RO_PDB(6):Deleting old file#33 from file$
RO_PDB(6):Deleting old file#34 from file$
RO_PDB(6):Adding new file#50 to file$(old file#9).             fopr-1, newblks-48640, oldblks-19200
RO_PDB(6):Adding new file#51 to file$(old file#10).             fopr-1, newblks-61440, oldblks-15360
RO_PDB(6):Adding new file#52 to file$(old file#11).             fopr-1, newblks-58240, oldblks-12800
RO_PDB(6):Adding new file#53 to file$(old file#12).             fopr-1, newblks-46880, oldblks-640
RO_PDB(6):Adding new file#54 to file$(old file#26).             fopr-1, newblks-12800, oldblks-12800
RO_PDB(6):Adding new file#56 to file$(old file#31).             fopr-1, newblks-12800, oldblks-12800
RO_PDB(6):Adding new file#55 to file$(old file#32).             fopr-1, newblks-12800, oldblks-12800
RO_PDB(6):Adding new file#57 to file$(old file#34).             fopr-1, newblks-115200, oldblks-12800
RO_PDB(6):Successfully created internal service RO_PDB at open
2022-01-23T15:36:59.694482+08:00
****************************************************************
Post plug operations are now complete.
Pluggable database RO_PDB with pdb id - 6 is now marked as NEW.
****************************************************************
RO_PDB(6):Pluggable database RO_PDB dictionary check beginning
RO_PDB(6):Pluggable Database RO_PDB Dictionary check complete
RO_PDB(6):Database Characterset for RO_PDB is AL32UTF8
2022-01-23T15:37:05.752451+08:00
RO_PDB(6):JIT: pid 6305 requesting full stop
2022-01-23T15:37:11.910855+08:00
RO_PDB(6):SUPLOG: Set PDB SUPLOG SGA at PDB OPEN, old 0x18, new 0x0 (no suplog)
2022-01-23T15:37:20.655852+08:00
RO_PDB(6):Opening pdb with no Resource Manager plan active
RO_PDB(6):joxcsys_required_dirobj_exists: directory object exists with required path /opt/oracle/product/19c/dbhome_1/javavm/admin/, pid 6305 cid 6
2022-01-23T15:37:22.578807+08:00
Pluggable database RO_PDB opened read write
Completed: alter pluggable database ro_pdb open read write


Note : To understand FILE# values, see my previous post on Datafile Names for Refresh Clone PDB.
(Some of the FILE# values have changed since that post because I have added a new tablespace in the source database and recreated RO_PDB as a Refreshable Clone PDB since that post).

20 January, 2022

The Contents of the Database Controlfile -- 3 : Recreating the Controlfile

 In my previous posts, I have shown the Logical Structure and the Physical Contents of the Controlfile.  It is clear that some of the sections (e.g. for "ARCHIVED LOG" entries) have many slots (or "records") not all of which are currently in use.

What happens if you recreate the controlfile ?  Since my first post, I have generated some more Backup Pieces and ArchiveLogs (and purged ArchiveLogs) so the RECORDS_UESD or INDEXes of "BACKUP DATAFILE", "BACKUP PIECE" and "ARCHIVED LOG" in this listing are different from that first listing.



SQL> select *
  2  from v$controlfile_record_section
  3  order by type
  4  /

TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID     CON_ID
---------------------------- ----------- ------------- ------------ ----------- ---------- ---------- ----------
ACM OPERATION                        104            64           11           0          0          0          0
ARCHIVED LOG                         584           383          383         198        197       1444          0
AUXILIARY DATAFILE COPY              584           128            0           0          0          0          0
BACKUP CORRUPTION                     44          1115            0           0          0          0          0
BACKUP DATAFILE                      200          1063          210           1        210        210          0
BACKUP PIECE                         780          1006          160           1        160        160          0
BACKUP REDOLOG                        76           215          215          51         50        265          0
BACKUP SET                            96          1022          149           1        149        149          0
BACKUP SPFILE                        124           131           33           1         33         33          0
CKPT PROGRESS                       8180            11            0           0          0          0          0
COPY CORRUPTION                       40          1227            0           0          0          0          0
DATABASE                             316             1            1           0          0          0          0
DATABASE BLOCK CORRUPTION             80          8384            0           0          0          0          0
DATABASE INCARNATION                  56           292            4           1          4          4          0
DATAFILE                             520          1024           34           0          0       1532          0
DATAFILE COPY                        736          1000            3           1          3          3          0
DATAFILE HISTORY                     568            57            0           0          0          0          0
DELETED OBJECT                        20           818          818          14         13        831          0
FILENAME                             524          4146           29           0          0          0          0
FLASHBACK LOG                         84          2048            2           0          0          0          0
FOREIGN ARCHIVED LOG                 604          1002            0           0          0          0          0
GUARANTEED RESTORE POINT             256          2048            1           0          0          2          0
INSTANCE SPACE RESERVATION            28          1055            1           0          0          0          0
LOG HISTORY                           56           292          292          54         53        637          0
MTTR                                 100             8            1           0          0          0          0
MULTI INSTANCE REDO APPLY            556             1            0           0          0          0          0
OFFLINE RANGE                        200          1063          696           1        696        696          0
PDB RECORD                           780            10            5           0          0         26          0
PDBINC RECORD                        144           113            0           0          0          0          0
PROXY COPY                           928          1004            0           0          0          0          0
RECOVERY DESTINATION                 180             1            1           0          0          0          0
REDO LOG                              72            16            4           0          0         15          0
REDO THREAD                          256             8            1           0          0          0          0
REMOVABLE RECOVERY FILES              32          1000            6           0          0          0          0
RESTORE POINT                        256          2108            0           0          0          0          0
RMAN CONFIGURATION                  1108            50            3           0          0          7          0
RMAN STATUS                          116           141          141          98         97        379          0
STANDBY DATABASE MATRIX              400           128          128           0          0          0          0
TABLESPACE                           180          1024           22           0          0         75          0
TABLESPACE KEY HISTORY               108           151            0           0          0          0          0
TEMPORARY FILENAME                    56          1024            7           0          0         36          0
THREAD INSTANCE NAME MAPPING          80             8            8           0          0          0          0

42 rows selected.

SQL>
SQL> alter database backup controlfile to trace as '/home/oracle/controlfile_creation.txt';

Database altered.

SQL>

SQL> !cat /home/oracle/controlfile_creation.txt
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="ORCLCDB"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_1='OPTIONAL REOPEN=300 NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='REGISTER'
-- LOG_ARCHIVE_DEST_1='NOALTERNATE'
-- LOG_ARCHIVE_DEST_1='NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE

--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.

-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCLCDB" NORESETLOGS FORCE LOGGING ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/opt/oracle/oradata/ORCLCDB/redo01.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 2 '/opt/oracle/oradata/ORCLCDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 3 '/opt/oracle/oradata/ORCLCDB/redo03.log'  SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
--   GROUP 4 '/opt/oracle/oradata/ORCLCDB/stdbredo01.log'  SIZE 200M BLOCKSIZE 512
DATAFILE
  '/opt/oracle/oradata/ORCLCDB/system01.dbf',
  '/opt/oracle/oradata/ORCLCDB/sysaux01.dbf',
  '/opt/oracle/oradata/ORCLCDB/undotbs01.dbf',
  '/opt/oracle/oradata/ORCLCDB/pdbseed/system01.dbf',
  '/opt/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf',
  '/opt/oracle/oradata/ORCLCDB/users01.dbf',
  '/opt/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_data_min_j2p8z0qn_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_system_j80dl8qy_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_sysaux_j80dl94j_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_undotbs1_j80dl96d_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_rman_tbs_j80f07n8_.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_hemant_d_jtkoo5nr_.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_hemant_d_jtkoojqn_.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_tpcctab_jyl0mzsp_.dbf'
CHARACTER SET AL32UTF8
;

-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('ARCHIVELOG DELETION POLICY','TO BACKED UP 1 TIMES TO DISK');
-- Configure RMAN configuration record 2
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RETENTION POLICY','TO REDUNDANCY 2');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE

-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;

-- Database can now be opened normally.
ALTER DATABASE OPEN;

-- Open all the PDBs.
ALTER PLUGGABLE DATABASE ALL OPEN;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/temp01.dbf'
     SIZE 138412032  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "PDB$SEED";
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/pdbseed/temp012019-05-04_23-32-15-038-PM.dbf'
     SIZE 76546048  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "ORCLPDB1";
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/temp01.dbf'
     SIZE 135266304  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/temp02.dbf'
     SIZE 52428800  REUSE AUTOEXTEND OFF;
ALTER SESSION SET CONTAINER = "RMANCAT";
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_temp_j80dl97t_.dbf'
     SIZE 77594624  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "CDB$ROOT";
-- End of tempfile additions.
--
--
--
----------------------------------------------------------
-- The following script can be used on the standby database
-- to re-populate entries for a standby controlfile created
-- on the primary and copied to the standby site.
----------------------------------------------------------
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 '/opt/oracle/oradata/ORCLCDB/stdbredo01.log'
 SIZE 200M BLOCKSIZE 512 REUSE;
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.

-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCLCDB" RESETLOGS FORCE LOGGING ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/opt/oracle/oradata/ORCLCDB/redo01.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 2 '/opt/oracle/oradata/ORCLCDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 3 '/opt/oracle/oradata/ORCLCDB/redo03.log'  SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
--   GROUP 4 '/opt/oracle/oradata/ORCLCDB/stdbredo01.log'  SIZE 200M BLOCKSIZE 512
DATAFILE
  '/opt/oracle/oradata/ORCLCDB/system01.dbf',
  '/opt/oracle/oradata/ORCLCDB/sysaux01.dbf',
  '/opt/oracle/oradata/ORCLCDB/undotbs01.dbf',
  '/opt/oracle/oradata/ORCLCDB/pdbseed/system01.dbf',
  '/opt/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf',
  '/opt/oracle/oradata/ORCLCDB/users01.dbf',
  '/opt/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf',
  '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_data_min_j2p8z0qn_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_system_j80dl8qy_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_sysaux_j80dl94j_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_undotbs1_j80dl96d_.dbf',
  '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_rman_tbs_j80f07n8_.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_hemant_d_jtkoo5nr_.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_hemant_d_jtkoojqn_.dbf',
  '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_tpcctab_jyl0mzsp_.dbf'
CHARACTER SET AL32UTF8
;

-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('ARCHIVELOG DELETION POLICY','TO BACKED UP 1 TIMES TO DISK');
-- Configure RMAN configuration record 2
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RETENTION POLICY','TO REDUNDANCY 2');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE

-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;

-- Open all the PDBs.
ALTER PLUGGABLE DATABASE ALL OPEN;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/temp01.dbf'
     SIZE 138412032  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "PDB$SEED";
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/pdbseed/temp012019-05-04_23-32-15-038-PM.dbf'
     SIZE 76546048  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "ORCLPDB1";
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/temp01.dbf'
     SIZE 135266304  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/temp02.dbf'
     SIZE 52428800  REUSE AUTOEXTEND OFF;
ALTER SESSION SET CONTAINER = "RMANCAT";
ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_temp_j80dl97t_.dbf'
     SIZE 77594624  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "CDB$ROOT";
-- End of tempfile additions.
--
--
--
----------------------------------------------------------
-- The following script can be used on the standby database
-- to re-populate entries for a standby controlfile created
-- on the primary and copied to the standby site.
----------------------------------------------------------
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 '/opt/oracle/oradata/ORCLCDB/stdbredo01.log'
 SIZE 200M BLOCKSIZE 512 REUSE;

SQL>


The trace that is generated with the "alter database backup controlfile to trace ..." command actually contains the SQL statements that can be used to recreate the controlfile.  There are a number of useful comments also added.
Essentially, there are two sets of SQL commands.  

The first set, titled "Set #1" is for the NORESETLOGS scenario where all the Online Redo Log files are available.
The second set, titled "Set #2" is for a RESETLOGS scenario where Incomplete Recovery is required because not all the Online Redo Log files are available.

In my case, I have all my Online Redo Log files so I do not lose any data and I can use the commands from Set #1.

Recreating the Controlfile :


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

SQL> @Recreate_Controlfile.SQL
SQL> spool Recreate_Controlfile
SQL>
SQL> STARTUP NOMOUNT
ORACLE instance started.

Total System Global Area 1207955544 bytes
Fixed Size                  9134168 bytes
Variable Size             671088640 bytes
Database Buffers          520093696 bytes
Redo Buffers                7639040 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCLCDB" NORESETLOGS FORCE LOGGING ARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 1024
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 '/opt/oracle/oradata/ORCLCDB/redo01.log'  SIZE 200M BLOCKSIZE 512,
  9    GROUP 2 '/opt/oracle/oradata/ORCLCDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
 10    GROUP 3 '/opt/oracle/oradata/ORCLCDB/redo03.log'  SIZE 200M BLOCKSIZE 512
 11  -- STANDBY LOGFILE
 12  --   GROUP 4 '/opt/oracle/oradata/ORCLCDB/stdbredo01.log'  SIZE 200M BLOCKSIZE 512
 13  DATAFILE
 14    '/opt/oracle/oradata/ORCLCDB/system01.dbf',
 15    '/opt/oracle/oradata/ORCLCDB/sysaux01.dbf',
 16    '/opt/oracle/oradata/ORCLCDB/undotbs01.dbf',
 17    '/opt/oracle/oradata/ORCLCDB/pdbseed/system01.dbf',
 18    '/opt/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf',
 19    '/opt/oracle/oradata/ORCLCDB/users01.dbf',
 20    '/opt/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf',
 21    '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf',
 22    '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf',
 23    '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf',
 24    '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf',
 25    '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_data_min_j2p8z0qn_.dbf',
 26    '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_system_j80dl8qy_.dbf',
 27    '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_sysaux_j80dl94j_.dbf',
 28    '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_undotbs1_j80dl96d_.dbf',
 29    '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_rman_tbs_j80f07n8_.dbf',
 30    '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_hemant_d_jtkoo5nr_.dbf',
 31    '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_hemant_d_jtkoojqn_.dbf',
 32    '/opt/oracle/oradata/ORCLCDB/8812E29864F47615E0530100007FA424/datafile/o1_mf_tpcctab_jyl0mzsp_.dbf'
 33  CHARACTER SET AL32UTF8
 34  ;

Control file created.

SQL>
SQL> -- Configure RMAN configuration record 1
SQL> VARIABLE RECNO NUMBER;
SQL> EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('ARCHIVELOG DELETION POLICY','TO BACKED UP 1 TIMES TO DISK');

PL/SQL procedure successfully completed.

SQL> -- Configure RMAN configuration record 2
SQL> VARIABLE RECNO NUMBER;
SQL> EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET');

PL/SQL procedure successfully completed.

SQL> -- Configure RMAN configuration record 3
SQL> VARIABLE RECNO NUMBER;
SQL> EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RETENTION POLICY','TO REDUNDANCY 2');

PL/SQL procedure successfully completed.

SQL> -- Recovery is required if any of the datafiles are restored backups,
SQL> -- or if the last shutdown was not normal or immediate.
SQL> -- I will be doing a SHUTDOWN IMMEDIATE so I do not need a RECOVER DATABASE
SQL> -- RECOVER DATABASE
SQL>
SQL> -- All logs need archiving and a log switch is needed.
SQL> ALTER SYSTEM ARCHIVE LOG ALL;

System altered.

SQL>
SQL> -- Database can now be opened normally.
SQL> ALTER DATABASE OPEN;

Database altered.

SQL>
SQL> -- Open all the PDBs.
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;

Pluggable database altered.

SQL>
SQL> -- Commands to add tempfiles to temporary tablespaces.
SQL> -- Online tempfiles have complete space information.
SQL> -- Other tempfiles may require adjustment.
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/temp01.dbf'
  2       SIZE 138412032  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

Tablespace altered.

SQL> ALTER SESSION SET CONTAINER = "PDB$SEED";

Session altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/pdbseed/temp012019-05-04_23-32-15-038-PM.dbf'
  2       SIZE 76546048  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

Tablespace altered.

SQL> ALTER SESSION SET CONTAINER = "ORCLPDB1";

Session altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/temp01.dbf'
  2       SIZE 135266304  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

Tablespace altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/temp02.dbf'
  2       SIZE 52428800  REUSE AUTOEXTEND OFF;

Tablespace altered.

SQL> ALTER SESSION SET CONTAINER = "RMANCAT";

Session altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/oradata/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/datafile/o1_mf_temp_j80dl97t_.dbf'
  2       SIZE 77594624  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

Tablespace altered.

SQL> ALTER SESSION SET CONTAINER = "CDB$ROOT";

Session altered.

SQL> -- End of tempfile additions.
SQL>
SQL> spool off
SQL>
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     71
Next log sequence to archive   73
Current log sequence           73
SQL>


The ARCHIVE LOG LIST output shows that I did NOT have to do a RESETLOGS. The CREATE CONTROLFILE and ALTER DATABASE OPEN commands succeeded.

What do I now see in the Logical Entries in the Controlfile ?


SQL> select *
  2  from v$controlfile_record_section
  3  order by type
  4  /

TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID     CON_ID
---------------------------- ----------- ------------- ------------ ----------- ---------- ---------- ----------
ACM OPERATION                        104            64           11           0          0          0          0
ARCHIVED LOG                         584           308            3           1          3          3          0
AUXILIARY DATAFILE COPY              584           128            0           0          0          0          0
BACKUP CORRUPTION                     44          1115            0           0          0          0          0
BACKUP DATAFILE                      200          1063            0           0          0          0          0
BACKUP PIECE                         780          1006            0           0          0          0          0
BACKUP REDOLOG                        76           215            0           0          0          0          0
BACKUP SET                            96          1022            0           0          0          0          0
BACKUP SPFILE                        124           131            0           0          0          0          0
CKPT PROGRESS                       8180            11            0           0          0          0          0
COPY CORRUPTION                       40          1227            0           0          0          0          0
DATABASE                             316             1            1           0          0          0          0
DATABASE BLOCK CORRUPTION             80          8384            0           0          0          0          0
DATABASE INCARNATION                  56           292            2           1          2          2          0
DATAFILE                             520          1024           34           0          0         39          0
DATAFILE COPY                        736          1000            0           0          0          0          0
DATAFILE HISTORY                     568            57            0           0          0          0          0
DELETED OBJECT                        20           818            0           0          0          0          0
FILENAME                             524          4146           27           0          0          0          0
FLASHBACK LOG                         84          2048            0           0          0          0          0
FOREIGN ARCHIVED LOG                 604          1002            0           0          0          0          0
GUARANTEED RESTORE POINT             256          2048            0           0          0          0          0
INSTANCE SPACE RESERVATION            28          1055            1           0          0          0          0
LOG HISTORY                           56           292            1           1          1          1          0
MTTR                                 100             8            1           0          0          0          0
MULTI INSTANCE REDO APPLY            556             1            0           0          0          0          0
OFFLINE RANGE                        200          1063           12           1         12         12          0
PDB RECORD                           780            10            4           0          0          6          0
PDBINC RECORD                        144           113            0           0          0          0          0
PROXY COPY                           928          1004            0           0          0          0          0
RECOVERY DESTINATION                 180             1            1           0          0          0          0
REDO LOG                              72            16            3           0          0          0          0
REDO THREAD                          256             8            1           0          0          0          0
REMOVABLE RECOVERY FILES              32          1000            0           0          0          0          0
RESTORE POINT                        256          2108            0           0          0          0          0
RMAN CONFIGURATION                  1108            50            3           0          0          3          0
RMAN STATUS                          116           141            0           0          0          0          0
STANDBY DATABASE MATRIX              400           128          128           0          0          0          0
TABLESPACE                           180          1024           22           0          0          7          0
TABLESPACE KEY HISTORY               108           151            0           0          0          0          0
TEMPORARY FILENAME                    56          1024            5           0          0          8          0
THREAD INSTANCE NAME MAPPING          80             8            8           0          0          0          0

42 rows selected.

SQL>


Recreating the Controlfile resulted in loss of information on all ArchivedLogs and RMAN Backups !
Compare the RECORDS_USED and INDEXes for "ARCHIVED LOG" and "BACKUP %" entries against the listing obtained before recreated the Controlfile.  (A few ArchivedLogs were generated by the "ALTER SYSTEM ARCHIVE LOG ALL" command in the script itself).

Can I add that information back ?


RMAN> catalog start with '/opt/oracle/FRA/ORCLCDB';

using target database control file instead of recovery catalog
searching for all files that match the pattern /opt/oracle/FRA/ORCLCDB

List of Files Unknown to the Database
=====================================
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2021_09_26/o1_mf_s_1084311179_jo0xnh8o_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_16/o1_mf_s_1094143716_jy7pz5dd_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_16/o1_mf_s_1094143804_jy7q1xp1_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_16/o1_mf_s_1094145522_jy7rqmov_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094469527_jyko4r0n_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094469675_jyko9dj3_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094469696_jykob1pp_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094477941_jykxcrnx_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094481585_jyl0xoq0_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko09yl_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko0b3k_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T111944_jyko6m5w_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T111944_jyko7djl_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T111944_jyko98yc_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_ncnnf_TAG20220120T112134_jyko9zkl_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T133854_jykxch2m_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T133854_jykxchwb_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_16/o1_mf_nnndf_TAG20220116T164908_jy7q04z2_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_16/o1_mf_nnndf_TAG20220116T164908_jy7q08kj_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko1qll_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko20ty_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/88129263B99F4BBDE0530100007F7BDF/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko3xgo_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/88129263B99F4BBDE0530100007F7BDF/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko3y0y_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko33fq_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko33wn_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_60_jyl0zmoz_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_61_jyl10qd1_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_62_jyl11rbq_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_63_jyl12p73_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_64_jyl13l2w_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_65_jyl14s7l_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_66_jyl1qrjm_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_67_jyl81z9z_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_68_jyl861ll_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_69_jyl8l6mo_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_70_jyl8p3d5_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_71_jyl8szdf_.arc

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2021_09_26/o1_mf_s_1084311179_jo0xnh8o_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_16/o1_mf_s_1094143716_jy7pz5dd_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_16/o1_mf_s_1094143804_jy7q1xp1_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_16/o1_mf_s_1094145522_jy7rqmov_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094469527_jyko4r0n_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094469675_jyko9dj3_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094469696_jykob1pp_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094477941_jykxcrnx_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/autobackup/2022_01_20/o1_mf_s_1094481585_jyl0xoq0_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko09yl_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko0b3k_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T111944_jyko6m5w_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T111944_jyko7djl_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T111944_jyko98yc_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_ncnnf_TAG20220120T112134_jyko9zkl_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T133854_jykxch2m_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/backupset/2022_01_20/o1_mf_annnn_TAG20220120T133854_jykxchwb_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_16/o1_mf_nnndf_TAG20220116T164908_jy7q04z2_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_16/o1_mf_nnndf_TAG20220116T164908_jy7q08kj_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko1qll_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/8812E29864F47615E0530100007FA424/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko20ty_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/88129263B99F4BBDE0530100007F7BDF/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko3xgo_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/88129263B99F4BBDE0530100007F7BDF/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko3y0y_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko33fq_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/C07D1F2BA98C23D0E0530100007F7D34/backupset/2022_01_20/o1_mf_nnndf_TAG20220120T111624_jyko33wn_.bkp
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_60_jyl0zmoz_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_61_jyl10qd1_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_62_jyl11rbq_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_63_jyl12p73_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_64_jyl13l2w_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_65_jyl14s7l_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_66_jyl1qrjm_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_67_jyl81z9z_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_68_jyl861ll_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_69_jyl8l6mo_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_70_jyl8p3d5_.arc
File Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_71_jyl8szdf_.arc

RMAN>
RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1       B  F  A DISK        26-SEP-21       1       1       NO         TAG20210926T213259
2       B  F  A DISK        16-JAN-22       1       1       NO         TAG20220116T164836
3       B  F  A DISK        16-JAN-22       1       1       NO         TAG20220116T165004
4       B  F  A DISK        16-JAN-22       1       1       NO         TAG20220116T171842
5       B  F  A DISK        20-JAN-22       1       1       NO         TAG20220120T111847
6       B  F  A DISK        20-JAN-22       1       1       NO         TAG20220120T112115
7       B  F  A DISK        20-JAN-22       1       1       NO         TAG20220120T112136
8       B  F  A DISK        20-JAN-22       1       1       NO         TAG20220120T133901
9       B  F  A DISK        20-JAN-22       1       1       NO         TAG20220120T143945
10      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
11      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
12      B  A  A DISK        20-JAN-22       1       1       YES        TAG20220120T111944
13      B  A  A DISK        20-JAN-22       1       1       YES        TAG20220120T111944
14      B  A  A DISK        20-JAN-22       1       1       YES        TAG20220120T111944
15      B  F  A DISK        20-JAN-22       1       1       NO         TAG20220120T112134
16      B  A  A DISK        20-JAN-22       1       1       YES        TAG20220120T133854
17      B  A  A DISK        20-JAN-22       1       1       YES        TAG20220120T133854
18      B  F  A DISK        16-JAN-22       1       1       NO         TAG20220116T164908
19      B  F  A DISK        16-JAN-22       1       1       NO         TAG20220116T164908
20      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
21      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
22      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
23      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
24      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624
25      B  F  A DISK        20-JAN-22       1       1       YES        TAG20220120T111624

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name ORCLCDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
4       1    60      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_60_jyl0zmoz_.arc

5       1    61      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_61_jyl10qd1_.arc

6       1    62      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_62_jyl11rbq_.arc

7       1    63      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_63_jyl12p73_.arc

8       1    64      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_64_jyl13l2w_.arc

9       1    65      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_65_jyl14s7l_.arc

10      1    66      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_66_jyl1qrjm_.arc

11      1    67      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_67_jyl81z9z_.arc

12      1    68      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_68_jyl861ll_.arc

13      1    69      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_69_jyl8l6mo_.arc

14      1    70      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_70_jyl8p3d5_.arc

1       1    70      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_70_jylbnvgo_.arc

15      1    71      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_71_jyl8szdf_.arc

2       1    71      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_71_jylbo521_.arc

3       1    72      A 20-JAN-22
        Name: /opt/oracle/FRA/ORCLCDB/ORCLCDB/archivelog/2022_01_20/o1_mf_1_72_jylbofq3_.arc


RMAN>


Yes ! RMAN can "add the information" back into the Controlfile  using the CATALOG command  (also see this earlier post on the CATALOG command)-- as long as you know where the Backups and ArchiveLogs ARE ! (Another good reason to use a single FRA location !)


SQL> select *
  2  from v$controlfile_record_section
  3  order by type
  4  /

TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID     CON_ID
---------------------------- ----------- ------------- ------------ ----------- ---------- ---------- ----------
ACM OPERATION                        104            64           11           0          0          0          0
ARCHIVED LOG                         584           308           15           1         15         15          0
AUXILIARY DATAFILE COPY              584           128            0           0          0          0          0
BACKUP CORRUPTION                     44          1115            0           0          0          0          0
BACKUP DATAFILE                      200          1063           37           1         37         37          0
BACKUP PIECE                         780          1006           26           1         26         26          0
BACKUP REDOLOG                        76           215          112           1        112        112          0
BACKUP SET                            96          1022           26           1         26         26          0
BACKUP SPFILE                        124           131           10           1         10         10          0
CKPT PROGRESS                       8180            11            0           0          0          0          0
COPY CORRUPTION                       40          1227            0           0          0          0          0
DATABASE                             316             1            1           0          0          0          0
DATABASE BLOCK CORRUPTION             80          8384            0           0          0          0          0
DATABASE INCARNATION                  56           292            2           1          2          2          0
DATAFILE                             520          1024           34           0          0         39          0
DATAFILE COPY                        736          1000            0           0          0          0          0
DATAFILE HISTORY                     568            57            0           0          0          0          0
DELETED OBJECT                        20           818            0           0          0          0          0
FILENAME                             524          4146           28           0          0          0          0
FLASHBACK LOG                         84          2048            0           0          0          0          0
FOREIGN ARCHIVED LOG                 604          1002            0           0          0          0          0
GUARANTEED RESTORE POINT             256          2048            0           0          0          0          0
INSTANCE SPACE RESERVATION            28          1055            1           0          0          0          0
LOG HISTORY                           56           292            1           1          1          1          0
MTTR                                 100             8            1           0          0          0          0
MULTI INSTANCE REDO APPLY            556             1            0           0          0          0          0
OFFLINE RANGE                        200          1063           12           1         12         12          0
PDB RECORD                           780            10            4           0          0          6          0
PDBINC RECORD                        144           113            0           0          0          0          0
PROXY COPY                           928          1004            0           0          0          0          0
RECOVERY DESTINATION                 180             1            1           0          0          0          0
REDO LOG                              72            16            3           0          0          0          0
REDO THREAD                          256             8            1           0          0          0          0
REMOVABLE RECOVERY FILES              32          1000            8           0          0          0          0
RESTORE POINT                        256          2108            0           0          0          0          0
RMAN CONFIGURATION                  1108            50            3           0          0          3          0
RMAN STATUS                          116           141            3           1          3          3          0
STANDBY DATABASE MATRIX              400           128          128           0          0          0          0
TABLESPACE                           180          1024           22           0          0          7          0
TABLESPACE KEY HISTORY               108           151            0           0          0          0          0
TEMPORARY FILENAME                    56          1024            5           0          0          8          0
THREAD INSTANCE NAME MAPPING          80             8            8           0          0          0          0

42 rows selected.

SQL>
SQL> select dest_id, standby_dest, deleted, status, count(*)
  2  from v$archived_log
  3  group by dest_id, standby_dest, deleted, status
  4  order by 1,2,3,4
  5  /

   DEST_ID STA DEL S   COUNT(*)
---------- --- --- - ----------
         1 NO  NO  A         15

SQL>


The RECORDS_USED for ARCHIVED LOG" and "BACKUP DATAFILE" and "BACKUP PIECE" are now properly reset.
I would NOT advice that you periodically recreate your Controlfile.  

But this is an available method to "reset" the controlfile. I could also take this opportunity to increase controlled-values like MAXLOGFILES, MAXMEMBERS and MAXDATAFILES (or even MAXINSTANCES !).


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

SQL> @Recreate_Controlfile.SQL
SQL> spool Recreate_Controlfile
SQL>
SQL> STARTUP NOMOUNT
ORACLE instance started.

Total System Global Area 1207955544 bytes
Fixed Size                  9134168 bytes
Variable Size             671088640 bytes
Database Buffers          520093696 bytes
Redo Buffers                7639040 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCLCDB" NORESETLOGS FORCE LOGGING ARCHIVELOG
  2      MAXLOGFILES 24
  3      MAXLOGMEMBERS 4
  4      MAXDATAFILES 2048
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 512
  7  LOGFILE
  8    GROUP 1 '/opt/oracle/oradata/ORCLCDB/redo01.log'  SIZE 200M BLOCKSIZE 512,
  9    GROUP 2 '/opt/oracle/oradata/ORCLCDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
 10    GROUP 3 '/opt/oracle/oradata/ORCLCDB/redo03.log'  SIZE 200M BLOCKSIZE 512
....
....
....


RMAN> catalog start with '/opt/oracle/FRA/ORCLCDB';
....
....
....



SQL> select *
  2  from v$controlfile_record_section
  3  order by type
  4  /

TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID     CON_ID
---------------------------- ----------- ------------- ------------ ----------- ---------- ---------- ----------
ACM OPERATION                        104            64           11           0          0          0          0
ARCHIVED LOG                         584           532           18           1         18         18          0
AUXILIARY DATAFILE COPY              584           128            0           0          0          0          0
BACKUP CORRUPTION                     44          1115            0           0          0          0          0
BACKUP DATAFILE                      200          1063           37           1         37         37          0
BACKUP PIECE                         780          1006           26           1         26         26          0
BACKUP REDOLOG                        76           215          112           1        112        112          0
BACKUP SET                            96          1022           26           1         26         26          0
BACKUP SPFILE                        124           131           10           1         10         10          0
CKPT PROGRESS                       8180            11            0           0          0          0          0
COPY CORRUPTION                       40          1227            0           0          0          0          0
DATABASE                             316             1            1           0          0          0          0
DATABASE BLOCK CORRUPTION             80          8384            0           0          0          0          0
DATABASE INCARNATION                  56           292            2           1          2          2          0
DATAFILE                             520          2048           34           0          0         39          0
DATAFILE COPY                        736          1000            0           0          0          0          0
DATAFILE HISTORY                     568            57            0           0          0          0          0
DELETED OBJECT                        20           818            0           0          0          0          0
FILENAME                             524          6242           27           0          0          0          0
FLASHBACK LOG                         84          2048            0           0          0          0          0
FOREIGN ARCHIVED LOG                 604          1002            0           0          0          0          0
GUARANTEED RESTORE POINT             256          2048            0           0          0          0          0
INSTANCE SPACE RESERVATION            28          1055            1           0          0          0          0
LOG HISTORY                           56           584            1           1          1          1          0
MTTR                                 100             8            1           0          0          0          0
MULTI INSTANCE REDO APPLY            556             1            0           0          0          0          0
OFFLINE RANGE                        200          1063           12           1         12         12          0
PDB RECORD                           780            10            4           0          0          6          0
PDBINC RECORD                        144           113            0           0          0          0          0
PROXY COPY                           928          1004            0           0          0          0          0
RECOVERY DESTINATION                 180             1            1           0          0          0          0
REDO LOG                              72            24            3           0          0          0          0
REDO THREAD                          256             8            1           0          0          0          0
REMOVABLE RECOVERY FILES              32          1000            9           0          0          0          0
RESTORE POINT                        256          2108            0           0          0          0          0
RMAN CONFIGURATION                  1108            50            3           0          0          3          0
RMAN STATUS                          116           141            1           1          1          1          0
STANDBY DATABASE MATRIX              400           128          128           0          0          0          0
TABLESPACE                           180          2048           22           0          0          7          0
TABLESPACE KEY HISTORY               108           151            0           0          0          0          0
TEMPORARY FILENAME                    56          2048            5           0          0          8          0
THREAD INSTANCE NAME MAPPING          80             8            8           0          0          0          0

42 rows selected.

SQL>


Note how I have increased the "DATAFILE" RECORDS_TOTAL for "DATAFILE" from 1024 to 2048 and for "REDO LOG" from 16 to 24 and "LOGHISTORY" from 292 to 584.


18 January, 2022

The contents of the Database Controlfile -- 2 : Physical Structure

 In my previous post, I had demonstrated how you can view the "count of records" in different sections of the controlfile.  However, you cannot actually view the data in those records.

You can, however, do a Physical Dump of the controlfile :



QL> select name, block_size*file_size_blks/1024
  2  from v$controlfile;

NAME
------------------------------------------------------------------------------------------------------------------------------------
BLOCK_SIZE*FILE_SIZE_BLKS/1024
------------------------------
/opt/oracle/oradata/ORCLCDB/control01.ctl
                         18688

/opt/oracle/oradata/ORCLCDB/control02.ctl
                         18688


SQL> !ls -l /opt/oracle/oradata/ORCLCDB/control01.ctl
-rw-r-----. 1 oracle oinstall 19152896 Jan 18 22:15 /opt/oracle/oradata/ORCLCDB/control01.ctl

SQL> !bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
19152896/1024
18704
quit

SQL>
SQL> alter session set tracefile_identifier='my_cntrlfile_dump';

Session altered.

SQL>
SQL> select *
  2  from v$diag_info
  3  where name = 'Default Trace File'
  4  /

   INST_ID NAME
---------- ----------------------------------------------------------------
VALUE
------------------------------------------------------------------------------------------------------------------------------------
    CON_ID
----------
         1 Default Trace File
/opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_3207_my_cntrlfile_dump.trc
         0


SQL>
SQL> alter session set events 'immediate trace name controlf level 10';

Session altered.

SQL> !ls -l /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_3207_my_cntrlfile_dump.trc
-rw-r-----. 1 oracle oinstall 1449760 Jan 18 22:17 /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_3207_my_cntrlfile_dump.trc

SQL>
SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
oracle19c>view /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_3207_my_cntrlfile_dump.trc


The "alter session set events 'immediate trace name controlf level 10'" command does a Physical Dump of the trace file.

I can't reproduce the whole file here, but am presenting the interesting bits.


DUMP OF CONTROL FILES, Seq # 1036136918 = 0x3dc231d6
 V10 STYLE FILE HEADER:
        Compatibility Vsn = 318767104=0x13000000
        Db ID=2778483057=0xa59c4971, Db Name='ORCLCDB'
        Activation ID=0=0x0
        Control Seq=1036136918=0x3dc231d6, File size=1168=0x490
        File Number=0, Blksiz=16384, File Type=1 CONTROL
 Logical block number 1 (header block)
Dump of memory from 0x00007F02655C9000 to 0x00007F02655CD000
7F02655C9000 0000C215 00000001 00000000 04010000  [................]
7F02655C9010 0000791A 00000000 13000000 A59C4971  [.y..........qI..]
7F02655C9020 4C43524F 00424443 3DC231D6 00000490  [ORCLCDB..1.=....]
7F02655C9030 00004000 00010000 00000000 00000000  [.@..............]
7F02655C9040 32474154 30313230 54363239 33333132  [TAG20210926T2133]
7F02655C9050 00003230 00000000 00000000 00000000  [02..............]
7F02655C9060 AACA5B83 3C0C08F2 01025B25 00008000  [.[.....<%[......]
7F02655C9070 413A3EE4 00000000 00000000 00000000  [.>:A............]
7F02655C9080 00000000 00000000 00000000 00000000  [................]
        Repeat 7 times
7F02655C9100 00000000 00000000 00000008 00000008  [................]
7F02655C9110 00000008 00000000 00000000 00000000  [................]
7F02655C9120 00000001 00000000 00000000 00000000  [................]
7F02655C9130 00000000 00000000 00000000 00000000  [................]
        Repeat 1003 times
7F02655CCFF0 00000000 00000000 00000000 00001501  [................]
... notihing interesting
... except that, funnily, some RMAN Backup TAG is visible !


 Logical block number 44
Dump of memory from 0x00007F02655AD000 to 0x00007F02655B1000
7F02655AD000 0000C215 00000059 3DC230EF 0401FFFF  [....Y....0.=....]
7F02655AD010 0000461E 00030003 00000000 6F2F0000  [.F............/o]
7F02655AD020 6F2F7470 6C636172 726F2F65 74616461  [pt/oracle/oradat]
7F02655AD030 524F2F61 44434C43 65722F42 33306F64  [a/ORCLCDB/redo03]
7F02655AD040 676F6C2E 00000000 00000000 00000000  [.log............]
7F02655AD050 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655AD220 00020003 00000000 6F2F0000 6F2F7470  [........../opt/o]
7F02655AD230 6C636172 726F2F65 74616461 524F2F61  [racle/oradata/OR]
7F02655AD240 44434C43 65722F42 32306F64 676F6C2E  [CLCDB/redo02.log]
7F02655AD250 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655AD420 00000000 00000000 00000000 00010003  [................]
7F02655AD430 00000000 6F2F0000 6F2F7470 6C636172  [....../opt/oracl]
7F02655AD440 726F2F65 74616461 524F2F61 44434C43  [e/oradata/ORCLCD]
7F02655AD450 65722F42 31306F64 676F6C2E 00000000  [B/redo01.log....]
7F02655AD460 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655AD630 00000000 00000000 00070004 00000000  [................]
7F02655AD640 6F2F0000 6F2F7470 6C636172 726F2F65  [../opt/oracle/or]
7F02655AD650 74616461 524F2F61 44434C43 73752F42  [adata/ORCLCDB/us]
7F02655AD660 30737265 62642E31 00000066 00000000  [ers01.dbf.......]
7F02655AD670 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655AD840 00000000 00040004 00000000 6F2F0000  [............../o]
7F02655AD850 6F2F7470 6C636172 726F2F65 74616461  [pt/oracle/oradat]
7F02655AD860 524F2F61 44434C43 6E752F42 62746F64  [a/ORCLCDB/undotb]
7F02655AD870 2E313073 00666264 00000000 00000000  [s01.dbf.........]
7F02655AD880 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655ADA50 00010004 00000000 6F2F0000 6F2F7470  [........../opt/o]
7F02655ADA60 6C636172 726F2F65 74616461 524F2F61  [racle/oradata/OR]
7F02655ADA70 44434C43 79732F42 6D657473 642E3130  [CLCDB/system01.d]
7F02655ADA80 00006662 00000000 00000000 00000000  [bf..............]
7F02655ADA90 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
7F02655ADC50 00000000 00000000 00000000 00030004  [................]
7F02655ADC60 00000000 6F2F0000 6F2F7470 6C636172  [....../opt/oracl]
7F02655ADC70 726F2F65 74616461 524F2F61 44434C43  [e/oradata/ORCLCD]
7F02655ADC80 79732F42 78756173 642E3130 00006662  [B/sysaux01.dbf..]
7F02655ADC90 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655ADE60 00000000 00000000 00010007 00000000  [................]
7F02655ADE70 6F2F0000 6F2F7470 6C636172 726F2F65  [../opt/oracle/or]
7F02655ADE80 74616461 524F2F61 44434C43 65742F42  [adata/ORCLCDB/te]
7F02655ADE90 3130706D 6662642E 00000000 00000000  [mp01.dbf........]
7F02655ADEA0 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655AE070 00000000 00050004 00000000 6F2F0000  [............../o]
7F02655AE080 6F2F7470 6C636172 726F2F65 74616461  [pt/oracle/oradat]
7F02655AE090 524F2F61 44434C43 64702F42 65657362  [a/ORCLCDB/pdbsee]
7F02655AE0A0 79732F64 6D657473 642E3130 00006662  [d/system01.dbf..]
7F02655AE0B0 00000000 00000000 00000000 00000000  [................]
        Repeat 28 times
7F02655AE280 00060004 00000000 6F2F0000 6F2F7470  [........../opt/o]
7F02655AE290 6C636172 726F2F65 74616461 524F2F61  [racle/oradata/OR]
7F02655AE2A0 44434C43 64702F42 65657362 79732F64  [CLCDB/pdbseed/sy]
7F02655AE2B0 78756173 642E3130 00006662 00000000  [saux01.dbf......]
7F02655AE2C0 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
7F02655AE480 00000000 00000000 00000000 00080004  [................]
7F02655AE490 00000000 6F2F0000 6F2F7470 6C636172  [....../opt/oracl]
7F02655AE4A0 726F2F65 74616461 524F2F61 44434C43  [e/oradata/ORCLCD]
7F02655AE4B0 64702F42 65657362 6E752F64 62746F64  [B/pdbseed/undotb]
7F02655AE4C0 2E313073 00666264 00000000 00000000  [s01.dbf.........]
7F02655AE4D0 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
.... and so on ..
... So, in the above section we see the physical datafiles of the database.




7F02655B0760 6F000000 6F2F7470 6C636172 72702F65  [...opt/oracle/pr]
7F02655B0770 6375646F 39312F74 62642F63 656D6F68  [oduct/19c/dbhome]
7F02655B0780 642F315F 732F7362 6370616E 524F5F66  [_1/dbs/snapcf_OR]
7F02655B0790 44434C43 00662E42 00000000 00000000  [CLCDB.f.........]
7F02655B07A0 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
7F02655B0960 00000000 00000000 00000000 6F000000  [...............o]
7F02655B0970 6F2F7470 6C636172 72702F65 6375646F  [pt/oracle/produc]
7F02655B0980 39312F74 62642F63 656D6F68 642F315F  [t/19c/dbhome_1/d]
7F02655B0990 732F7362 6370616E 524F5F66 44434C43  [bs/snapcf_ORCLCD]
7F02655B09A0 00662E42 00000000 00000000 00000000  [B.f.............]
7F02655B09B0 00000000 00000000 00000000 00000000  [................]
... here we see the Snapshot Controlfile



 Logical block number 177
Dump of memory from 0x00007F02655C1000 to 0x00007F02655C5000
7F02655C1000 0000C215 00000163 3DC230C2 0401FFFF  [....c....0.=....]
7F02655C1010 0000993A 00000001 59530006 58554153  [:.........SYSAUX]
7F02655C1020 00000000 00000000 00000000 00000000  [................]
        Repeat 8 times
7F02655C10B0 00000000 00010003 00000000 00000000  [................]
7F02655C10C0 00000000 00000000 00000000 59530006  [..............SY]
7F02655C10D0 4D455453 00000000 00000000 00000000  [STEM............]
7F02655C10E0 00000000 00000000 00000000 00000000  [................]
        Repeat 7 times
7F02655C1160 00000000 00000000 00010001 00000000  [................]
7F02655C1170 00000000 00000000 00000000 00000002  [................]
7F02655C1180 4E550008 42544F44 00003153 00000000  [..UNDOTBS1......]
7F02655C1190 00000000 00000000 00000000 00000000  [................]
        Repeat 7 times
7F02655C1210 00000000 00000000 00000000 00010004  [................]
7F02655C1220 00000000 00000000 00000000 00000000  [................]
7F02655C1230 00000004 53550005 00535245 00000000  [......USERS.....]
7F02655C1240 00000000 00000000 00000000 00000000  [................]
        Repeat 8 times
7F02655C12D0 00010007 00000000 00000000 00000000  [................]
7F02655C12E0 00000000 00000003 45540004 0000504D  [..........TEMP..]
7F02655C12F0 00000000 00000000 00000000 00000000  [................]
        Repeat 6 times
7F02655C1360 00000000 00000000 00010000 00000000  [................]
7F02655C1370 00000000 00000000 00000000 00000000  [................]
7F02655C1380 00000000 00010001 00000000 00000000  [................]
7F02655C1390 00000000 00000000 00000000 59530006  [..............SY]
7F02655C13A0 4D455453 00000000 00000000 00000000  [STEM............]
7F02655C13B0 00000000 00000000 00000000 00000000  [................]
        Repeat 7 times
7F02655C1430 00000000 00000000 00020005 00000000  [................]
7F02655C1440 00000000 00000000 00000000 00000001  [................]
7F02655C1450 59530006 58554153 00000000 00000000  [..SYSAUX........]
7F02655C1460 00000000 00000000 00000000 00000000  [................]
.... and so on ...
... this section has Tablespace Names.




 Logical block number 193
Dump of memory from 0x00007F02655C1000 to 0x00007F02655C5000
7F02655C1000 0000C215 00000183 3DC1CC8F 0401FFFF  [...........=....]
7F02655C1010 00000887 48435241 4C455649 4420474F  [....ARCHIVELOG D]
7F02655C1020 54454C45 204E4F49 494C4F50 00005943  [ELETION POLICY..]
7F02655C1030 00000000 00000000 00000000 00000000  [................]
        Repeat 1 times
7F02655C1050 00000000 204F5400 4C505041 20444549  [.....TO APPLIED ]
7F02655C1060 41204E4F 53204C4C 444E4154 42205942  [ON ALL STANDBY B]
7F02655C1070 454B4341 50552044 54203120 53454D49  [ACKED UP 1 TIMES]
7F02655C1080 204F5420 4B534944 00000000 00000000  [ TO DISK........]
7F02655C1090 00000000 00000000 00000000 00000000  [................]
        Repeat 60 times
7F02655C1460 00000000 00000000 49564544 54204543  [........DEVICE T]
7F02655C1470 00455059 00000000 00000000 00000000  [YPE.............]
7F02655C1480 00000000 00000000 00000000 00000000  [................]
        Repeat 1 times
7F02655C14A0 00000000 00000000 53494400 4150204B  [.........DISK PA]
7F02655C14B0 4C4C4152 53494C45 2032204D 4B434142  [RALLELISM 2 BACK]
7F02655C14C0 54205055 20455059 42204F54 554B4341  [UP TYPE TO BACKU]
7F02655C14D0 54455350 00000000 00000000 00000000  [PSET............]
7F02655C14E0 00000000 00000000 00000000 00000000  [................]
        Repeat 944 times
... this secion has RMAN CONFGURATION information



 Logical block number 211
Dump of memory from 0x00007F0265589000 to 0x00007F026558D000
7F0265589000 0000C215 000001A8 3DC21EA3 0401FFFF  [...........=....]
7F0265589010 000008C1 40845AAE 00010012 000001EE  [.....Z.@........]
7F0265589020 00493300 00000000 3DC1C40E 00E6DAE8  [.3I........=....]
7F0265589030 00008000 40845629 00E6E7E1 00008000  [....)V.@........]
7F0265589040 40845A9A 0002631D 00000200 00000001  [.Z.@.c..........]
7F0265589050 A7521CCD 00010000 74706F2F 61726F2F  [..R...../opt/ora]
7F0265589060 2F656C63 68637261 6C657669 4F2F676F  [cle/archivelog/O]
7F0265589070 434C4352 312F4244 3439345F 3330315F  [RCLCDB/1_494_103]
7F0265589080 38303136 2E343138 00666264 00000000  [6108814.dbf.....]
7F0265589090 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
7F0265589250 00000000 00000000 00000000 40A141E4  [.............A.@]
7F0265589260 00010012 000001EF 00493300 00000000  [.........3I.....]
7F0265589270 3DC1C40E 00E6E7E1 00008000 40845A9A  [...=.........Z.@]
7F0265589280 00E6E7E4 00008000 40A141E3 00000001  [.........A.@....]
7F0265589290 00000200 00000001 A7521CCD 00010000  [..........R.....]
7F02655892A0 74706F2F 61726F2F 2F656C63 68637261  [/opt/oracle/arch]
7F02655892B0 6C657669 4F2F676F 434C4352 312F4244  [ivelog/ORCLCDB/1]
7F02655892C0 3539345F 3330315F 38303136 2E343138  [_495_1036108814.]
7F02655892D0 00666264 00000000 00000000 00000000  [dbf.............]
7F02655892E0 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
7F02655894A0 00000000 40A143D5 00010012 000001F0  [.....C.@........]
7F02655894B0 00493300 00000000 3DC1C40E 00E6E7E4  [.3I........=....]
7F02655894C0 00008000 40A141E3 00E86F7B 00008000  [.....A.@{o......]
7F02655894D0 40A143D5 000000A9 00000200 00000001  [.C.@............]
7F02655894E0 A7521CCD 00010000 74706F2F 61726F2F  [..R...../opt/ora]
7F02655894F0 2F656C63 68637261 6C657669 4F2F676F  [cle/archivelog/O]
7F0265589500 434C4352 312F4244 3639345F 3330315F  [RCLCDB/1_496_103]
7F0265589510 38303136 2E343138 00666264 00000000  [6108814.dbf.....]
7F0265589520 00000000 00000000 00000000 00000000  [................]
        Repeat 27 times
.... and so on ...
... this section has *some* ArchiveLog FileNames
... other ArchiveLog FileNames appear further down the file



        Repeat 30 times
7F0265589DC0 00000000 40A143DD 0001061A 000001EA  [.....C.@........]
7F0265589DD0 00493300 00000000 3DC1C40E 00E683F5  [.3I........=....]
7F0265589DE0 00008000 40844BA3 00E6841B 00008000  [.....K.@........]
7F0265589DF0 40844BA9 00000017 00000200 003C0001  [.K.@..........<.]
7F0265589E00 A7521CCD 00030000 42445453 00000032  [..R.....STDB2...]
7F0265589E10 00000000 00000000 00000000 00000000  [................]
.... here I see a reference to one of my Standby Databases STDB2




 Logical block number 218
Dump of memory from 0x00007F02655A5000 to 0x00007F02655A9000
7F02655A5000 0000C215 000001B5 3DC1D6CE 0401FFFF  [...........=....]
7F02655A5010 0000B131 3D94E011 3D94E010 00000001  [1......=...=....]
7F02655A5020 00018003 3D94E011 00000000 00008FA0  [.......=........]
7F02655A5030 4B534944 00000000 00000000 00000000  [DISK............]
7F02655A5040 706F0000 726F2F74 656C6361 6F72702F  [..opt/oracle/pro]
7F02655A5050 74637564 6339312F 6862642F 5F656D6F  [duct/19c/dbhome_]
7F02655A5060 62642F31 2D632F73 38373732 30333834  [1/dbs/c-27784830]
7F02655A5070 322D3735 30303230 2D333232 00003030  [57-20200223-00..]
7F02655A5080 00000000 00000000 00000000 00000000  [................]
        Repeat 36 times
7F02655A52D0 00000000 32474154 30303230 54333232  [....TAG20200223T]
7F02655A52E0 37343232 00003434 00000000 00000000  [224744..........]
7F02655A52F0 00000000 00000000 B637B686 657ADF2F  [..........7./.ze]
7F02655A5300 06F753E0 CA270AE8 3D94E011 00000000  [.S....'....=....]
7F02655A5310 00000000 00000000 00000000 00000000  [................]
7F02655A5320 3DC1C42D 3DC1C42C 00000024 0001C003  [-..=,..=$.......]
7F02655A5330 3DC1C42D 00000000 00008FA0 4B534944  [-..=........DISK]
7F02655A5340 00000000 00000000 00000000 706F0000  [..............op]
7F02655A5350 726F2F74 656C6361 4152462F 43524F2F  [t/oracle/FRA/ORC]
7F02655A5360 4244434C 43524F2F 4244434C 7475612F  [LCDB/ORCLCDB/aut]
7F02655A5370 6361626F 2F70756B 30323032 5F33305F  [obackup/2020_03_]
7F02655A5380 6F2F3732 666D5F31 315F735F 31363330  [27/o1_mf_s_10361]
7F02655A5390 34383830 37685F34 66666E73 2E5F7862  [08844_h7snffbx_.]
7F02655A53A0 00706B62 00000000 00000000 00000000  [bkp.............]
7F02655A53B0 00000000 00000000 00000000 00000000  [................]
        Repeat 34 times
  7F02655A55E0 32474154 30303230 54373233 30303030  [TAG20200327T0000]
7F02655A55F0 00003434 00000000 00000000 00000000  [44..............]
7F02655A5600 00000000 B637B686 657ADF2F 06F753E0  [......7./.ze.S..]
7F02655A5610 CA270AE8 3DC1C42D 00000000 00000000  [..'.-..=........]
7F02655A5620 00000000 00000000 00000000 3E0E1E81  [...............>]
7F02655A5630 3E0E1E80 00000027 0001C003 3E0E1E97  [...>'..........>]
7F02655A5640 00000040 00093AA0 4B534944 00000000  [@....:..DISK....]
7F02655A5650 00000000 00000000 706F0000 726F2F74  [..........opt/or]
7F02655A5660 656C6361 4152462F 43524F2F 4244434C  [acle/FRA/ORCLCDB]
7F02655A5670 43524F2F 4244434C 6361622F 7370756B  [/ORCLCDB/backups]
7F02655A5680 322F7465 5F303230 325F3530 316F2F32  [et/2020_05_22/o1]
7F02655A5690 5F666D5F 646E6E6E 41545F66 32303247  [_mf_nnndf_TAG202]
7F02655A56A0 32353030 31325432 34323835 6864685F  [00522T215824_hdh]
7F02655A56B0 31316E70 622E5F6C 0000706B 00000000  [pn11l_.bkp......]
7F02655A56C0 00000000 00000000 00000000 00000000  [................]
        Repeat 31 times
7F02655A58C0 00000000 00000000 00000000 3E0E1E80  [...............>]
7F02655A58D0 00000000 0000002C 00000000 00000000  [....,...........]
7F02655A58E0 00000000 00000000 00000000 32474154  [............TAG2]
7F02655A58F0 30303230 54323235 38353132 00003432  [0200522T215824..]
7F02655A5900 00000000 00000000 00000000 00000000  [................]
7F02655A5910 B637B686 657ADF2F 06F753E0 CA270AE8  [..7./.ze.S....'.]
7F02655A5920 3E0E1E81 00000000 00000000 00000000  [...>............]
7F02655A5930 00000000 00000000 3E0E1E9A 3E0E1E9A  [...........>...>]
7F02655A5940 00000028 0001C003 3E0E1EAC 00000040  [(..........>@...]
7F02655A5950 000409F0 4B534944 00000000 00000000  [....DISK........]
7F02655A5960 00000000 706F0000 726F2F74 656C6361  [......opt/oracle]
7F02655A5970 4152462F 43524F2F 4244434C 43524F2F  [/FRA/ORCLCDB/ORC]
7F02655A5980 4244434C 3138382F 39324532 46343638  [LCDB/8812E29864F]
7F02655A5990 31363734 35304535 30313033 37303030  [47615E0530100007]
7F02655A59A0 32344146 61622F34 70756B63 2F746573  [FA424/backupset/]
7F02655A59B0 30323032 5F35305F 6F2F3232 666D5F31  [2020_05_22/o1_mf]
7F02655A59C0 6E6E6E5F 545F6664 30324741 35303032  [_nnndf_TAG202005]
7F02655A59D0 32543232 32383531 64685F34 746E7068  [22T215824_hdhpnt]
7F02655A59E0 2E5F7939 00706B62 00000000 00000000  [9y_.bkp.........]
.... and so on ...
... here I see some of the BackupPiece FileNames
... strangely enough BackupPieces from May 2020 are still in the controlfile !!
... more appear later down the file


7F02655BF7B0 00000000 00000000 00000000 41374F03  [.............O7A]
7F02655BF7C0 00000000 00000155 00000000 00000000  [....U...........]
7F02655BF7D0 00000000 00000000 00000000 32474154  [............TAG2]
7F02655BF7E0 30323230 54363131 39343631 00003830  [0220116T164908..]
7F02655BF7F0 00000000 00000000 00000000 00000000  [................]
7F02655BF800 98E21288 1576F464 000153E0 24A47F00  [....d.v..S.....$]
7F02655BF810 41374F08 00000000 00000000 00000000  [.O7A............]
7F02655BF820 00000000 00000000 41374F3D 41374F3C  [........=O7AO7A....]
7F02655BF840 000092E0 4B534944 00000000 00000000  [....DISK........]
7F02655BF850 00000000 706F2F00 726F2F74 656C6361  [...../opt/oracle]
7F02655BF860 4152462F 43524F2F 4244434C 43524F2F  [/FRA/ORCLCDB/ORC]
7F02655BF870 4244434C 7475612F 6361626F 2F70756B  [LCDB/autobackup/]
7F02655BF880 32323032 5F31305F 6F2F3631 666D5F31  [2022_01_16/o1_mf]
7F02655BF890 315F735F 31343930 30383334 796A5F34  [_s_1094143804_jy]
7F02655BF8A0 78317137 2E5F3170 00706B62 00000000  [7q1xp1_.bkp.....]
7F02655BF8B0 00000000 00000000 00000000 00000000  [................]
        Repeat 32 times
7F02655BFAC0 00000000 00000000 41374F3C 00000000  [........


So, it seems that not every entry in the Controlfile is ordered.
And also, that there are many entries referencing ArchiveLogs or BackupPieces that no longer exist but haven't been cleaned up yet !