oracle19c 容器数据库控制文件(重建控制文件)

目录

1.将控制文件备份出来

2.然后重建控制文件

3.再做一个全库备份


 RMAN备份分为知识库(放在控制文件的,默認保留時間為7天)和备份集,知识库存放在控制文件,所以一般数据库控制文件的自动备份都是打开的。如果没有配置闪回区,默认是备份在$ORACLE_HOME/dbs ,如果配置了闪回区就自动备份在闪回区。

RMAN>LIST BACKUP;--------查看知识库的备份信息

RMAN>RESTORE CONTROFILE FROM AUTOBACKUP;-----恢复控制文件

如果没有控制文件的自动备份,而且丢失了所有对控制文件的备份,那么我们可以通过重建控制文件来恢复数据库。

1.将控制文件备份出来

SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;-----将控制文件备份出来变成一个跟踪文件

Database altered.

[oracle@19c CDB]$ cd /u01/app/oracle/diag/rdbms/cdb/CDB/trace//在告警日志目录下

[oracle@19c trace]$ ls -lt| head -n 15             //这里面有很多文件需要一个个去找,哪一个是刚刚备份出来的控制文件,所以我们备份控制文件之后应该第一时间把这个文件保存下来,以免后面需要的时候找不到
total 24788
-rw-r----- 1 oracle oinstall 626371 Jan  2 19:26 alert_CDB.log
-rw-r----- 1 oracle oinstall  18849 Jan  2 19:26 CDB_ora_18162.trc
-rw-r----- 1 oracle oinstall   1087 Jan  2 19:26 CDB_ora_18162.trm
-rw-r----- 1 oracle oinstall   3345 Jan  2 19:26 CDB_m005_34241.trc
-rw-r----- 1 oracle oinstall   1012 Jan  2 19:26 CDB_m005_34241.trm
-rw-r----- 1 oracle oinstall  93855 Jan  2 19:26 CDB_m003_22842.trc
-rw-r----- 1 oracle oinstall   6180 Jan  2 19:26 CDB_m003_22842.trm
-rw-r----- 1 oracle oinstall  42988 Jan  2 19:26 CDB_m004_28432.trc
-rw-r----- 1 oracle oinstall   3467 Jan  2 19:26 CDB_m004_28432.trm
-rw-r----- 1 oracle oinstall 138990 Jan  2 19:26 CDB_mmon_18144.trc
-rw-r----- 1 oracle oinstall   7775 Jan  2 19:26 CDB_mmon_18144.trm
-rw-r----- 1 oracle oinstall 102349 Jan  2 19:26 CDB_m001_23385.trc
-rw-r----- 1 oracle oinstall   6341 Jan  2 19:26 CDB_m001_23385.trm
-rw-r----- 1 oracle oinstall  12288 Jan  2 19:23 CDB_dbrm_18112.trc
[oracle@19c trace]$ cat CDB_ora_18162.trc
Trace file /u01/app/oracle/diag/rdbms/cdb/CDB/trace/CDB_ora_18162.trc
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Build label:    RDBMS_19.3.0.0.0DBRU_LINUX.X64_190417
ORACLE_HOME:    /u01/app/oracle/product/19.2.0/db_home1
System name:    Linux
Node name:    19c
Release:    3.10.0-1062.el7.x86_64
Version:    #1 SMP Wed Aug 7 18:08:02 UTC 2019
Machine:    x86_64
Instance name: CDB
Redo thread mounted by this instance: 1
Oracle process number: 33
Unix process pid: 18162, image: oracle@19c (TNS V1-V3)

*** 2024-01-02T19:26:42.486636+08:00 (CDB$ROOT(1))
-- 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="CDB"
--
-- 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='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER'
-- 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 "CDB" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/CDB/redo01.log',
    '/u01/app/oracle/fast_recovery_area/redo04.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 2 '/u01/app/oracle/oradata/CDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 3 '/u01/app/oracle/oradata/CDB/redo03.log'  SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/CDB/system01.dbf',
  '/u01/app/oracle/oradata/CDB/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/system01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/users01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/system01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/users01.dbf'
CHARACTER SET AL32UTF8
;//这一部分是重建控制文件需要的语句

