关于同平台同版本数据库之间的迁移操作的实验
---Source DB
[root@oracle-db-19cs ~]# cat /etc/redhat-release
CentOS Stream release 8
[root@oracle-db-19cs ~]#
--- Target DB
[root@oracle-db-19ct ~]# cat /etc/redhat-release
CentOS Stream release 8
[root@oracle-db-19ct ~]#
--- Source DB Version
[root@oracle-db-19cs ~]#
[root@oracle-db-19cs ~]# su - oracle
[oracle@oracle-db-19cs ~]$
[oracle@oracle-db-19cs ~]$ sqlplus -v
SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oracle-db-19cs ~]$
--- Target DB Version
[root@oracle-db-19ct ~]#
[root@oracle-db-19ct ~]# su - oracle
[oracle@oracle-db-19ct ~]$
[oracle@oracle-db-19ct ~]$ sqlplus -v
SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@oracle-db-19ct ~]$
Step1: 环境检查
1.1 确认归档是否开启
--- Source DB
[oracle@oracle-db-19cs ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 1 19:40:45 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch
Oldest online log sequence 254
Next log sequence to archive 256
Current log sequence 256
SQL>
--- Target DB
[oracle@oracle-db-19ct ~]$
[oracle@oracle-db-19ct ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 1 19:41:44 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch
Oldest online log sequence 255
Next log sequence to archive 257
Current log sequence 257
SQL>
以上若为关闭状态,则需要进行以下操作开启归档模式,并设置归档地址。(Source DB/Target 需进行同样的操作,开启归档,设置归档地址)注意: 需在数据库mount状态下进行开启归档
[oracle@ol7s arch]$
[oracle@ol7s arch]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri Feb 24 14:22:35 2023
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
sys@cdb$root:cdb1> show user;
USER is "SYS"
sys@cdb$root:cdb1> show con_name;
CON_NAME
------------------------------
CDB$ROOT
sys@cdb$root:cdb1> alter system set log_archive_dest_1 = 'LOCATION=/u01/app/oracle/product/12.1.0.2/db_1/dbs/arch';
System altered.
sys@cdb$root:cdb1> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/12.1.0.2/db_1/dbs/arch
Oldest online log sequence 2
Current log sequence 4
sys@cdb$root:cdb1>
sys@cdb$root:cdb1> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@cdb$root:cdb1>
sys@cdb$root:cdb1> startup mount;
ORACLE instance started.
Total System Global Area 1644167168 bytes
Fixed Size 8793400 bytes
Variable Size 1056965320 bytes
Database Buffers 570425344 bytes
Redo Buffers 7983104 bytes
Database mounted.
sys@cdb$root:cdb1>
sys@cdb$root:cdb1> alter database archivelog;
Database altered.
sys@cdb$root:cdb1>
sys@cdb$root:cdb1> alter database open;
Database altered.
sys@cdb$root:cdb1> set pagesize 200 linesize 200
sys@cdb$root:cdb1>
sys@cdb$root:cdb1> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
1 row selected.
sys@cdb$root:cdb1> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/12.1.0.2/db_1/dbs/arch
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4
sys@cdb$root:cdb1>
sys@cdb$root:cdb1> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@ol7s arch]$
创建测试表:
SQL> create table maxwell_db as select * from emp;
Table created.
SQL> select * from maxwell_db;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ------------------------------ --------------------------- ---------- --------------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 24-JAN-87 3000 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 02-APR-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
13 rows selected.
SQL>
Step2:备份准备
2.1 全库备份
1. 创建备份所需要的目录
[root@oracle-db-19cs /]# su - oracle
[oracle@oracle-db-19cs ~]$ pwd
/home/oracle
[oracle@oracle-db-19cs ~]$ mkdir rmanback
[oracle@oracle-db-19cs ~]$ ls -ltr
total 2989100
-rw-r--r--. 1 root root 3059705302 Nov 2 13:56 LINUX.X64_193000_db_home.zip
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Templates
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Public
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Downloads
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Documents
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Desktop
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Videos
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Pictures
drwxr-xr-x. 2 oracle oinstall 6 Nov 26 10:45 Music
-rw-r--r--. 1 root root 313139 Nov 26 10:54 rlwrap-0.43.tar.gz
drwxr-xr-x. 2 oracle oinstall 136 Jan 1 12:33 expbk
drwxr-xr-x. 2 oracle oinstall 35 Jan 31 14:02 Backup
drwxr-xr-x. 3 oracle oinstall 24 Jan 31 22:28 DBA
drwxr-xr-x. 2 oracle oinstall 6 Feb 1 11:43 ArchLog
-rw-r--r--. 1 oracle oinstall 781446 Feb 1 21:37 test_maxwell_report.html
-rw-r--r--. 1 oracle oinstall 3982 Feb 1 23:24 cgf95c3k5mszx_txt1.txt
drwxr-xr-x. 2 oracle oinstall 27 Feb 16 11:50 rmanbk
-rw-r--r--. 1 oracle oinstall 4840 Feb 21 18:46 hr_schema.lst
-rw-r--r--. 1 oracle oinstall 18821 Feb 21 18:52 pubs_hr_schema.lst
drwxr-xr-x. 2 oracle oinstall 6 Mar 1 20:10 rmanback
[oracle@oracle-db-19cs ~]$
2.备份数据文件
[root@oracle-db-19cs /]# su - oracle
[oracle@oracle-db-19cs ~]$
[oracle@oracle-db-19cs ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Wed Mar 1 20:06:29 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (DBID=1093429351)
RMAN>
3.切日志,管理员权限操作
[root@oracle-db-19cs ~]# su - oracle
[oracle@oracle-db-19cs ~]$
[oracle@oracle-db-19cs ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 2 10:41:40 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch
Oldest online log sequence 257
Next log sequence to archive 259
Current log sequence 259
SQL> alter system switch logfile;
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch
Oldest online log sequence 258
Next log sequence to archive 260
Current log sequence 260
SQL>
4.备份数据库文件
数据文件的备份:
[oracle@oracle-db-19cs rmanback]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Thu Mar 2 10:40:55 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (DBID=1093429351)
RMAN> backup database format '/home/oracle/rmanback/data_%U.dbf';
Starting backup at 02-MAR-23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=142 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u02/oradata/CDB1/sysaux01.dbf
input datafile file number=00001 name=/u02/oradata/CDB1/system01.dbf
input datafile file number=00004 name=/u02/oradata/CDB1/undotbs01.dbf
input datafile file number=00007 name=/u02/oradata/CDB1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAR-23
channel ORA_DISK_1: finished piece 1 at 02-MAR-23
piece handle=/home/oracle/rmanback/data_241m1fkn_1_1.dbf tag=TAG20230302T114839 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00126 name=/u02/oradata/CDB1/pdb1/TBS_MAXWELL_01.dbf
input datafile file number=00010 name=/u02/oradata/CDB1/pdb1/sysaux01.dbf
input datafile file number=00009 name=/u02/oradata/CDB1/pdb1/system01.dbf
input datafile file number=00012 name=/u02/oradata/CDB1/pdb1/users01.dbf
input datafile file number=00127 name=/u02/oradata/CDB1/pdb1/undotbs02.dbf
input datafile file number=00011 name=/u02/oradata/CDB1/pdb1/undotbs01.dbf
input datafile file number=00085 name=/u02/oradata/CDB1/pdb1/data01.dbf
input datafile file number=00163 name=/u02/oradata/CDB1/pdb1/TBS_TOOLS01.dbf
input datafile file number=00169 name=/u02/oradata/CDB1/pdb1/rman01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAR-23
channel ORA_DISK_1: finished piece 1 at 02-MAR-23
piece handle=/home/oracle/rmanback/data_251m1fmo_1_1.dbf tag=TAG20230302T114839 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00014 name=/u02/oradata/CDB1/pdb2/sysaux01.dbf
input datafile file number=00013 name=/u02/oradata/CDB1/pdb2/system01.dbf
input datafile file number=00016 name=/u02/oradata/CDB1/pdb2/users01.dbf
input datafile file number=00015 name=/u02/oradata/CDB1/pdb2/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAR-23
channel ORA_DISK_1: finished piece 1 at 02-MAR-23
piece handle=/home/oracle/rmanback/data_261m1fn0_1_1.dbf tag=TAG20230302T114839 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00164 name=/u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_sysaux_kyv81s6v_.dbf
input datafile file number=00162 name=/u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_system_kyv81s6t_.dbf
input datafile file number=00165 name=/u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_undotbs1_kyv81s6w_.dbf
input datafile file number=00166 name=/u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_users_kyv82cng_.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAR-23
channel ORA_DISK_1: finished piece 1 at 02-MAR-23
piece handle=/home/oracle/rmanback/data_271m1fnp_1_1.dbf tag=TAG20230302T114839 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u02/oradata/CDB1/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u02/oradata/CDB1/pdbseed/system01.dbf
input datafile file number=00008 name=/u02/oradata/CDB1/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAR-23
channel ORA_DISK_1: finished piece 1 at 02-MAR-23
piece handle=/home/oracle/rmanback/data_281m1fo8_1_1.dbf tag=TAG20230302T114839 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 02-MAR-23
Starting Control File and SPFILE Autobackup at 02-MAR-23
piece handle=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/c-1093429351-20230302-01 comment=NONE
Finished Control File and SPFILE Autobackup at 02-MAR-23
RMAN>
[oracle@oracle-db-19cs rmanback]$ pwd
/home/oracle/rmanback
[oracle@oracle-db-19cs rmanback]$ ls -ltr
total 4374040
-rw-r-----. 1 oracle oinstall 1672699904 Mar 2 11:49 data_241m1fkn_1_1.dbf
-rw-r-----. 1 oracle oinstall 1032208384 Mar 2 11:49 data_251m1fmo_1_1.dbf
-rw-r-----. 1 oracle oinstall 642031616 Mar 2 11:50 data_261m1fn0_1_1.dbf
-rw-r-----. 1 oracle oinstall 548913152 Mar 2 11:50 data_271m1fnp_1_1.dbf
-rw-r-----. 1 oracle oinstall 583163904 Mar 2 11:50 data_281m1fo8_1_1.dbf
[oracle@oracle-db-19cs rmanback]$
控制文件的备份:
RMAN>
RMAN> backup current controlfile format '/home/oracle/rmanback/control_%f.dbf';
Starting backup at 02-MAR-23
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 02-MAR-23
channel ORA_DISK_1: finished piece 1 at 02-MAR-23
piece handle=/home/oracle/rmanback/control_0.dbf tag=TAG20230302T115246 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-MAR-23
Starting Control File and SPFILE Autobackup at 02-MAR-23
piece handle=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/c-1093429351-20230302-02 comment=NONE
Finished Control File and SPFILE Autobackup at 02-MAR-23
RMAN>
[oracle@oracle-db-19cs rmanback]$ ls -ltr
total 4392664
-rw-r-----. 1 oracle oinstall 1672699904 Mar 2 11:49 data_241m1fkn_1_1.dbf
-rw-r-----. 1 oracle oinstall 1032208384 Mar 2 11:49 data_251m1fmo_1_1.dbf
-rw-r-----. 1 oracle oinstall 642031616 Mar 2 11:50 data_261m1fn0_1_1.dbf
-rw-r-----. 1 oracle oinstall 548913152 Mar 2 11:50 data_271m1fnp_1_1.dbf
-rw-r-----. 1 oracle oinstall 583163904 Mar 2 11:50 data_281m1fo8_1_1.dbf
-rw-r-----. 1 oracle oinstall 19070976 Mar 2 11:52 control_0.dbf
[oracle@oracle-db-19cs rmanback]$
复制一下参数文件:
确认源数据库参数文件
[oracle@oracle-db-19cs ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 2 11:54:19 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> set pagesize 200 linesize 200
SQL>
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
spfile string /u01/app/oracle/product/19.3.0
/dbhome_1/dbs/spfilecdb1.ora
SQL>
确认目标数据库是否有与源数据库相同的参数文件路径,若无,则需创建。
[oracle@oracle-db-19ct ~]$ cd /u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19ct dbs]$ pwd
/u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19ct dbs]$
关闭目标数据库
[oracle@oracle-db-19ct dbs]$
[oracle@oracle-db-19ct dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 1 20:35:51 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
删除目标数据库中的参数文件
[oracle@oracle-db-19ct dbs]$ pwd
/u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19ct dbs]$ ls -ltr
total 18576
-rw-r--r--. 1 oracle oinstall 3079 May 14 2015 init.ora.bkp
-rw-r--r--. 1 oracle oinstall 3079 May 14 2015 init.ora
-rw-r-----. 1 oracle oinstall 24 Nov 2 15:03 lkCDB1
-rw-r-----. 1 oracle oinstall 3584 Nov 27 16:55 spfilecdb1.ora.bkp
-rw-r-----. 1 oracle oinstall 3072 Feb 1 13:41 orapwcdb1
-rw-r--r--. 1 oracle oinstall 1188 Feb 2 19:19 initcdb1.ora
-rw-r-----. 1 oracle oinstall 3584 Mar 1 19:01 spfilecdb1.ora
-rw-r-----. 1 oracle oinstall 18989056 Mar 1 19:32 snapcf_cdb1.f
-rw-rw----. 1 oracle oinstall 1544 Mar 1 20:36 hc_cdb1.dat
[oracle@oracle-db-19ct dbs]$ rm -rf init.ora spfilecdb1.ora initcdb1.ora
[oracle@oracle-db-19ct dbs]$ ls -ltr
total 18564
-rw-r--r--. 1 oracle oinstall 3079 May 14 2015 init.ora.bkp
-rw-r-----. 1 oracle oinstall 24 Nov 2 15:03 lkCDB1
-rw-r-----. 1 oracle oinstall 3584 Nov 27 16:55 spfilecdb1.ora.bkp
-rw-r-----. 1 oracle oinstall 3072 Feb 1 13:41 orapwcdb1
-rw-r-----. 1 oracle oinstall 18989056 Mar 1 19:32 snapcf_cdb1.f
-rw-rw----. 1 oracle oinstall 1544 Mar 1 20:36 hc_cdb1.dat
[oracle@oracle-db-19ct dbs]$
源库复制参数文件到目标数据库
[oracle@oracle-db-19cs dbs]$ scp /u01/app/oracle/product/19.3.0/dbhome_1/dbs/init.ora 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19cs dbs]$ scp /u01/app/oracle/product/19.3.0/dbhome_1/dbs/spfilecdb1.ora 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs[oracle@oracle-db-19cs dbs]$ scp /u01/app/oracle/product/19.3.0/dbhome_1/dbs/initcdb1.ora 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19cs dbs]$ pwd
/u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19cs dbs]$ scp /u01/app/oracle/product/19.3.0/dbhome_1/dbs/init.ora 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs
The authenticity of host '192.168.8.152 (192.168.8.152)' can't be established.
ECDSA key fingerprint is SHA256:iMPMqJJ05A6sDUZU/YufKG7Mws49aWtXJK7HICebAz0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.8.152' (ECDSA) to the list of known hosts.
oracle@192.168.8.152's password:
init.ora 100% 3079 48.1KB/s 00:00
[oracle@oracle-db-19cs dbs]$ scp /u01/app/oracle/product/19.3.0/dbhome_1/dbs/spfilecdb1.ora 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs
oracle@192.168.8.152's password:
spfilecdb1.ora 100% 3584 1.7MB/s 00:00
[oracle@oracle-db-19cs dbs]$ scp /u01/app/oracle/product/19.3.0/dbhome_1/dbs/initcdb1.ora 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs
oracle@192.168.8.152's password:
initcdb1.ora 100% 1188 76.9KB/s 00:00
[oracle@oracle-db-19cs dbs]$
[oracle@oracle-db-19ct dbs]$ ls -ltr
total 18576
-rw-r--r--. 1 oracle oinstall 3079 May 14 2015 init.ora.bkp
-rw-r-----. 1 oracle oinstall 24 Nov 2 15:03 lkCDB1
-rw-r-----. 1 oracle oinstall 3584 Nov 27 16:55 spfilecdb1.ora.bkp
-rw-r-----. 1 oracle oinstall 3072 Feb 1 13:41 orapwcdb1
-rw-r-----. 1 oracle oinstall 18989056 Mar 1 19:32 snapcf_cdb1.f
-rw-rw----. 1 oracle oinstall 1544 Mar 1 20:36 hc_cdb1.dat
-rw-r--r--. 1 oracle oinstall 3079 Mar 1 20:44 init.ora
-rw-r-----. 1 oracle oinstall 3584 Mar 1 20:45 spfilecdb1.ora
-rw-r--r--. 1 oracle oinstall 1188 Mar 1 20:46 initcdb1.ora
[oracle@oracle-db-19ct dbs]$
删除目标数据库对应的数据库文件及目录
[oracle@oracle-db-19ct oradata]$ rm -rf /u02/oradata/CDB1
[oracle@oracle-db-19ct oradata]$ ls -ltr
total 0
drwxr-xr-x. 2 oracle oinstall 6 Feb 2 19:34 logfiles
drwxr-xr-x. 3 oracle oinstall 18 Feb 2 19:43 fra
[oracle@oracle-db-19ct oradata]$
Step3:复制归档文件
1.查看归档文件路径
源数据库做如下操作:
[oracle@oracle-db-19cs ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 1 21:12:29 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select name from v$archived_log order by 1;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_127_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_128_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_129_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_130_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_131_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_132_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_133_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_134_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_135_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_136_1119711914.dbf
/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_137_1119711914.dbf
132 rows selected.
SQL>
2. 复制归档文件
目标数据库中删除归档日志
[oracle@oracle-db-19ct dbs]$ pwd
/u01/app/oracle/product/19.3.0/dbhome_1/dbs
[oracle@oracle-db-19ct dbs]$ rm -rf arch1*.dbf
[oracle@oracle-db-19ct dbs]$ ls -ltr arch1*.dbf
ls: cannot access 'arch1*.dbf': No such file or directory
[oracle@oracle-db-19ct dbs]$
源数据库如下操作:
[oracle@oracle-db-19cs dbs]$ scp -r /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch* 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs/
oracle@192.168.8.152's password:
arch1_127_1119711914.dbf 100% 37MB 80.1MB/s 00:00
arch1_128_1119711914.dbf 100% 34MB 95.4MB/s 00:00
arch1_129_1119711914.dbf 100% 36MB 94.3MB/s 00:00
arch1_130_1119711914.dbf 100% 41MB 93.0MB/s 00:00
arch1_131_1119711914.dbf 100% 41MB 98.1MB/s 00:00
arch1_132_1119711914.dbf 100% 31MB 92.3MB/s 00:00
arch1_133_1119711914.dbf 100% 35MB 94.6MB/s 00:00
arch1_134_1119711914.dbf 100% 39MB 75.8MB/s 00:00
arch1_135_1119711914.dbf 100% 37MB 39.7MB/s 00:00
arch1_136_1119711914.dbf 100% 41MB 48.1MB/s 00:00
arch1_137_1119711914.dbf 100% 38MB 28.8MB/s 00:01
arch1_138_1119711914.dbf 100% 31MB 48.3MB/s 00:00
arch1_139_1119711914.dbf 100% 39MB 26.2MB/s 00:01
arch1_140_1119711914.dbf 100% 41MB 23.6MB/s 00:01
arch1_141_1119711914.dbf 100% 36MB 25.7MB/s 00:01
arch1_142_1119711914.dbf 100% 41MB 44.4MB/s 00:00
arch1_143_1119711914.dbf 100% 41MB 103.9MB/s 00:00
arch1_144_1119711914.dbf 100% 41MB 44.9MB/s 00:00
arch1_145_1119711914.dbf 100% 37MB 94.5MB/s 00:00
arch1_146_1119711914.dbf 100% 37MB 33.9MB/s 00:01
arch1_147_1119711914.dbf 100% 37MB 35.5MB/s 00:01
arch1_148_1119711914.dbf 100% 41MB 22.7MB/s 00:01
arch1_149_1119711914.dbf 100% 38MB 46.8MB/s 00:00
arch1_150_1119711914.dbf 100% 37MB 64.1MB/s 00:00
arch1_151_1119711914.dbf 100% 41MB 24.3MB/s 00:01
arch1_152_1119711914.dbf 100% 41MB 30.5MB/s 00:01
arch1_153_1119711914.dbf 100% 36MB 41.4MB/s 00:00
arch1_154_1119711914.dbf 100% 34MB 60.4MB/s 00:00
arch1_155_1119711914.dbf 100% 41MB 35.7MB/s 00:01
arch1_156_1119711914.dbf 100% 39MB 37.4MB/s 00:01
arch1_157_1119711914.dbf 100% 33MB 51.9MB/s 00:00
arch1_158_1119711914.dbf 100% 33MB 24.2MB/s 00:01
arch1_159_1119711914.dbf 100% 30MB 25.5MB/s 00:01
arch1_160_1119711914.dbf 100% 33MB 32.2MB/s 00:01
arch1_161_1119711914.dbf 100% 41MB 33.0MB/s 00:01
arch1_162_1119711914.dbf 100% 40MB 67.2MB/s 00:00
arch1_163_1119711914.dbf 100% 41MB 19.8MB/s 00:02
arch1_164_1119711914.dbf 100% 34MB 13.1MB/s 00:02
arch1_165_1119711914.dbf 100% 32MB 42.9MB/s 00:00
arch1_166_1119711914.dbf 100% 31MB 40.5MB/s 00:00
arch1_167_1119711914.dbf 100% 34MB 21.4MB/s 00:01
arch1_168_1119711914.dbf 100% 32MB 31.5MB/s 00:01
arch1_169_1119711914.dbf 100% 30MB 90.6MB/s 00:00
arch1_170_1119711914.dbf 100% 41MB 50.8MB/s 00:00
arch1_171_1119711914.dbf 100% 31MB 37.9MB/s 00:00
arch1_172_1119711914.dbf 100% 32MB 35.2MB/s 00:00
arch1_173_1119711914.dbf 100% 33MB 25.5MB/s 00:01
arch1_174_1119711914.dbf 100% 33MB 58.3MB/s 00:00
arch1_175_1119711914.dbf 100% 30MB 22.1MB/s 00:01
arch1_176_1119711914.dbf 100% 32MB 47.7MB/s 00:00
arch1_177_1119711914.dbf 100% 31MB 14.1MB/s 00:02
arch1_178_1119711914.dbf 100% 41MB 19.5MB/s 00:02
arch1_179_1119711914.dbf 100% 32MB 69.0MB/s 00:00
arch1_180_1119711914.dbf 100% 33MB 35.4MB/s 00:00
arch1_181_1119711914.dbf 100% 35MB 82.3MB/s 00:00
arch1_182_1119711914.dbf 100% 30MB 39.2MB/s 00:00
arch1_183_1119711914.dbf 100% 32MB 72.3MB/s 00:00
arch1_184_1119711914.dbf 100% 30MB 33.6MB/s 00:00
arch1_185_1119711914.dbf 100% 31MB 46.0MB/s 00:00
arch1_186_1119711914.dbf 100% 31MB 29.1MB/s 00:01
arch1_187_1119711914.dbf 100% 5458KB 33.7MB/s 00:00
arch1_188_1119711914.dbf 100% 31MB 20.8MB/s 00:01
arch1_189_1119711914.dbf 100% 32MB 28.4MB/s 00:01
arch1_190_1119711914.dbf 100% 35MB 49.1MB/s 00:00
arch1_191_1119711914.dbf 100% 37MB 27.2MB/s 00:01
arch1_192_1119711914.dbf 100% 40MB 19.0MB/s 00:02
arch1_193_1119711914.dbf 100% 32MB 23.0MB/s 00:01
arch1_194_1119711914.dbf 100% 36MB 40.1MB/s 00:00
arch1_195_1119711914.dbf 100% 41MB 80.8MB/s 00:00
arch1_196_1119711914.dbf 100% 39MB 30.1MB/s 00:01
arch1_197_1119711914.dbf 100% 35MB 33.4MB/s 00:01
arch1_198_1119711914.dbf 100% 37MB 54.0MB/s 00:00
arch1_199_1119711914.dbf 100% 41MB 31.1MB/s 00:01
arch1_200_1119711914.dbf 100% 35MB 26.0MB/s 00:01
arch1_201_1119711914.dbf 100% 36MB 18.1MB/s 00:01
arch1_202_1119711914.dbf 100% 41MB 33.8MB/s 00:01
arch1_203_1119711914.dbf 100% 32MB 33.5MB/s 00:00
arch1_204_1119711914.dbf 100% 35MB 39.9MB/s 00:00
arch1_205_1119711914.dbf 100% 34MB 67.3MB/s 00:00
arch1_206_1119711914.dbf 100% 33MB 33.6MB/s 00:00
arch1_207_1119711914.dbf 100% 32MB 22.5MB/s 00:01
arch1_208_1119711914.dbf 100% 33MB 34.9MB/s 00:00
arch1_209_1119711914.dbf 100% 34MB 37.6MB/s 00:00
arch1_210_1119711914.dbf 100% 36MB 48.0MB/s 00:00
arch1_211_1119711914.dbf 100% 33MB 27.0MB/s 00:01
arch1_212_1119711914.dbf 100% 36MB 15.5MB/s 00:02
arch1_213_1119711914.dbf 100% 31MB 96.7MB/s 00:00
arch1_214_1119711914.dbf 100% 35MB 84.1MB/s 00:00
arch1_215_1119711914.dbf 100% 37MB 36.9MB/s 00:01
arch1_216_1119711914.dbf 100% 29MB 86.7MB/s 00:00
arch1_217_1119711914.dbf 100% 16MB 63.1MB/s 00:00
arch1_218_1119711914.dbf 100% 31MB 38.4MB/s 00:00
arch1_219_1119711914.dbf 100% 31MB 26.7MB/s 00:01
arch1_220_1119711914.dbf 100% 33MB 44.9MB/s 00:00
arch1_221_1119711914.dbf 100% 32MB 28.7MB/s 00:01
arch1_222_1119711914.dbf 100% 31MB 34.5MB/s 00:00
arch1_223_1119711914.dbf 100% 30MB 48.0MB/s 00:00
arch1_224_1119711914.dbf 100% 33MB 24.7MB/s 00:01
arch1_225_1119711914.dbf 100% 32MB 17.9MB/s 00:01
arch1_226_1119711914.dbf 100% 35MB 17.0MB/s 00:02
arch1_227_1119711914.dbf 100% 38MB 32.0MB/s 00:01
arch1_228_1119711914.dbf 100% 33MB 72.9MB/s 00:00
arch1_229_1119711914.dbf 100% 41MB 59.2MB/s 00:00
arch1_230_1119711914.dbf 100% 33MB 55.8MB/s 00:00
arch1_231_1119711914.dbf 100% 33MB 33.9MB/s 00:00
arch1_232_1119711914.dbf 100% 33MB 28.5MB/s 00:01
arch1_233_1119711914.dbf 100% 30MB 51.3MB/s 00:00
arch1_234_1119711914.dbf 100% 33MB 22.2MB/s 00:01
arch1_235_1119711914.dbf 100% 32MB 17.3MB/s 00:01
arch1_236_1119711914.dbf 100% 31MB 16.4MB/s 00:01
arch1_237_1119711914.dbf 100% 30MB 10.3MB/s 00:02
arch1_238_1119711914.dbf 100% 30MB 19.4MB/s 00:01
arch1_239_1119711914.dbf 100% 35MB 19.7MB/s 00:01
arch1_240_1119711914.dbf 100% 30MB 77.1MB/s 00:00
arch1_241_1119711914.dbf 100% 31MB 66.6MB/s 00:00
arch1_242_1119711914.dbf 100% 30MB 21.7MB/s 00:01
arch1_243_1119711914.dbf 100% 31MB 25.9MB/s 00:01
arch1_244_1119711914.dbf 100% 31MB 64.7MB/s 00:00
arch1_245_1119711914.dbf 100% 33MB 36.6MB/s 00:00
arch1_246_1119711914.dbf 100% 30MB 23.9MB/s 00:01
arch1_247_1119711914.dbf 100% 33MB 30.2MB/s 00:01
arch1_248_1119711914.dbf 100% 39MB 28.4MB/s 00:01
arch1_249_1119711914.dbf 100% 41MB 26.7MB/s 00:01
arch1_250_1119711914.dbf 100% 40MB 24.2MB/s 00:01
arch1_251_1119711914.dbf 100% 31MB 20.3MB/s 00:01
arch1_252_1119711914.dbf 100% 33MB 16.9MB/s 00:01
arch1_253_1119711914.dbf 100% 16MB 9.2MB/s 00:01
arch1_254_1119711914.dbf 100% 41MB 23.0MB/s 00:01
arch1_255_1119711914.dbf 100% 38MB 20.2MB/s 00:01
arch1_256_1119711914.dbf 100% 32MB 67.0MB/s 00:00
arch1_257_1119711914.dbf 100% 35MB 27.8MB/s 00:01
arch1_258_1119711914.dbf 100% 31MB 24.8MB/s 00:01
arch1_259_1119711914.dbf 100% 7283KB 18.8MB/s 00:00
[oracle@oracle-db-19cs dbs]$
[oracle@oracle-db-19cs dbs]$ scp -r /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch* 192.168.8.152:/u01/app/oracle/product/19.3.0/dbhome_1/dbs/
[oracle@oracle-db-19ct dbs]$ ls -ltr arch1*.dbf | wc -l
133
[oracle@oracle-db-19ct dbs]$
3. 复制所有的备份文件
目标数据库文件夹需创建:
[oracle@oracle-db-19ct ~]$ pwd
/home/oracle
[oracle@oracle-db-19ct ~]$ mkdir /home/oracle/rmanback
[oracle@oracle-db-19ct ~]$ cd /home/oracle/rmanback
[oracle@oracle-db-19ct rmanback]$
[oracle@oracle-db-19cs rmanback]$ ls -ltr
total 4392664
-rw-r-----. 1 oracle oinstall 1672699904 Mar 2 11:49 data_241m1fkn_1_1.dbf
-rw-r-----. 1 oracle oinstall 1032208384 Mar 2 11:49 data_251m1fmo_1_1.dbf
-rw-r-----. 1 oracle oinstall 642031616 Mar 2 11:50 data_261m1fn0_1_1.dbf
-rw-r-----. 1 oracle oinstall 548913152 Mar 2 11:50 data_271m1fnp_1_1.dbf
-rw-r-----. 1 oracle oinstall 583163904 Mar 2 11:50 data_281m1fo8_1_1.dbf
-rw-r-----. 1 oracle oinstall 19070976 Mar 2 11:52 control_0.dbf
[oracle@oracle-db-19cs rmanback]$ scp * 192.168.8.152:/home/oracle/rmanback/
oracle@192.168.8.152's password:
control_0.dbf 100% 18MB 79.3MB/s 00:00
data_241m1fkn_1_1.dbf 100% 1595MB 53.8MB/s 00:29
data_251m1fmo_1_1.dbf 100% 984MB 58.5MB/s 00:16
data_261m1fn0_1_1.dbf 100% 612MB 52.7MB/s 00:11
data_271m1fnp_1_1.dbf 100% 523MB 38.9MB/s 00:13
data_281m1fo8_1_1.dbf 100% 556MB 36.0MB/s 00:15
[oracle@oracle-db-19cs rmanback]$
Step4: 备份恢复
1.恢复控制文件
[oracle@oracle-db-19ct dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 2 13:37:44 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 629145392 bytes
Fixed Size 9137968 bytes
Variable Size 423624704 bytes
Database Buffers 180355072 bytes
Redo Buffers 16027648 bytes
SQL>
注意:数据库启动到nomount状态下,先确认参数文件里目录是否都存在,查看参数文件可以使用 strings spfilecdb1.ora
[oracle@oracle-db-19ct ~]$ cd rmanback
[oracle@oracle-db-19ct rmanback]$ ls -ltr
total 4387872
-rw-r-----. 1 oracle oinstall 19070976 Mar 1 21:28 control_0.dbf
-rw-r-----. 1 oracle oinstall 1667801088 Mar 1 21:28 data_231lvot2_1_1.dbf
-rw-r-----. 1 oracle oinstall 1032216576 Mar 1 21:28 data_241lvou5_1_1.dbf
-rw-r-----. 1 oracle oinstall 642015232 Mar 1 21:28 data_251lvov8_1_1.dbf
-rw-r-----. 1 oracle oinstall 548913152 Mar 1 21:28 data_261lvp02_1_1.dbf
-rw-r-----. 1 oracle oinstall 583163904 Mar 1 21:28 data_271lvp0h_1_1.dbf
[oracle@oracle-db-19ct rmanback]$ pwd
/home/oracle/rmanback
[oracle@oracle-db-19ct rmanback]$
[oracle@oracle-db-19ct rmanback]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Wed Mar 1 21:38:48 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (not mounted)
RMAN> restore controlfile from '/home/oracle/rmanback/control_0.dbf';
Starting restore at 01-MAR-23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=262 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u02/oradata/CDB1/control01.ctl
output file name=/u02/oradata/CDB1/control02.ctl
Finished restore at 01-MAR-23
RMAN>
2.恢复数据文件
数据库启动到mount 状态, 在RMAN中启动即可。
[oracle@oracle-db-19ct rmanback]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Wed Mar 1 21:38:48 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (not mounted)
RMAN>
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 01-MAR-23
Starting implicit crosscheck backup at 01-MAR-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=264 device type=DISK
Crosschecked 28 objects
Finished implicit crosscheck backup at 01-MAR-23
Starting implicit crosscheck copy at 01-MAR-23
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 01-MAR-23
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u02/oradata/CDB1/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u02/oradata/CDB1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u02/oradata/CDB1/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u02/oradata/CDB1/users01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanback/data_231lvot2_1_1.dbf
channel ORA_DISK_1: piece handle=/home/oracle/rmanback/data_231lvot2_1_1.dbf tag=TAG20230301T201426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00009 to /u02/oradata/CDB1/pdb1/system01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /u02/oradata/CDB1/pdb1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /u02/oradata/CDB1/pdb1/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /u02/oradata/CDB1/pdb1/users01.dbf
channel ORA_DISK_1: restoring datafile 00085 to /u02/oradata/CDB1/pdb1/data01.dbf
channel ORA_DISK_1: restoring datafile 00126 to /u02/oradata/CDB1/pdb1/TBS_MAXWELL_01.dbf
channel ORA_DISK_1: restoring datafile 00127 to /u02/oradata/CDB1/pdb1/undotbs02.dbf
channel ORA_DISK_1: restoring datafile 00163 to /u02/oradata/CDB1/pdb1/TBS_TOOLS01.dbf
channel ORA_DISK_1: restoring datafile 00169 to /u02/oradata/CDB1/pdb1/rman01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanback/data_241lvou5_1_1.dbf
channel ORA_DISK_1: piece handle=/home/oracle/rmanback/data_241lvou5_1_1.dbf tag=TAG20230301T201426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00013 to /u02/oradata/CDB1/pdb2/system01.dbf
channel ORA_DISK_1: restoring datafile 00014 to /u02/oradata/CDB1/pdb2/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00015 to /u02/oradata/CDB1/pdb2/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00016 to /u02/oradata/CDB1/pdb2/users01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanback/data_251lvov8_1_1.dbf
channel ORA_DISK_1: piece handle=/home/oracle/rmanback/data_251lvov8_1_1.dbf tag=TAG20230301T201426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00162 to /u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_system_kyv81s6t_.dbf
channel ORA_DISK_1: restoring datafile 00164 to /u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_sysaux_kyv81s6v_.dbf
channel ORA_DISK_1: restoring datafile 00165 to /u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_undotbs1_kyv81s6w_.dbf
channel ORA_DISK_1: restoring datafile 00166 to /u02/oradata/CDB1/F4C9A1F8230F2E5CE0538A08A8C02747/datafile/o1_mf_users_kyv82cng_.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanback/data_261lvp02_1_1.dbf
channel ORA_DISK_1: piece handle=/home/oracle/rmanback/data_261lvp02_1_1.dbf tag=TAG20230301T201426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to /u02/oradata/CDB1/pdbseed/system01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u02/oradata/CDB1/pdbseed/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /u02/oradata/CDB1/pdbseed/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanback/data_271lvp0h_1_1.dbf
channel ORA_DISK_1: piece handle=/home/oracle/rmanback/data_271lvp0h_1_1.dbf tag=TAG20230301T201426
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 01-MAR-23
RMAN>
检查控制文件和实际物理文件的差别
crosscheck archivelog all;
---由于校验归档日志之前被删掉了,因此校验不成功。
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_127_1119711914.dbf RECID=2 STAMP=1127667631
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_128_1119711914.dbf RECID=3 STAMP=1127685612
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_129_1119711914.dbf RECID=4 STAMP=1127685624
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_130_1119711914.dbf RECID=5 STAMP=1127689973
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_131_1119711914.dbf RECID=6 STAMP=1127689974
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_132_1119711914.dbf RECID=7 STAMP=1127724774
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_133_1119711914.dbf RECID=8 STAMP=1127728754
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_134_1119711914.dbf RECID=9 STAMP=1127728793
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_135_1119711914.dbf RECID=10 STAMP=1127728812
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_136_1119711914.dbf RECID=11 STAMP=1127728827
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_137_1119711914.dbf RECID=12 STAMP=1127729004
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_138_1119711914.dbf RECID=13 STAMP=1127729025
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_139_1119711914.dbf RECID=14 STAMP=1127729046
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_140_1119711914.dbf RECID=15 STAMP=1127729058
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_141_1119711914.dbf RECID=16 STAMP=1127729073
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_142_1119711914.dbf RECID=17 STAMP=1127729136
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_143_1119711914.dbf RECID=18 STAMP=1127729157
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_144_1119711914.dbf RECID=19 STAMP=1127729172
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_145_1119711914.dbf RECID=20 STAMP=1127729188
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_146_1119711914.dbf RECID=21 STAMP=1127730005
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_147_1119711914.dbf RECID=22 STAMP=1127730023
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_148_1119711914.dbf RECID=23 STAMP=1127730035
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_149_1119711914.dbf RECID=24 STAMP=1127730108
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_150_1119711914.dbf RECID=25 STAMP=1127730131
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_151_1119711914.dbf RECID=26 STAMP=1127730147
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_152_1119711914.dbf RECID=27 STAMP=1127730161
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_153_1119711914.dbf RECID=28 STAMP=1127730514
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_154_1119711914.dbf RECID=29 STAMP=1127730532
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_155_1119711914.dbf RECID=30 STAMP=1127730546
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_156_1119711914.dbf RECID=31 STAMP=1127730562
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_157_1119711914.dbf RECID=32 STAMP=1127741455
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_158_1119711914.dbf RECID=33 STAMP=1127743219
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_159_1119711914.dbf RECID=34 STAMP=1127750437
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_160_1119711914.dbf RECID=35 STAMP=1127757631
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_161_1119711914.dbf RECID=36 STAMP=1127758186
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_162_1119711914.dbf RECID=37 STAMP=1127759256
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_163_1119711914.dbf RECID=38 STAMP=1127759364
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_164_1119711914.dbf RECID=39 STAMP=1127850117
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_165_1119711914.dbf RECID=40 STAMP=1127939816
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_166_1119711914.dbf RECID=41 STAMP=1127939848
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_167_1119711914.dbf RECID=42 STAMP=1127946046
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_168_1119711914.dbf RECID=43 STAMP=1127946067
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_169_1119711914.dbf RECID=44 STAMP=1128379323
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_170_1119711914.dbf RECID=45 STAMP=1128380785
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_171_1119711914.dbf RECID=46 STAMP=1128450621
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_172_1119711914.dbf RECID=47 STAMP=1128457847
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_173_1119711914.dbf RECID=48 STAMP=1128693769
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_174_1119711914.dbf RECID=49 STAMP=1128695040
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_175_1119711914.dbf RECID=50 STAMP=1128700467
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_176_1119711914.dbf RECID=51 STAMP=1128710557
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_177_1119711914.dbf RECID=52 STAMP=1128769172
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_178_1119711914.dbf RECID=53 STAMP=1128780015
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_179_1119711914.dbf RECID=54 STAMP=1128785420
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_180_1119711914.dbf RECID=55 STAMP=1128857420
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_181_1119711914.dbf RECID=56 STAMP=1128866414
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_182_1119711914.dbf RECID=57 STAMP=1128870346
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_183_1119711914.dbf RECID=58 STAMP=1128888298
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_184_1119711914.dbf RECID=59 STAMP=1128895223
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_185_1119711914.dbf RECID=60 STAMP=1128895253
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_186_1119711914.dbf RECID=61 STAMP=1128897235
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_187_1119711914.dbf RECID=62 STAMP=1128933711
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_188_1119711914.dbf RECID=63 STAMP=1128934471
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_189_1119711914.dbf RECID=64 STAMP=1128934495
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_190_1119711914.dbf RECID=65 STAMP=1128934522
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_191_1119711914.dbf RECID=66 STAMP=1128934552
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_192_1119711914.dbf RECID=67 STAMP=1128934696
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_193_1119711914.dbf RECID=68 STAMP=1128934714
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_194_1119711914.dbf RECID=69 STAMP=1128934742
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_195_1119711914.dbf RECID=70 STAMP=1128934764
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_196_1119711914.dbf RECID=71 STAMP=1128934835
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_197_1119711914.dbf RECID=72 STAMP=1128934856
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_198_1119711914.dbf RECID=73 STAMP=1128934880
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_199_1119711914.dbf RECID=74 STAMP=1128934901
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_200_1119711914.dbf RECID=75 STAMP=1128936384
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_201_1119711914.dbf RECID=76 STAMP=1128936396
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_202_1119711914.dbf RECID=77 STAMP=1128936409
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_203_1119711914.dbf RECID=78 STAMP=1128936627
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_204_1119711914.dbf RECID=79 STAMP=1128937421
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_205_1119711914.dbf RECID=80 STAMP=1128937515
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_206_1119711914.dbf RECID=81 STAMP=1128938432
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_207_1119711914.dbf RECID=82 STAMP=1128951129
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_208_1119711914.dbf RECID=83 STAMP=1128952817
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_209_1119711914.dbf RECID=84 STAMP=1128952835
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_210_1119711914.dbf RECID=85 STAMP=1128952862
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_211_1119711914.dbf RECID=86 STAMP=1128952898
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_212_1119711914.dbf RECID=87 STAMP=1128952928
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_213_1119711914.dbf RECID=88 STAMP=1128953060
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_214_1119711914.dbf RECID=89 STAMP=1128953084
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_215_1119711914.dbf RECID=90 STAMP=1128953111
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_216_1119711914.dbf RECID=91 STAMP=1128959588
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_217_1119711914.dbf RECID=92 STAMP=1128963955
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_218_1119711914.dbf RECID=93 STAMP=1129030207
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_219_1119711914.dbf RECID=94 STAMP=1129039232
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_220_1119711914.dbf RECID=95 STAMP=1129044659
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_221_1119711914.dbf RECID=96 STAMP=1129059052
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_222_1119711914.dbf RECID=97 STAMP=1129108942
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_223_1119711914.dbf RECID=98 STAMP=1129109032
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_224_1119711914.dbf RECID=99 STAMP=1129113025
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_225_1119711914.dbf RECID=100 STAMP=1129123476
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_226_1119711914.dbf RECID=101 STAMP=1129126314
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_227_1119711914.dbf RECID=102 STAMP=1129127442
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_228_1119711914.dbf RECID=103 STAMP=1129131040
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_229_1119711914.dbf RECID=104 STAMP=1129140015
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_230_1119711914.dbf RECID=105 STAMP=1129210305
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_231_1119711914.dbf RECID=106 STAMP=1129211074
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_232_1119711914.dbf RECID=107 STAMP=1129212010
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_233_1119711914.dbf RECID=108 STAMP=1129219235
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_234_1119711914.dbf RECID=109 STAMP=1129226917
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_235_1119711914.dbf RECID=110 STAMP=1129233659
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_236_1119711914.dbf RECID=111 STAMP=1129271414
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_237_1119711914.dbf RECID=112 STAMP=1129282238
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_238_1119711914.dbf RECID=113 STAMP=1129288681
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_239_1119711914.dbf RECID=114 STAMP=1129300997
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_240_1119711914.dbf RECID=115 STAMP=1129312445
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_241_1119711914.dbf RECID=116 STAMP=1129320035
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_242_1119711914.dbf RECID=117 STAMP=1129366220
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_243_1119711914.dbf RECID=118 STAMP=1129377604
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_244_1119711914.dbf RECID=119 STAMP=1129384843
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_245_1119711914.dbf RECID=120 STAMP=1129395657
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_246_1119711914.dbf RECID=121 STAMP=1129407269
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_247_1119711914.dbf RECID=122 STAMP=1129984935
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_248_1119711914.dbf RECID=123 STAMP=1129984942
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_249_1119711914.dbf RECID=124 STAMP=1129984949
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_250_1119711914.dbf RECID=125 STAMP=1129984960
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_251_1119711914.dbf RECID=126 STAMP=1129989635
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_252_1119711914.dbf RECID=127 STAMP=1129998632
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_253_1119711914.dbf RECID=128 STAMP=1130351543
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_254_1119711914.dbf RECID=129 STAMP=1130351881
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_255_1119711914.dbf RECID=130 STAMP=1130351894
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_256_1119711914.dbf RECID=131 STAMP=1130355775
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_257_1119711914.dbf RECID=132 STAMP=1130365209
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_258_1119711914.dbf RECID=133 STAMP=1130408117
validation succeeded for archived log
archived log file name=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch1_259_1119711914.dbf RECID=134 STAMP=1130409728
Crosschecked 133 objects
RMAN>
源数据库
若上面归档日志校验失败, 则执行下面指令 。
等到归档日志校验成功后,恢复数据库。
RMAN> recover database;
Starting recover at 01-MAR-23
using channel ORA_DISK_1
starting media recovery
unable to find archived log
archived log thread=1 sequence=258
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/01/2023 22:01:41
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 258 and starting SCN of 22442313
RMAN>
此时报错,则通过以下命令执行:
RMAN> recover database;
Starting recover at 01-MAR-23
using channel ORA_DISK_1
starting media recovery
unable to find archived log
archived log thread=1 sequence=258
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/01/2023 22:01:41
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 258 and starting SCN of 22442313
RMAN>
RMAN> recover database until sequence 258;
Starting recover at 01-MAR-23
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/01/2023 22:03:49
RMAN-06556: datafile 1 must be restored from backup older than SCN 22441179
RMAN>
最后进行的是不完全恢复。参考链接如下: