昨天接到一个需求,将客户生产库备份集还原到新服务器上。立即登录目标服务器上看一下,oracle软件还没有安装,oracle安装包和备份集客户已准备好,开始安装吧。
安装过程本应该略过的,有两个折腾的地方还是记录一下吧。
1、明明都通过了,始终不弹出安装界面,折腾了很久。
尝试xshell登录时直接用oracle用户登录,没有执行export DISPLAY=ip:0.0,直接执行./runInstaller,安装图形界面居然就出来了。在此之前只是安装了xterm和xclock,不知是不是与xterm有关,ORACLE_HOME中设置了ORACLE_TERM=xterm; export ORACLE_TERM。
2、Prerequisite checks中出现了一些包没有,这些需要的包是32位的,逐一检查都已安装64位的包,全部忽略。搞不懂为啥会检查出需要32位包。
备份集还原
1、还原spfile
rman target /;
restore spfile to ‘/tmp/pfile.ora‘ from ‘/home/dbdata/rmanback20200613/PRIMARY_spfile_73v2k54t_1_1_20200613‘;
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 16 14:16:01 2020
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile=‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/pfile.ora‘;
ORACLE instance started.
Total System Global Area 4.2758E+10 bytes
Fixed Size 2216344 bytes
Variable Size 7247761000 bytes
Database Buffers 3.5433E+10 bytes
Redo Buffers 74465280 bytes
2、还原控制文件
RMAN> restore controlfile from ‘/home/dbdata/rmanback20200613/ctl_file_72v2k54q_1_1_20200613‘;
Starting restore at 16-JUN-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2737 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/oracle/oradata/PRIMARY/ctl1PRIMARY.ora
output file name=/home/oracle/oradata/PRIMARY/ctl2PRIMARY.ora
output file name=/home/oracle/oradata/PRIMARY/ctl3PRIMARY.ora
Finished restore at 16-JUN-20
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
3、注册备份集
RMAN> catalog start with ‘/home/dbdata/rmanback20200613/‘;
searching for all files that match the pattern /home/dbdata/rmanback20200613/
List of Files Unknown to the Database
=====================================
File Name: /home/dbdata/rmanback20200613/arch_71v2k54p_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6pv2k542_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6rv2k546_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6tv2k54e_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6hv2k1l3_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6ov2k53r_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6nv2k53r_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6kv2k3f7_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_spfile_73v2k54t_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6uv2k54e_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6iv2k1l3_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6vv2k54m_1_1_20200613
File Name: /home/dbdata/rmanback20200613/ctl_file_72v2k54q_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6lv2k41h_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6qv2k542_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_70v2k54m_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6jv2k2sk_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6sv2k547_1_1_20200613
Do you really want to catalog the above files (enter YES or NO)? y
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /home/dbdata/rmanback20200613/arch_71v2k54p_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6pv2k542_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6rv2k546_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6tv2k54e_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6hv2k1l3_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6ov2k53r_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6nv2k53r_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6kv2k3f7_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_spfile_73v2k54t_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6uv2k54e_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6iv2k1l3_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6vv2k54m_1_1_20200613
File Name: /home/dbdata/rmanback20200613/ctl_file_72v2k54q_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6lv2k41h_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6qv2k542_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_70v2k54m_1_1_20200613
File Name: /home/dbdata/rmanback20200613/PRIMARY_lev0_6jv2k2sk_1_1_20200613
File Name: /home/dbdata/rmanback20200613/arch_6sv2k547_1_1_20200613
rman target / log=/home/oracle/restore_log_$(date +%y%m%d).log <<eof
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
set newname for datafile 1 to ‘/home/oracle/oradata/PRIMARY/PRIMARY_system01.dbf‘;
set newname for datafile 2 to ‘/home/oracle/oradata/PRIMARY/PRIMARY_sysaux01.dbf‘;
set newname for datafile 3 to ‘/home/oracle/oradata/PRIMARY/PRIMARY_undo1.dbf‘;
set newname for datafile 4 to ‘/home/oracle/oradata/PRIMARY/PRIMARY_users01.dbf‘;
set newname for datafile 5 to ‘/home/oracle/oradata/PRIMARY/PRIMARY_tools01.dbf‘;
set newname for datafile 6 to ‘/home/oracle/oradata/PRIMARY/com/sc_com01.dbf‘;
set newname for datafile 7 to ‘/home/oracle/oradata/PRIMARY/comt/sc_t01.dbf‘;
set newname for datafile 8 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_01.dbf‘;
set newname for datafile 9 to ‘/home/oracle/oradata/PRIMARY/sedata2/sedata2_01.dbf‘;
set newname for datafile 10 to ‘/home/oracle/oradata/PRIMARY/sedata3/sedata3_01.dbf‘;
set newname for datafile 11 to ‘/home/oracle/oradata/PRIMARY/sedata4/sedata4_01.dbf‘;
set newname for datafile 12 to ‘/home/oracle/oradata/PRIMARY/sedata5/sedata5_01.dbf‘;
set newname for datafile 13 to ‘/home/oracle/oradata/PRIMARY/DATA_01.dbf‘;
set newname for datafile 14 to ‘/home/oracle/oradata/PRIMARY/SEDATA_01.dbf‘;
set newname for datafile 15 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_02.dbf‘;
set newname for datafile 16 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_03.dbf‘;
set newname for datafile 17 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_04.dbf‘;
set newname for datafile 18 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_05.dbf‘;
set newname for datafile 19 to ‘/home/oracle/oradata/PRIMARY/DATA_02.dbf‘;
set newname for datafile 20 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_06.dbf‘;
set newname for datafile 21 to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_07.dbf‘;
restore database;
switch datafile all;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
exit;
eof
创建对应的数据文件目录后执行还原脚本
nohup sh rman_restore.sh >rman_restore_sh.out 2>&1 &
更改redo log 和temp file的路径。
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/redo09.log‘ to ‘/home/oracle/oradata/PRIMARY/redo01.log‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/redo10.log‘ to ‘/home/oracle/oradata/PRIMARY/redo02.log‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/redo11.log‘ to ‘/home/oracle/oradata/PRIMARY/redo03.log‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/redo12.log‘ to ‘/home/oracle/oradata/PRIMARY/redo04.log‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/PRIMARY_temp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/PRIMARY_temp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/common/sce_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/common/sce_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/com/s_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/com/s_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata1/sedata1_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata2/sedata2_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata2/sedata2_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata3/sedata3_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata3/sedata3_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata4/sedata4_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata4/sedata4_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata5/sedata5_tmp01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata5/sedata5_tmp01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/DATA_TEMP_01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/DATA_TEMP_01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/DATA_TEMP_01.dbf‘ to ‘/home/oracle/oradata/PRIMARY/DATA_TEMP_01.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/PRIMARY_temp02.dbf‘ to ‘/home/oracle/oradata/PRIMARY/PRIMARY_temp02.dbf‘ ;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata1/sedata1_tmp02.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_tmp02.dbf‘;
alter database rename file ‘/u01/app/oracle/oradata/PRIMARY/sedata1/sedata1_tmp03.dbf‘ to ‘/home/oracle/oradata/PRIMARY/sedata1/sedata1_tmp03.dbf‘;
RMAN> recover database;
Starting recover at 16-JUN-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2737 device type=DISK
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10395
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10396
channel ORA_DISK_1: reading from backup piece /home/oracle/RMANBAK/arch_71v2k54p_1_1_20200613
channel ORA_DISK_1: errors found reading piece handle=/home/oracle/RMANBAK/arch_71v2k54p_1_1_20200613
channel ORA_DISK_1: failover to piece handle=/home/dbdata/rmanback20200613/arch_71v2k54p_1_1_20200613 tag=ARC_BAK
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_10395_999036486.dbf thread=1 sequence=10395
archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_10396_999036486.dbf thread=1 sequence=10396
unable to find archived log
archived log thread=1 sequence=10397
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/16/2020 16:27:30
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 10397 and starting SCN of 1885081388
恢复到sequence 10396,找不到10397后报错退出。
RMAN> list archivelog all;
list archive list archivelog all;
List of Archived Log Copies for database with db_unique_name PRIMARY
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
20638 1 10311 X 10-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10311_999036486.dbf
20639 1 10312 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10312_999036486.dbf
20640 1 10313 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10313_999036486.dbf
20641 1 10314 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10314_999036486.dbf
20642 1 10315 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10315_999036486.dbf
20643 1 10316 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10316_999036486.dbf
20644 1 10317 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10317_999036486.dbf
20645 1 10318 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10318_999036486.dbf
20646 1 10319 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10319_999036486.dbf
20647 1 10320 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10320_999036486.dbf
20648 1 10321 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10321_999036486.dbf
20649 1 10322 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10322_999036486.dbf
20650 1 10323 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10323_999036486.dbf
20651 1 10324 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10324_999036486.dbf
20652 1 10325 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10325_999036486.dbf
20653 1 10326 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10326_999036486.dbf
20654 1 10327 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10327_999036486.dbf
20655 1 10328 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10328_999036486.dbf
20656 1 10329 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10329_999036486.dbf
20657 1 10330 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10330_999036486.dbf
20658 1 10331 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10331_999036486.dbf
20659 1 10332 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10332_999036486.dbf
20660 1 10333 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10333_999036486.dbf
20661 1 10334 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10334_999036486.dbf
20662 1 10335 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10335_999036486.dbf
20663 1 10336 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10336_999036486.dbf
20664 1 10337 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10337_999036486.dbf
20665 1 10338 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10338_999036486.dbf
20666 1 10339 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10339_999036486.dbf
20667 1 10340 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10340_999036486.dbf
20668 1 10341 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10341_999036486.dbf
20669 1 10342 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10342_999036486.dbf
20670 1 10343 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10343_999036486.dbf
20671 1 10344 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10344_999036486.dbf
20672 1 10345 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10345_999036486.dbf
20673 1 10346 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10346_999036486.dbf
20674 1 10347 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10347_999036486.dbf
20675 1 10348 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10348_999036486.dbf
20676 1 10349 X 11-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10349_999036486.dbf
20677 1 10350 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10350_999036486.dbf
20678 1 10351 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10351_999036486.dbf
20679 1 10352 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10352_999036486.dbf
20680 1 10353 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10353_999036486.dbf
20681 1 10354 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10354_999036486.dbf
20682 1 10355 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10355_999036486.dbf
20683 1 10356 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10356_999036486.dbf
20684 1 10357 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10357_999036486.dbf
20685 1 10358 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10358_999036486.dbf
20686 1 10359 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10359_999036486.dbf
20687 1 10360 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10360_999036486.dbf
20688 1 10361 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10361_999036486.dbf
20689 1 10362 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10362_999036486.dbf
20690 1 10363 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10363_999036486.dbf
20691 1 10364 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10364_999036486.dbf
20692 1 10365 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10365_999036486.dbf
20748 1 10366 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10366_999036486.dbf
20750 1 10367 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10367_999036486.dbf
20752 1 10368 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10368_999036486.dbf
20754 1 10369 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10369_999036486.dbf
20756 1 10370 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10370_999036486.dbf
20758 1 10371 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10371_999036486.dbf
20760 1 10372 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10372_999036486.dbf
20762 1 10373 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10373_999036486.dbf
20764 1 10374 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10374_999036486.dbf
20766 1 10375 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10375_999036486.dbf
20768 1 10376 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10376_999036486.dbf
20770 1 10377 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10377_999036486.dbf
20772 1 10378 X 12-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10378_999036486.dbf
20774 1 10379 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10379_999036486.dbf
20776 1 10380 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10380_999036486.dbf
20777 1 10381 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10381_999036486.dbf
20780 1 10382 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10382_999036486.dbf
20782 1 10383 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10383_999036486.dbf
20784 1 10384 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10384_999036486.dbf
20786 1 10385 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10385_999036486.dbf
20788 1 10386 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10386_999036486.dbf
20790 1 10387 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10387_999036486.dbf
20792 1 10388 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10388_999036486.dbf
20794 1 10389 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10389_999036486.dbf
20795 1 10390 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10390_999036486.dbf
20798 1 10391 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10391_999036486.dbf
20800 1 10392 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10392_999036486.dbf
20801 1 10393 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10393_999036486.dbf
20804 1 10394 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10394_999036486.dbf
20811 1 10395 A 12-JUN-20
Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_10395_999036486.dbf
20806 1 10395 X 12-JUN-20
Name: /u01/app/oracle/admin/PRIMARY/arch/1_10395_999036486.dbf
20810 1 10396 A 13-JUN-20
Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_10396_999036486.dbf
20807 1 10396 X 13-JUN-20 Name: /u01/app/oracle/admin/PRIMARY/arch/1_10396_999036486.dbf
查看归档日志中最后seq 是10396,说明归档日志已全部恢复。下一步打开数据库。
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 06/16/2020 16:51:45
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 46413
Session ID: 2509 Serial number: 29
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-03114: not connected to ORACLE
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 06/16/2020 16:51:45
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 46413
Session ID: 2509 Serial number: 29
意外出现了,数据库需要升级?查看了一下版本,生产库的版本是11.2.0.4,而目标服务器上是11.2.0.1,安装包版本不对。
再次证明了,客户说的话不能全信,要核实。准备升级吧。
11.2.0.4 补丁号:13390677。一共有7个文件,升级DB只需要1和2。
出现INS-35735 single-instance database not detected. 执行./runInstaller前我没有启动数据库,此处选择NEXT,重新选择第二项 install database software only,备份集是11.2.0.4的数据库不需要升级,只升级软件。
执行/u01/app/oracle/product/11.2.0.4/dbhome_1/root.sh
最后修改$ORACLE_HOME,将pfile拷贝到新目录中后,正常打开数据库了。