-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET');
-- Configure RMAN configuration record 2
-- Replace * with correct password.
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE DISK FORMAT   ''/u01/app/oracle/rman_backup/%U.bk''');
-- 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 '/u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/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 '/u01/app/oracle/oradata/CDB/temp01.dbf'
     SIZE 136314880  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "PDB$SEED";
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/CDB/pdbseed/temp012023-11-27_12-28-06-333-PM.dbf'
     SIZE 37748736  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "PDB1";
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/CDB/pdb1/temp01.dbf' REUSE;
ALTER SESSION SET CONTAINER = "CDB$ROOT";
-- End of tempfile additions.
--
--     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 "CDB" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/CDB/redo01.log',
    '/u01/app/oracle/fast_recovery_area/redo04.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 2 '/u01/app/oracle/oradata/CDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 3 '/u01/app/oracle/oradata/CDB/redo03.log'  SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/CDB/system01.dbf',
  '/u01/app/oracle/oradata/CDB/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/system01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/users01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/system01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/users01.dbf'
CHARACTER SET AL32UTF8
;//这一部分也是重建控制文件需要的语句,二选一。日志组使用的sequence重新归零。

-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET');
-- Configure RMAN configuration record 2
-- Replace * with correct password.
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE DISK FORMAT   ''/u01/app/oracle/rman_backup/%U.bk''');
-- 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 '/u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/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 '/u01/app/oracle/oradata/CDB/temp01.dbf'
     SIZE 136314880  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "PDB$SEED";
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/CDB/pdbseed/temp012023-11-27_12-28-06-333-PM.dbf'
     SIZE 37748736  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
ALTER SESSION SET CONTAINER = "PDB1";
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/CDB/pdb1/temp01.dbf' REUSE;
ALTER SESSION SET CONTAINER = "CDB$ROOT";
-- End of tempfile additions.
--

2.然后重建控制文件

模拟控制文丢失,然后重建:

SQL> show parameters control;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time         integer     7
control_files                 string     /u01/app/oracle/oradata/CDB/co
                         ntrol01.ctl, /u01/app/oracle/o
                         radata/CDB/control02.ctl
control_management_pack_access         string     DIAGNOSTIC+TUNING
SQL> shutdown immediate;///这里我删除了控制文件,所以报错
Database closed.
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/CDB/control01.ctl'
ORA-27041: unable to open file

Linux-x86_64 Error: 2: No such file or directory
Additional information: 3


SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area  838858864 bytes
Fixed Size            9140336 bytes
Variable Size          574619648 bytes
Database Buffers      251658240 bytes
Redo Buffers            3440640 bytes
ORA-00205: error in identifying control file, check alert log for more info

SQL> select status from v$instance;

STATUS
------------
STARTED

//使用以下语句重建控制文件

SQL> CREATE CONTROLFILE REUSE DATABASE "CDB" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/CDB/redo01.log',
    '/u01/app/oracle/fas  2    3    4    5    6    7    8    9   10  t_recovery_area/redo04.log'
  ) SIZE 200M BLOCKSIZE 512,
  GROUP 2 '/u01/app/oracle/oradata/CDB/redo02.log'  SIZE 200M BLOCKSIZE 512,
  GROUP 3 '/u01/app/oracle/oradata/CDB/redo03.log'  SIZE 200M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle 11   12   13   14   15   16  /oradata/CDB/system01.dbf',
  '/u01/app/oracle/oradata/CDB/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/system01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/sysaux01.dbf',
  '/u01/app/oracle/oradata/ 17   18   19   20   21  CDB/users01.dbf',
  '/u01/app/oracle/oradata/CDB/pdbseed/undotbs01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/system01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/sysaux01.dbf',
  '/u01/app/oracle/oradata/CDB/pdb1/undotbs01.dbf',
  '/u01/app/oracle/oradata/CD 22   23   24   25   26  B/pdb1/users01.dbf'
CHARACTER SET AL32UTF8
;
 27   28  
Control file created.
SQL> alter database open;

Database altered.

SQL> select group#,members,bytes,status,sequence# from v$log;------查看重建控制文件后日志组的状态

    GROUP#    MEMBERS       BYTES STATUS        SEQUENCE#
---------- ---------- ---------- ---------------- ----------
     1        2  209715200 CURRENT          31
     2        1  209715200 INACTIVE          29
     3        1  209715200 INACTIVE          30
 

重建控制文件后,所有的备份信息都会被删除:

RMAN> list backup;

using target database control file instead of recovery catalog
specification does not match any backup in the repository

RMAN> list copy;-----以下只是归档日志文件,并不是备份信息

specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
List of Archived Log Copies for database with db_unique_name CDB
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
1       1    26      A 02-JAN-24
        Name: /u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/o1_mf_1_26_ls7zfk6p_.arc

2       1    27      A 02-JAN-24
        Name: /u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/o1_mf_1_27_ls7zfk6s_.arc

3       1    28      A 02-JAN-24
        Name: /u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/o1_mf_1_28_ls7zfk9p_.arc

[oracle@19c oracle]$ cd rman_backup;
[oracle@19c rman_backup]$ ll -ls//以下备份文件也可以删除了,因为没用了
oracle19c 容器数据库控制文件(重建控制文件)_第1张图片

3.再做一个全库备份

RMAN> backup database plus archivelog;

RMAN> show all;-----之前配置的固定备份路径也恢复成了默认值

RMAN configuration parameters for database with db_unique_name CDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/19.2.0/db_home1/dbs/snapcf_CDB.f'; # default

SQL> show parameter recovery;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/fast_recovery_
                         area
db_recovery_file_dest_size         big integer 8256M
recovery_parallelism             integer     0
remote_recovery_file_dest         string
 

RMAN> list backup;------------默认备份到了闪回恢复区


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


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1       23.71M     DISK        00:00:00     02-JAN-24      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T204946
        Piece Name: /u01/app/oracle/fast_recovery_area/CDB/backupset/2024_01_02/o1_mf_annnn_TAG20240102T204946_ls81mblw_.bkp

  List of Archived Logs in backup set 1
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    26      3625497    02-JAN-24 3625768    02-JAN-24
  1    27      3625768    02-JAN-24 3625814    02-JAN-24
  1    28      3625814    02-JAN-24 3644347    02-JAN-24
  1    29      3644347    02-JAN-24 3646826    02-JAN-24

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    1.25G      DISK        00:00:15     02-JAN-24      
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T204947
        Piece Name: /u01/app/oracle/fast_recovery_area/CDB/backupset/2024_01_02/o1_mf_nnndf_TAG20240102T204947_ls81mcyc_.bkp
  List of Datafiles in backup set 2
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 3646843    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/system01.dbf
  3       Full 3646843    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/sysaux01.dbf
  4       Full 3646843    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/undotbs01.dbf
  7       Full 3646843    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    584.32M    DISK        00:00:02     02-JAN-24      
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T204947
        Piece Name: /u01/app/oracle/fast_recovery_area/CDB/0B1C0921A890709AE06302F4A8C0D026/backupset/2024_01_02/o1_mf_nnndf_TAG20240102T204947_ls81n52n_.bkp
  List of Datafiles in backup set 3
  Container ID: 3, PDB Name: PDB1
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  9       Full 3644546    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/pdb1/system01.dbf
  10      Full 3644546    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/pdb1/sysaux01.dbf
  11      Full 3644546    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/pdb1/undotbs01.dbf
  12      Full 3644546    02-JAN-24              NO    /u01/app/oracle/oradata/CDB/pdb1/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    554.27M    DISK        00:00:02     02-JAN-24      
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T204947
        Piece Name: /u01/app/oracle/fast_recovery_area/CDB/0B1BBA83F7076645E06302F4A8C0A4FF/backupset/2024_01_02/o1_mf_nnndf_TAG20240102T204947_ls81n871_.bkp
  List of Datafiles in backup set 4
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  5       Full 2140661    27-NOV-23              NO    /u01/app/oracle/oradata/CDB/pdbseed/system01.dbf
  6       Full 2140661    27-NOV-23              NO    /u01/app/oracle/oradata/CDB/pdbseed/sysaux01.dbf
  8       Full 2140661    27-NOV-23              NO    /u01/app/oracle/oradata/CDB/pdbseed/undotbs01.dbf

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
5       4.50K      DISK        00:00:00     02-JAN-24      
        BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T205019
        Piece Name: /u01/app/oracle/fast_recovery_area/CDB/backupset/2024_01_02/o1_mf_annnn_TAG20240102T205019_ls81ncdl_.bkp

  List of Archived Logs in backup set 5
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    30      3646826    02-JAN-24 3646862    02-JAN-24

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    18.27M     DISK        00:00:00     02-JAN-24      
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T205020
        Piece Name: /u01/app/oracle/fast_recovery_area/CDB/autobackup/2024_01_02/o1_mf_s_1157230220_ls81ndk1_.bkp
  SPFILE Included: Modification time: 02-JAN-24
  SPFILE db_unique_name: CDB
  Control File Included: Ckp SCN: 3646875      Ckp time: 02-JAN-24

RMAN> list copy;///最新的归档日志文件

specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
List of Archived Log Copies for database with db_unique_name CDB
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
5       1    30      A 02-JAN-24
        Name: /u01/app/oracle/fast_recovery_area/CDB/archivelog/2024_01_02/o1_mf_1_30_ls81nc7s_.arc
 

查看备份出来的文件:

[oracle@19c 2024_01_02]$ cd /u01/app/oracle/fast_recovery_area/CDB
oracle19c 容器数据库控制文件(重建控制文件)_第2张图片

你可能感兴趣的:(数据库,oracle,sql)