第1章 安装准备

1.1 安装环境

  • 操作系统:Redhat6.5 x64 32核CPU 62G内存 系统盘300G 数据磁盘3T
  • Oracle软件:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

1.2 安装Oracle软件

[root@issdb ~]# lvcreate -n lv_ora -L 500G vgdata1
[root@issdb ~]# mkfs.ext4 /dev/mapper/vgdata1-lv_ora
[root@issdb /]# mount /dev/mapper/vgdata1-lv_ora /oracle/
[root@issdb ~]# chown -R oracle:oinstall /oracle/
[root@issdb ~]# su - oracle
[oracle@issdb ~]$ export DISPLAY=172.24.230.226:0.0
[oracle@issdb ~]$ xclock
[oracle@issdb ~]$ cd /home/oracle/database/
[oracle@issdb database]$ ./runInstaller



























[root@issdb ~]# /oracle/product/11.2.0/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/product/11.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@issdb ~]#

[oracle@issdb ~]$ export DISPLAY=172.24.230.226:0.0
[oracle@issdb ~]$ xclock
[oracle@issdb ~]$ netca















1.3 数据迁移

1.3.1 源端备份

1.3.1.1 创建pfile

SQL> create pfile='/tmp/pfile.ora' from spfile;

1.3.1.2 创建备份

1.3.1.3 修改pfile文件

iss.__db_cache_size=9227468800
iss.__java_pool_size=33554432
iss.__large_pool_size=1073741824
iss.__shared_pool_size=369098752
iss.__streams_pool_size=16777216
*._external_scn_logging_threshold_seconds='1200'
*.audit_file_dest='/oracle/admin/iss/adump'
*.background_dump_dest='/oracle/admin/iss/bdump'
*.compatible='11.2.0.4.0'
*.control_files='/oracle/oradata/iss/control01.ctl','/oracle/oradata/iss/control02.ctl','/oracle/oradata/iss/control03.ctl'
*.core_dump_dest='/oracle/admin/iss/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='iss'
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=' '
*.dispatchers='(PROTOCOL=TCP) (SERVICE=issXDB)'
*.job_queue_processes=10
*.large_pool_size=1073741824
*.log_archive_dest_1='LOCATION=/oracle/arch'
*.open_cursors=600
*.pga_aggregate_target=1631584256
*.processes=600
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.sga_max_size=10737418240
*.sga_target=10737418240
\#*.undo_management='AUTO'
*.undo_management='manual'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oracle/admin/iss/udump'
_allow_resetlogs_corruption=true
_allow_error_simulation=true

1.3.2 目标端还原

1.3.2.1 创建路径

mkdir -p /oracle/admin/iss/adump
mkdir -p /oracle/admin/iss/bdump
mkdir -p /oracle/admin/iss/cdump
mkdir -p /oracle/admin/iss/udump
mkdir -p /oracle/oradata/iss
mkdir -p /oracle/arch

1.3.2.2 nomount启动数据库

命令:

[oracle@issdb ~]$ sqlplus / as sysdba
SQL> startup nomount pfile='/oracle/bak/pfile.ora';

日志:

[oracle@issdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 7 15:19:59 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='/data/bak/pfile.ora';
ORACLE instance started.
Total System Global Area 1.0689E+10 bytes
Fixed Size 2262656 bytes
Variable Size 2717911424 bytes
Database Buffers 7952400384 bytes
Redo Buffers 16900096 bytes
SQL>

1.3.2.3 catalog 备份文件

备份文件存放的位置是记录在控制文件中的,前面做了控制文件的还原,能查询到所有的备份信息。但是记录的备份位置都是老的的路径,此处主要做了备份的校验删除失效的备份信息,加载传输到Linux系统上的备份文件信,需要根据实际情况做好调整。

命令:

[oracle@issdb ~]$ rman target /
RMAN> restore controlfile from '/data/databk/control_ISS_01_06_17744_1';
RMAN> alter database mount;
RMAN> crosscheck backup;
RMAN> delete expired backup;
Do you really want to delete the above objects (enter YES or NO)? yes
RMAN> catalog start with '/data/databk/level0_';
Do you really want to catalog the above files (enter YES or NO)? yes
RMAN> catalog start with '/data/databk/log_';
Do you really want to catalog the above files (enter YES or NO)? yes
RMAN> catalog start with '/data/databk/control_';
Do you really want to catalog the above files (enter YES or NO)? yes
RMAN> crosscheck archivelog all;
RMAN> list expired backupset;
RMAN> delete expired backupset;
RMAN> list backup of archivelog all;
RMAN> restore archivelog sequence 6;
RMAN> restore archivelog sequence between 6 and 7; (INCARNATION ALL)

日志:

[oracle@issdb ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jan 7 15:22:46 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ISS (not mounted)
RMAN> restore controlfile from '/data/databk/control_ISS_01_06_17744_1';
Starting restore at 2020/01/07 15:23:06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/oracle/oradata/iss/control01.ctl
output file name=/oracle/oradata/iss/control02.ctl
output file name=/oracle/oradata/iss/control03.ctl
Finished restore at 2020/01/07 15:23:09
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> crosscheck backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=40 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=80 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=119 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=158 device type=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/bak/df_20200105_9rul7ujm_1_1.dbf RECID=16657 STAMP=1028913795
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/bak/df_20200105_9pul7ujk_1_1.dbf RECID=16660 STAMP=1028913795
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/bak/df_20200105_9qul7ujk_1_1.dbf RECID=16661 STAMP=1028913795
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/bak/sp_20200105_9vul81n5_1_1.sp RECID=16663 STAMP=1028916966
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/log_ISS_01_05_17732_1.bak RECID=16664 STAMP=1028930416
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/control_ISS_01_05_17733_1 RECID=16669 STAMP=1028930802
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17738_1.bak RECID=16670 STAMP=1028947350
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17735_1.bak RECID=16671 STAMP=1028947349
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17739_1.bak RECID=16672 STAMP=1028949643
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17736_1.bak RECID=16673 STAMP=1028947349
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17740_1.bak RECID=16674 STAMP=1028949647
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17737_1.bak RECID=16675 STAMP=1028947349
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_ISS_01_06_17734_1.bak RECID=16676 STAMP=1028947349
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_log_ISS_01_06_17743_1.bak RECID=16677 STAMP=1028949782
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_log_ISS_01_06_17741_1.bak RECID=16678 STAMP=1028949782
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/isstemp/databk/level0_log_ISS_01_06_17742_1.bak RECID=16679 STAMP=1028949782
Crosschecked 16 objects
RMAN> delete expired backup;
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
16657 16657 1 1 EXPIRED DISK /isstemp/bak/df_20200105_9rul7ujm_1_1.dbf
16660 16660 1 1 EXPIRED DISK /isstemp/bak/df_20200105_9pul7ujk_1_1.dbf
16661 16661 1 1 EXPIRED DISK /isstemp/bak/df_20200105_9qul7ujk_1_1.dbf
16663 16663 1 1 EXPIRED DISK /isstemp/bak/sp_20200105_9vul81n5_1_1.sp
16664 16664 1 1 EXPIRED DISK /isstemp/databk/log_ISS_01_05_17732_1.bak
16669 16669 1 1 EXPIRED DISK /isstemp/databk/control_ISS_01_05_17733_1
16670 16670 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17738_1.bak
16671 16671 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17735_1.bak
16672 16672 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17739_1.bak
16673 16673 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17736_1.bak
16674 16674 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17740_1.bak
16675 16675 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17737_1.bak
16676 16676 1 1 EXPIRED DISK /isstemp/databk/level0_ISS_01_06_17734_1.bak
16677 16677 1 1 EXPIRED DISK /isstemp/databk/level0_log_ISS_01_06_17743_1.bak
16678 16678 1 1 EXPIRED DISK /isstemp/databk/level0_log_ISS_01_06_17741_1.bak
16679 16679 1 1 EXPIRED DISK /isstemp/databk/level0_log_ISS_01_06_17742_1.bak
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/isstemp/bak/df_20200105_9rul7ujm_1_1.dbf RECID=16657 STAMP=1028913795
deleted backup piece
backup piece handle=/isstemp/bak/df_20200105_9pul7ujk_1_1.dbf RECID=16660 STAMP=1028913795
deleted backup piece
backup piece handle=/isstemp/bak/df_20200105_9qul7ujk_1_1.dbf RECID=16661 STAMP=1028913795
deleted backup piece
backup piece handle=/isstemp/bak/sp_20200105_9vul81n5_1_1.sp RECID=16663 STAMP=1028916966
deleted backup piece
backup piece handle=/isstemp/databk/log_ISS_01_05_17732_1.bak RECID=16664 STAMP=1028930416
deleted backup piece
backup piece handle=/isstemp/databk/control_ISS_01_05_17733_1 RECID=16669 STAMP=1028930802
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17738_1.bak RECID=16670 STAMP=1028947350
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17735_1.bak RECID=16671 STAMP=1028947349
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17739_1.bak RECID=16672 STAMP=1028949643
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17736_1.bak RECID=16673 STAMP=1028947349
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17740_1.bak RECID=16674 STAMP=1028949647
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17737_1.bak RECID=16675 STAMP=1028947349
deleted backup piece
backup piece handle=/isstemp/databk/level0_ISS_01_06_17734_1.bak RECID=16676 STAMP=1028947349
deleted backup piece
backup piece handle=/isstemp/databk/level0_log_ISS_01_06_17743_1.bak RECID=16677 STAMP=1028949782
deleted backup piece
backup piece handle=/isstemp/databk/level0_log_ISS_01_06_17741_1.bak RECID=16678 STAMP=1028949782
deleted backup piece
backup piece handle=/isstemp/databk/level0_log_ISS_01_06_17742_1.bak RECID=16679 STAMP=1028949782
Deleted 16 EXPIRED objects
RMAN> catalog start with '/data/databk/level0_';
searching for all files that match the pattern /data/databk/level0_
List of Files Unknown to the Database
=====================================
File Name: /data/databk/level0_ISS_01_06_17738_1.bak
File Name: /data/databk/level0_ISS_01_06_17734_1.bak
File Name: /data/databk/level0_ISS_01_06_17736_1.bak
File Name: /data/databk/level0_ISS_01_06_17740_1.bak
File Name: /data/databk/level0_ISS_01_06_17737_1.bak
File Name: /data/databk/level0_log_ISS_01_06_17743_1.bak
File Name: /data/databk/level0_ISS_01_06_17735_1.bak
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /data/databk/level0_ISS_01_06_17738_1.bak
File Name: /data/databk/level0_ISS_01_06_17734_1.bak
File Name: /data/databk/level0_ISS_01_06_17736_1.bak
File Name: /data/databk/level0_ISS_01_06_17740_1.bak
File Name: /data/databk/level0_ISS_01_06_17737_1.bak
File Name: /data/databk/level0_log_ISS_01_06_17743_1.bak
File Name: /data/databk/level0_ISS_01_06_17735_1.bak
RMAN> catalog start with '/data/databk/log_';
searching for all files that match the pattern /data/databk/log_
List of Files Unknown to the Database
=====================================
File Name: /data/databk/log_ISS_01_06_17749_1.bak
File Name: /data/databk/log_ISS_01_06_17748_1.bak
File Name: /data/databk/log_ISS_01_06_17747_1.bak
File Name: /data/databk/log_ISS_01_06_17745_1.bak
File Name: /data/databk/log_ISS_01_06_17746_1.bak
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /data/databk/log_ISS_01_06_17749_1.bak
File Name: /data/databk/log_ISS_01_06_17748_1.bak
File Name: /data/databk/log_ISS_01_06_17747_1.bak
File Name: /data/databk/log_ISS_01_06_17745_1.bak
File Name: /data/databk/log_ISS_01_06_17746_1.bak
RMAN> catalog start with '/data/databk/control_';
searching for all files that match the pattern /data/databk/control_
List of Files Unknown to the Database
=====================================
File Name: /data/databk/control_ISS_01_06_17744_1
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /data/databk/control_ISS_01_06_17744_1
RMAN>

1.3.2.4 还原数据库

以下RMAN命令,会将备份还原出一个新库,set newname for datafile重新指定数据库文件路径。

RMAN> list incarnation;
RMAN> reset database to incarnation 2;
select * from (SELECT ('set newname for datafile '|| t.file_id ||' to "/oracle/oradata/iopsdb/'||
​ lower(tablespace_name) ||
​ LPAD(RK, 3, '0') ||'.dbf";') cmd FROM(
select d.*,
​ rank() over(partition by d.TABLESPACE_NAME order by d.FILE_ID) rk
from dba_data_files d) t
order by t.file_id)
union all
select * from(SELECT ('set newname for tempfile '|| t.file_id ||' to "/oracle/oradata/iopsdb/'||
​ lower(tablespace_name) ||
​ LPAD(RK, 3, '0') ||'.dbf";') cmd FROM(
select d.*,
​ rank() over(partition by d.TABLESPACE_NAME order by d.FILE_ID) rk
from dba_temp_files d) t
order by t.file_id)
union all
select * from(SELECT ('sql "alter database rename file '''''||t.MEMBER ||''''' to ''''/oracle/oradata/iopsdb/redo'||
​ t.GROUP# ||
​ chr(96+rk) ||'.dbf''''";') cmd FROM(
SELECT a.*,
rank() over(partition by a.GROUP# order by a.MEMBER) rk
FROM v$logfile a) t
order by t.GROUP#);

命令:

[oracle@issdb ~]$ rman target /
run {
set newname for datafile 1 to "/oracle/oradata/iss/system001.dbf";
set newname for datafile 2 to "/oracle/oradata/iss/undotbs1001.dbf";
set newname for datafile 3 to "/oracle/oradata/iss/sysaux001.dbf";
set newname for datafile 4 to "/oracle/oradata/iss/users001.dbf";
set newname for datafile 5 to "/oracle/oradata/iss/undotbs1002.dbf";
set newname for datafile 6 to "/oracle/oradata/iss/undotbs1003.dbf";
set newname for datafile 7 to "/oracle/oradata/iss/undotbs1004.dbf";
set newname for datafile 8 to "/oracle/oradata/iss/undotbs1005.dbf";
set newname for datafile 9 to "/oracle/oradata/iss/undotbs1006.dbf";
set newname for datafile 10 to "/oracle/oradata/iss/iss_data001.dbf";
set newname for datafile 11 to "/oracle/oradata/iss/iss_data002.dbf";
set newname for datafile 12 to "/oracle/oradata/iss/iss_data003.dbf";
set newname for datafile 13 to "/oracle/oradata/iss/iss_data004.dbf";
set newname for datafile 14 to "/oracle/oradata/iss/iss_data005.dbf";
set newname for datafile 15 to "/oracle/oradata/iss/iss_data006.dbf";
set newname for datafile 16 to "/oracle/oradata/iss/iss_data007.dbf";
set newname for datafile 17 to "/oracle/oradata/iss/iss_data008.dbf";
set newname for datafile 18 to "/oracle/oradata/iss/iss_data009.dbf";
set newname for datafile 19 to "/oracle/oradata/iss/iss_data010.dbf";
set newname for datafile 20 to "/oracle/oradata/iss/iss_data011.dbf";
set newname for datafile 21 to "/oracle/oradata/iss/iss_data012.dbf";
set newname for datafile 22 to "/oracle/oradata/iss/iss_data013.dbf";
set newname for datafile 23 to "/oracle/oradata/iss/iss_data014.dbf";
set newname for datafile 24 to "/oracle/oradata/iss/iss_data015.dbf";
set newname for datafile 25 to "/oracle/oradata/iss/iss_data016.dbf";
set newname for datafile 26 to "/oracle/oradata/iss/iss_data017.dbf";
set newname for datafile 27 to "/oracle/oradata/iss/iss_data018.dbf";
set newname for datafile 28 to "/oracle/oradata/iss/iss_idx001.dbf";
set newname for datafile 29 to "/oracle/oradata/iss/iss_idx002.dbf";
set newname for datafile 30 to "/oracle/oradata/iss/iss_idx003.dbf";
set newname for datafile 31 to "/oracle/oradata/iss/iss_data019.dbf";
set newname for datafile 32 to "/oracle/oradata/iss/iss_data020.dbf";
set newname for datafile 33 to "/oracle/oradata/iss/iss_data021.dbf";
set newname for datafile 34 to "/oracle/oradata/iss/iss_data022.dbf";
set newname for datafile 35 to "/oracle/oradata/iss/iss_data023.dbf";
set newname for datafile 36 to "/oracle/oradata/iss/iss_data024.dbf";
set newname for datafile 37 to "/oracle/oradata/iss/iss_data025.dbf";
set newname for datafile 38 to "/oracle/oradata/iss/iss_data026.dbf";
set newname for datafile 39 to "/oracle/oradata/iss/iss_data027.dbf";
set newname for datafile 40 to "/oracle/oradata/iss/iss_data028.dbf";
set newname for datafile 41 to "/oracle/oradata/iss/iss_data029.dbf";
set newname for datafile 42 to "/oracle/oradata/iss/iss_data030.dbf";
set newname for datafile 43 to "/oracle/oradata/iss/iss_data031.dbf";
set newname for datafile 44 to "/oracle/oradata/iss/iss_data032.dbf";
set newname for datafile 45 to "/oracle/oradata/iss/iss_data033.dbf";
set newname for datafile 46 to "/oracle/oradata/iss/iss_data034.dbf";
set newname for datafile 47 to "/oracle/oradata/iss/iss_data035.dbf";
set newname for datafile 48 to "/oracle/oradata/iss/iss_data036.dbf";
set newname for datafile 49 to "/oracle/oradata/iss/iss_idx004.dbf";
set newname for datafile 50 to "/oracle/oradata/iss/iss_idx005.dbf";
set newname for datafile 51 to "/oracle/oradata/iss/iss_idx006.dbf";
set newname for datafile 52 to "/oracle/oradata/iss/iss_idx007.dbf";
set newname for datafile 53 to "/oracle/oradata/iss/iss_idx008.dbf";
set newname for datafile 54 to "/oracle/oradata/iss/iss_data037.dbf";
set newname for datafile 55 to "/oracle/oradata/iss/iss_data038.dbf";
set newname for datafile 56 to "/oracle/oradata/iss/iss_data039.dbf";
set newname for datafile 57 to "/oracle/oradata/iss/iss_idx009.dbf";
set newname for datafile 58 to "/oracle/oradata/iss/iss_idx010.dbf";
set newname for datafile 59 to "/oracle/oradata/iss/iss_data040.dbf";
set newname for datafile 60 to "/oracle/oradata/iss/iss_idx011.dbf";
set newname for datafile 61 to "/oracle/oradata/iss/iss_idx012.dbf";
set newname for datafile 62 to "/oracle/oradata/iss/iss_idx013.dbf";
set newname for datafile 63 to "/oracle/oradata/iss/iss_idx014.dbf";
set newname for datafile 64 to "/oracle/oradata/iss/iss_idx015.dbf";
set newname for datafile 65 to "/oracle/oradata/iss/iss_data041.dbf";
set newname for datafile 66 to "/oracle/oradata/iss/iss_data042.dbf";
set newname for datafile 67 to "/oracle/oradata/iss/iss_data043.dbf";
set newname for datafile 68 to "/oracle/oradata/iss/iss_data044.dbf";
set newname for datafile 69 to "/oracle/oradata/iss/iss_data045.dbf";
set newname for datafile 70 to "/oracle/oradata/iss/iss_data046.dbf";
set newname for datafile 71 to "/oracle/oradata/iss/iss_data047.dbf";
set newname for datafile 72 to "/oracle/oradata/iss/iss_data048.dbf";
set newname for datafile 73 to "/oracle/oradata/iss/iss_data049.dbf";
set newname for datafile 74 to "/oracle/oradata/iss/iss_data050.dbf";
set newname for datafile 75 to "/oracle/oradata/iss/iss_data051.dbf";
set newname for datafile 76 to "/oracle/oradata/iss/iss_data052.dbf";
restore database;
switch datafile all;
switch tempfile all;
recover database;
}

日志:

[root@issdb ~]# su - oracle
[oracle@issdb ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jan 7 15:41:47 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ISS (DBID=2637015137, not open)
RMAN> run {
set newname for datafile 1 to "/oracle/oradata/iss/system001.dbf";
set newname for datafile 2 to "/oracle/oradata/iss/undotbs1001.dbf";
set newname for datafile 3 to "/oracle/oradata/iss/sysaux001.dbf";
set newname for datafile 4 to "/oracle/oradata/iss/users001.dbf";
set newname for datafile 5 to "/oracle/oradata/iss/undotbs1002.dbf";
set newname for datafile 6 to "/oracle/oradata/iss/undotbs1003.dbf";
set newname for datafile 7 to "/oracle/oradata/iss/undotbs1004.dbf";
set newname for 2> 3> 4> 5> 6> 7> 8> 9> datafile 8 to "/oracle/oradata/iss/undotbs1005.dbf";
set newname for datafile 9 to "/oracle/oradata/iss/undotbs1006.dbf";
set newname for datafile 10 to "/oracle/oradata/iss/iss_data001.dbf";
set newname for datafile 11 to "/oracle/oradata/iss/iss_10> 11> 12> data002.dbf";
set newname for datafile 12 to "/oracle/oradata/iss/iss_data003.dbf";
set newname for datafile 13 to "/oracle/oradata/iss/iss_data004.dbf";
set newname for datafile 14 to "/oracle/oradata/iss/iss_data005.dbf";
set newname for datafile 13> 14> 15> 16> 15 to "/oracle/oradata/iss/iss_data006.dbf";
set newname for datafile 16 to "/oracle/oradata/iss/iss_data007.dbf";
set newname for datafile 17 to "/oracle/oradata/iss/iss_data008.dbf";
set newname for datafile 18 to "/oracle/oradata/iss/iss_data009.17> 18> 19> dbf";
set newname for datafile 19 to "/oracle/oradata/iss/iss_data010.dbf";
set newname for datafile 20 to "/oracle/oradata/iss/iss_data011.dbf";
set newname for datafile 21 to "/oracle/oradata/iss/iss_data012.dbf";
set newname for datafile 22 to "20> 21> 22> 23> /oracle/oradata/iss/iss_data013.dbf";
set newname for datafile 23 to "/oracle/oradata/iss/iss_data014.dbf";
set newname for datafile 24 to "/oracle/oradata/iss/iss_data015.dbf";
set newname for datafile 25 to "/oracle/oradata/iss/iss_data016.dbf";
se24> 25> 26> 27> t newname for datafile 26 to "/oracle/oradata/iss/iss_data017.dbf";
set newname for datafile 27 to "/oracle/oradata/iss/iss_data018.dbf";
set newname for datafile 28 to "/oracle/oradata/iss/iss_idx001.dbf";
set newname for datafile 29 to "/oracle/o28> 29> 30> radata/iss/iss_idx002.dbf";
set newname for datafile 30 to "/oracle/oradata/iss/iss_idx003.dbf";
set newname for datafile 31 to "/oracle/oradata/iss/iss_data019.dbf";
set newname for datafile 32 to "/oracle/oradata/iss/iss_data020.dbf";
set newname f31> 32> 33> 34> or datafile 33 to "/oracle/oradata/iss/iss_data021.dbf";
set newname for datafile 34 to "/oracle/oradata/iss/iss_data022.dbf";
set newname for datafile 35 to "/oracle/oradata/iss/iss_data023.dbf";
set newname for datafile 36 to "/oracle/oradata/iss35> 36> 37> /iss_data024.dbf";
set newname for datafile 37 to "/oracle/oradata/iss/iss_data025.dbf";
set newname for datafile 38 to "/oracle/oradata/iss/iss_data026.dbf";
set newname for datafile 39 to "/oracle/oradata/iss/iss_data027.dbf";
set newname for dataf38> 39> 40> 41> ile 40 to "/oracle/oradata/iss/iss_data028.dbf";
set newname for datafile 41 to "/oracle/oradata/iss/iss_data029.dbf";
set newname for datafile 42 to "/oracle/oradata/iss/iss_data030.dbf";
set newname for datafile 43 to "/oracle/oradata/iss/iss_dat42> 43> 44> a031.dbf";
set newname for datafile 44 to "/oracle/oradata/iss/iss_data032.dbf";
set newname for datafile 45 to "/oracle/oradata/iss/iss_data033.dbf";
set newname for datafile 46 to "/oracle/oradata/iss/iss_data034.dbf";
set newname for datafile 47 45> 46> 47> 48> to "/oracle/oradata/iss/iss_data035.dbf";
set newname for datafile 48 to "/oracle/oradata/iss/iss_data036.dbf";
set newname for datafile 49 to "/oracle/oradata/iss/iss_idx004.dbf";
set newname for datafile 50 to "/oracle/oradata/iss/iss_idx005.dbf";49> 50> 51>
set newname for datafile 51 to "/oracle/oradata/iss/iss_idx006.dbf";
set newname for datafile 52 to "/oracle/oradata/iss/iss_idx007.dbf";
set newname for datafile 53 to "/oracle/oradata/iss/iss_idx008.dbf";
set newname for datafile 54 to "/oracle/52> 53> 54> 55> oradata/iss/iss_data037.dbf";
set newname for datafile 55 to "/oracle/oradata/iss/iss_data038.dbf";
set newname for datafile 56 to "/oracle/oradata/iss/iss_data039.dbf";
set newname for datafile 57 to "/oracle/oradata/iss/iss_idx009.dbf";
set newname56> 57> 58> 59> for datafile 58 to "/oracle/oradata/iss/iss_idx010.dbf";
set newname for datafile 59 to "/oracle/oradata/iss/iss_data040.dbf";
set newname for datafile 60 to "/oracle/oradata/iss/iss_idx011.dbf";
set newname for datafile 61 to "/oracle/oradata/iss60> 61> 62> /iss_idx012.dbf";
set newname for datafile 62 to "/oracle/oradata/iss/iss_idx013.dbf";
set newname for datafile 63 to "/oracle/oradata/iss/iss_idx014.dbf";
set newname for datafile 64 to "/oracle/oradata/iss/iss_idx015.dbf";
set newname for datafile 63> 64> 65> 66> 65 to "/oracle/oradata/iss/iss_data041.dbf";
set newname for datafile 66 to "/oracle/oradata/iss/iss_data042.dbf";
set newname for datafile 67 to "/oracle/oradata/iss/iss_data043.dbf";
set newname for datafile 68 to "/oracle/oradata/iss/iss_data04467> 68> 69> .dbf";
set newname for datafile 69 to "/oracle/oradata/iss/iss_data045.dbf";
set newname for datafile 70 to "/oracle/oradata/iss/iss_data046.dbf";
set newname for datafile 71 to "/oracle/oradata/iss/iss_data047.dbf";
set newname for datafile 72 to 70> 71> 72> 73> "/oracle/oradata/iss/iss_data048.dbf";
set newname for datafile 73 to "/oracle/oradata/iss/iss_data049.dbf";
set newname for datafile 74 to "/oracle/oradata/iss/iss_data050.dbf";
set newname for datafile 75 to "/oracle/oradata/iss/iss_data051.dbf";
s74> 75> 76> 77> et newname for datafile 76 to "/oracle/oradata/iss/iss_data052.dbf";
restore database;
switch datafile all;
}
78> 79> 80>
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 2020/01/07 15:41:54
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=119 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=158 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=197 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=236 device type=DISK
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 /oracle/oradata/iss/system001.dbf
channel ORA_DISK_1: restoring datafile 00006 to /oracle/oradata/iss/undotbs1003.dbf
channel ORA_DISK_1: restoring datafile 00011 to /oracle/oradata/iss/iss_data002.dbf
channel ORA_DISK_1: restoring datafile 00016 to /oracle/oradata/iss/iss_data007.dbf
channel ORA_DISK_1: restoring datafile 00021 to /oracle/oradata/iss/iss_data012.dbf
channel ORA_DISK_1: restoring datafile 00026 to /oracle/oradata/iss/iss_data017.dbf
channel ORA_DISK_1: restoring datafile 00031 to /oracle/oradata/iss/iss_data019.dbf
channel ORA_DISK_1: restoring datafile 00036 to /oracle/oradata/iss/iss_data024.dbf
channel ORA_DISK_1: restoring datafile 00041 to /oracle/oradata/iss/iss_data029.dbf
channel ORA_DISK_1: restoring datafile 00046 to /oracle/oradata/iss/iss_data034.dbf
channel ORA_DISK_1: restoring datafile 00051 to /oracle/oradata/iss/iss_idx006.dbf
channel ORA_DISK_1: restoring datafile 00056 to /oracle/oradata/iss/iss_data039.dbf
channel ORA_DISK_1: restoring datafile 00061 to /oracle/oradata/iss/iss_idx012.dbf
channel ORA_DISK_1: restoring datafile 00066 to /oracle/oradata/iss/iss_data042.dbf
channel ORA_DISK_1: restoring datafile 00073 to /oracle/oradata/iss/iss_data049.dbf
channel ORA_DISK_1: reading from backup piece /data/databk/level0_ISS_01_06_17736_1.bak
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00003 to /oracle/oradata/iss/sysaux001.dbf
channel ORA_DISK_2: restoring datafile 00008 to /oracle/oradata/iss/undotbs1005.dbf
channel ORA_DISK_2: restoring datafile 00013 to /oracle/oradata/iss/iss_data004.dbf
channel ORA_DISK_2: restoring datafile 00018 to /oracle/oradata/iss/iss_data009.dbf
channel ORA_DISK_2: restoring datafile 00023 to /oracle/oradata/iss/iss_data014.dbf
channel ORA_DISK_2: restoring datafile 00028 to /oracle/oradata/iss/iss_idx001.dbf
channel ORA_DISK_2: restoring datafile 00033 to /oracle/oradata/iss/iss_data021.dbf
channel ORA_DISK_2: restoring datafile 00038 to /oracle/oradata/iss/iss_data026.dbf
channel ORA_DISK_2: restoring datafile 00043 to /oracle/oradata/iss/iss_data031.dbf
channel ORA_DISK_2: restoring datafile 00048 to /oracle/oradata/iss/iss_data036.dbf
channel ORA_DISK_2: restoring datafile 00053 to /oracle/oradata/iss/iss_idx008.dbf
channel ORA_DISK_2: restoring datafile 00058 to /oracle/oradata/iss/iss_idx010.dbf
channel ORA_DISK_2: restoring datafile 00063 to /oracle/oradata/iss/iss_idx014.dbf
channel ORA_DISK_2: restoring datafile 00068 to /oracle/oradata/iss/iss_data044.dbf
channel ORA_DISK_2: restoring datafile 00075 to /oracle/oradata/iss/iss_data051.dbf
channel ORA_DISK_2: reading from backup piece /data/databk/level0_ISS_01_06_17738_1.bak
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00004 to /oracle/oradata/iss/users001.dbf
channel ORA_DISK_3: restoring datafile 00010 to /oracle/oradata/iss/iss_data001.dbf
channel ORA_DISK_3: restoring datafile 00015 to /oracle/oradata/iss/iss_data006.dbf
channel ORA_DISK_3: restoring datafile 00020 to /oracle/oradata/iss/iss_data011.dbf
channel ORA_DISK_3: restoring datafile 00025 to /oracle/oradata/iss/iss_data016.dbf
channel ORA_DISK_3: restoring datafile 00030 to /oracle/oradata/iss/iss_idx003.dbf
channel ORA_DISK_3: restoring datafile 00035 to /oracle/oradata/iss/iss_data023.dbf
channel ORA_DISK_3: restoring datafile 00040 to /oracle/oradata/iss/iss_data028.dbf
channel ORA_DISK_3: restoring datafile 00045 to /oracle/oradata/iss/iss_data033.dbf
channel ORA_DISK_3: restoring datafile 00050 to /oracle/oradata/iss/iss_idx005.dbf
channel ORA_DISK_3: restoring datafile 00055 to /oracle/oradata/iss/iss_data038.dbf
channel ORA_DISK_3: restoring datafile 00060 to /oracle/oradata/iss/iss_idx011.dbf
channel ORA_DISK_3: restoring datafile 00065 to /oracle/oradata/iss/iss_data041.dbf
channel ORA_DISK_3: restoring datafile 00069 to /oracle/oradata/iss/iss_data045.dbf
channel ORA_DISK_3: restoring datafile 00072 to /oracle/oradata/iss/iss_data048.dbf
channel ORA_DISK_3: restoring datafile 00076 to /oracle/oradata/iss/iss_data052.dbf
channel ORA_DISK_3: reading from backup piece /data/databk/level0_ISS_01_06_17734_1.bak
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00002 to /oracle/oradata/iss/undotbs1001.dbf
channel ORA_DISK_4: restoring datafile 00007 to /oracle/oradata/iss/undotbs1004.dbf
channel ORA_DISK_4: restoring datafile 00012 to /oracle/oradata/iss/iss_data003.dbf
channel ORA_DISK_4: restoring datafile 00017 to /oracle/oradata/iss/iss_data008.dbf
channel ORA_DISK_4: restoring datafile 00022 to /oracle/oradata/iss/iss_data013.dbf
channel ORA_DISK_4: restoring datafile 00027 to /oracle/oradata/iss/iss_data018.dbf
channel ORA_DISK_4: restoring datafile 00032 to /oracle/oradata/iss/iss_data020.dbf
channel ORA_DISK_4: restoring datafile 00037 to /oracle/oradata/iss/iss_data025.dbf
channel ORA_DISK_4: restoring datafile 00042 to /oracle/oradata/iss/iss_data030.dbf
channel ORA_DISK_4: restoring datafile 00047 to /oracle/oradata/iss/iss_data035.dbf
channel ORA_DISK_4: restoring datafile 00052 to /oracle/oradata/iss/iss_idx007.dbf
channel ORA_DISK_4: restoring datafile 00057 to /oracle/oradata/iss/iss_idx009.dbf
channel ORA_DISK_4: restoring datafile 00062 to /oracle/oradata/iss/iss_idx013.dbf
channel ORA_DISK_4: restoring datafile 00067 to /oracle/oradata/iss/iss_data043.dbf
channel ORA_DISK_4: restoring datafile 00074 to /oracle/oradata/iss/iss_data050.dbf
channel ORA_DISK_4: reading from backup piece /data/databk/level0_ISS_01_06_17737_1.bak
channel ORA_DISK_5: starting datafile backup set restore
channel ORA_DISK_5: specifying datafile(s) to restore from backup set
channel ORA_DISK_5: restoring datafile 00005 to /oracle/oradata/iss/undotbs1002.dbf
channel ORA_DISK_5: restoring datafile 00009 to /oracle/oradata/iss/undotbs1006.dbf
channel ORA_DISK_5: restoring datafile 00014 to /oracle/oradata/iss/iss_data005.dbf
channel ORA_DISK_5: restoring datafile 00019 to /oracle/oradata/iss/iss_data010.dbf
channel ORA_DISK_5: restoring datafile 00024 to /oracle/oradata/iss/iss_data015.dbf
channel ORA_DISK_5: restoring datafile 00029 to /oracle/oradata/iss/iss_idx002.dbf
channel ORA_DISK_5: restoring datafile 00034 to /oracle/oradata/iss/iss_data022.dbf
channel ORA_DISK_5: restoring datafile 00039 to /oracle/oradata/iss/iss_data027.dbf
channel ORA_DISK_5: restoring datafile 00044 to /oracle/oradata/iss/iss_data032.dbf
channel ORA_DISK_5: restoring datafile 00049 to /oracle/oradata/iss/iss_idx004.dbf
channel ORA_DISK_5: restoring datafile 00054 to /oracle/oradata/iss/iss_data037.dbf
channel ORA_DISK_5: restoring datafile 00059 to /oracle/oradata/iss/iss_data040.dbf
channel ORA_DISK_5: restoring datafile 00064 to /oracle/oradata/iss/iss_idx015.dbf
channel ORA_DISK_5: restoring datafile 00070 to /oracle/oradata/iss/iss_data046.dbf
channel ORA_DISK_5: restoring datafile 00071 to /oracle/oradata/iss/iss_data047.dbf
channel ORA_DISK_5: reading from backup piece /data/databk/level0_ISS_01_06_17735_1.bak
channel ORA_DISK_5: piece handle=/data/databk/level0_ISS_01_06_17735_1.bak tag=LEVEL 0
channel ORA_DISK_5: restored backup piece 1
channel ORA_DISK_5: restore complete, elapsed time: 00:37:56
channel ORA_DISK_2: piece handle=/data/databk/level0_ISS_01_06_17738_1.bak tag=LEVEL 0
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:38:46
channel ORA_DISK_1: piece handle=/data/databk/level0_ISS_01_06_17736_1.bak tag=LEVEL 0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:39:16
channel ORA_DISK_4: piece handle=/data/databk/level0_ISS_01_06_17737_1.bak tag=LEVEL 0
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:39:46
channel ORA_DISK_3: piece handle=/data/databk/level0_ISS_01_06_17734_1.bak tag=LEVEL 0
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:42:26
Finished restore at 2020/01/07 16:24:24
datafile 1 switched to datafile copy
input datafile copy RECID=147 STAMP=1029083064 file name=/oracle/oradata/iss/system001.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=148 STAMP=1029083064 file name=/oracle/oradata/iss/undotbs1001.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=149 STAMP=1029083065 file name=/oracle/oradata/iss/sysaux001.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=150 STAMP=1029083065 file name=/oracle/oradata/iss/users001.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=151 STAMP=1029083065 file name=/oracle/oradata/iss/undotbs1002.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=152 STAMP=1029083065 file name=/oracle/oradata/iss/undotbs1003.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=153 STAMP=1029083065 file name=/oracle/oradata/iss/undotbs1004.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=154 STAMP=1029083065 file name=/oracle/oradata/iss/undotbs1005.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=155 STAMP=1029083065 file name=/oracle/oradata/iss/undotbs1006.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=156 STAMP=1029083065 file name=/oracle/oradata/iss/iss_data001.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=157 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data002.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=158 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data003.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=159 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data004.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=160 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data005.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=161 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data006.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=162 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data007.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=163 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data008.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=164 STAMP=1029083066 file name=/oracle/oradata/iss/iss_data009.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=165 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data010.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=166 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data011.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=167 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data012.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=168 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data013.dbf
datafile 23 switched to datafile copy
input datafile copy RECID=169 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data014.dbf
datafile 24 switched to datafile copy
input datafile copy RECID=170 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data015.dbf
datafile 25 switched to datafile copy
input datafile copy RECID=171 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data016.dbf
datafile 26 switched to datafile copy
input datafile copy RECID=172 STAMP=1029083067 file name=/oracle/oradata/iss/iss_data017.dbf
datafile 27 switched to datafile copy
input datafile copy RECID=173 STAMP=1029083068 file name=/oracle/oradata/iss/iss_data018.dbf
datafile 28 switched to datafile copy
input datafile copy RECID=174 STAMP=1029083068 file name=/oracle/oradata/iss/iss_idx001.dbf
datafile 29 switched to datafile copy
input datafile copy RECID=175 STAMP=1029083068 file name=/oracle/oradata/iss/iss_idx002.dbf
datafile 30 switched to datafile copy
input datafile copy RECID=176 STAMP=1029083068 file name=/oracle/oradata/iss/iss_idx003.dbf
datafile 31 switched to datafile copy
input datafile copy RECID=177 STAMP=1029083068 file name=/oracle/oradata/iss/iss_data019.dbf
datafile 32 switched to datafile copy
input datafile copy RECID=178 STAMP=1029083069 file name=/oracle/oradata/iss/iss_data020.dbf
datafile 33 switched to datafile copy
input datafile copy RECID=179 STAMP=1029083069 file name=/oracle/oradata/iss/iss_data021.dbf
datafile 34 switched to datafile copy
input datafile copy RECID=180 STAMP=1029083069 file name=/oracle/oradata/iss/iss_data022.dbf
datafile 35 switched to datafile copy
input datafile copy RECID=181 STAMP=1029083069 file name=/oracle/oradata/iss/iss_data023.dbf
datafile 36 switched to datafile copy
input datafile copy RECID=182 STAMP=1029083069 file name=/oracle/oradata/iss/iss_data024.dbf
datafile 37 switched to datafile copy
input datafile copy RECID=183 STAMP=1029083069 file name=/oracle/oradata/iss/iss_data025.dbf
datafile 38 switched to datafile copy
input datafile copy RECID=184 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data026.dbf
datafile 39 switched to datafile copy
input datafile copy RECID=185 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data027.dbf
datafile 40 switched to datafile copy
input datafile copy RECID=186 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data028.dbf
datafile 41 switched to datafile copy
input datafile copy RECID=187 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data029.dbf
datafile 42 switched to datafile copy
input datafile copy RECID=188 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data030.dbf
datafile 43 switched to datafile copy
input datafile copy RECID=189 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data031.dbf
datafile 44 switched to datafile copy
input datafile copy RECID=190 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data032.dbf
datafile 45 switched to datafile copy
input datafile copy RECID=191 STAMP=1029083070 file name=/oracle/oradata/iss/iss_data033.dbf
datafile 46 switched to datafile copy
input datafile copy RECID=192 STAMP=1029083071 file name=/oracle/oradata/iss/iss_data034.dbf
datafile 47 switched to datafile copy
input datafile copy RECID=193 STAMP=1029083071 file name=/oracle/oradata/iss/iss_data035.dbf
datafile 48 switched to datafile copy
input datafile copy RECID=194 STAMP=1029083071 file name=/oracle/oradata/iss/iss_data036.dbf
datafile 49 switched to datafile copy
input datafile copy RECID=195 STAMP=1029083071 file name=/oracle/oradata/iss/iss_idx004.dbf
datafile 50 switched to datafile copy
input datafile copy RECID=196 STAMP=1029083071 file name=/oracle/oradata/iss/iss_idx005.dbf
datafile 51 switched to datafile copy
input datafile copy RECID=197 STAMP=1029083071 file name=/oracle/oradata/iss/iss_idx006.dbf
datafile 52 switched to datafile copy
input datafile copy RECID=198 STAMP=1029083071 file name=/oracle/oradata/iss/iss_idx007.dbf
datafile 53 switched to datafile copy
input datafile copy RECID=199 STAMP=1029083071 file name=/oracle/oradata/iss/iss_idx008.dbf
datafile 54 switched to datafile copy
input datafile copy RECID=200 STAMP=1029083071 file name=/oracle/oradata/iss/iss_data037.dbf
datafile 55 switched to datafile copy
input datafile copy RECID=201 STAMP=1029083071 file name=/oracle/oradata/iss/iss_data038.dbf
datafile 56 switched to datafile copy
input datafile copy RECID=202 STAMP=1029083072 file name=/oracle/oradata/iss/iss_data039.dbf
datafile 57 switched to datafile copy
input datafile copy RECID=203 STAMP=1029083072 file name=/oracle/oradata/iss/iss_idx009.dbf
datafile 58 switched to datafile copy
input datafile copy RECID=204 STAMP=1029083072 file name=/oracle/oradata/iss/iss_idx010.dbf
datafile 59 switched to datafile copy
input datafile copy RECID=205 STAMP=1029083072 file name=/oracle/oradata/iss/iss_data040.dbf
datafile 60 switched to datafile copy
input datafile copy RECID=206 STAMP=1029083072 file name=/oracle/oradata/iss/iss_idx011.dbf
datafile 61 switched to datafile copy
input datafile copy RECID=207 STAMP=1029083072 file name=/oracle/oradata/iss/iss_idx012.dbf
datafile 62 switched to datafile copy
input datafile copy RECID=208 STAMP=1029083072 file name=/oracle/oradata/iss/iss_idx013.dbf
datafile 63 switched to datafile copy
input datafile copy RECID=209 STAMP=1029083072 file name=/oracle/oradata/iss/iss_idx014.dbf
datafile 64 switched to datafile copy
input datafile copy RECID=210 STAMP=1029083073 file name=/oracle/oradata/iss/iss_idx015.dbf
datafile 65 switched to datafile copy
input datafile copy RECID=211 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data041.dbf
datafile 66 switched to datafile copy
input datafile copy RECID=212 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data042.dbf
datafile 67 switched to datafile copy
input datafile copy RECID=213 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data043.dbf
datafile 68 switched to datafile copy
input datafile copy RECID=214 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data044.dbf
datafile 69 switched to datafile copy
input datafile copy RECID=215 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data045.dbf
datafile 70 switched to datafile copy
input datafile copy RECID=216 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data046.dbf
datafile 71 switched to datafile copy
input datafile copy RECID=217 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data047.dbf
datafile 72 switched to datafile copy
input datafile copy RECID=218 STAMP=1029083073 file name=/oracle/oradata/iss/iss_data048.dbf
datafile 73 switched to datafile copy
input datafile copy RECID=219 STAMP=1029083074 file name=/oracle/oradata/iss/iss_data049.dbf
datafile 74 switched to datafile copy
input datafile copy RECID=220 STAMP=1029083074 file name=/oracle/oradata/iss/iss_data050.dbf
datafile 75 switched to datafile copy
input datafile copy RECID=221 STAMP=1029083074 file name=/oracle/oradata/iss/iss_data051.dbf
datafile 76 switched to datafile copy
input datafile copy RECID=222 STAMP=1029083074 file name=/oracle/oradata/iss/iss_data052.dbf
#### 1.3.2.5 创建spfile
RMAN> alter database open resetlogs upgrade;
SQL> create spfile from pfile='/data/bak/pfile.ora';

升级模式启动数据库命令:startup upgrade

1.3.2.6 重建REDO

select group#,status from v$log;
select t.group#,t.MEMBER from v$logfile t;
SELECT ('alter database rename file '''|| t.member ||''' to ''/oracle/oradata/iss/redo'||
​ t.group# || chr(96+rk) ||'.dbf'';') cmd,t.group#,t.member FROM (
select a.members,
​ a.thread#,
​ a.status,
​ a.bytes / 1024 / 1024 MB,
​ b.type,
​ b.member,
​ b.group#,
​ rank() over(partition by b.group# order by b.member) rk
from v$log a, v$logfile b
where a.group# = b.group#) t
order by t.group#,t.member;
alter database rename file '/dev/raw/raw7' to '/oracle/oradata/iss/redo1a.dbf';
alter database rename file '/dev/raw/raw8' to '/oracle/oradata/iss/redo1b.dbf';
alter database rename file '/dev/raw/raw10' to '/oracle/oradata/iss/redo2a.dbf';
alter database rename file '/dev/raw/raw9' to '/oracle/oradata/iss/redo2b.dbf';
alter database rename file '/dev/raw/raw11' to '/oracle/oradata/iss/redo3a.dbf';
alter database rename file '/dev/raw/raw12' to '/oracle/oradata/iss/redo3b.dbf';
alter database rename file '/dev/raw/raw13' to '/oracle/oradata/iss/redo4a.dbf';
alter database rename file '/dev/raw/raw14' to '/oracle/oradata/iss/redo4b.dbf';
alter database clear logfile group 4;

1.3.2.7 重建TEMP表空间

还原后,所有的temp表空间都需要重新创建,通过查询就能发现,其对应的文件路径还是老环境下的路径。

命令:

select file#, ts# ,name ,status from v$tempfile;

根据查询,确定目前有多少个临时表空间,这里只有一个。将其删除,重建。数据库的默认临时表空间是不然删除的。所以,如果只有一个表空间,就需要一个临时顶替的临时表空间。

命令:

#创建新的tempfile:

CREATE TEMPORARY TABLESPACE temp2 TEMPFILE '+data/orcl/datafile/TEMP2.DBF' SIZE 200m AUTOEXTEND ON ;

#将新的temp表空间设置为默认表空间:

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

#删除原默认temp 表空间:

drop tablespace temp;

#重新创建原temp表空间:

CREATE TEMPORARY TABLESPACE temp TEMPFILE '+data/orcl/datafile/TEMP01.DBF' SIZE 1G REUSE AUTOEXTEND ON NEXT 200M MAXSIZE 30G;

#将数据库默认temp表空间设置为原表空间:

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

#删除刚刚创建的temp2 临时表空间:

DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;
SQL> SELECT a.NAME,a.STATUS FROM v$tempfile a;
SELECT ('alter database rename file '''|| t.file_name ||''' to ''/oracle/oradata/iss/'||
​ lower(tablespace_name) ||
​ LPAD(RK, 3, '0') ||'.dbf'';') cmd,t.file_id,t.file_name,t.TABLESPACE_NAME FROM(
select d.*,
​ rank() over(partition by d.TABLESPACE_NAME order by d.FILE_ID) rk
from DBA_TEMP_FILES d) t
order by t.file_id;

1.3.2.8 创建UNDO2

SQL> create undo tablespace UNDOTBS2 datafile '/oracle/oradata/iss/undotbs2001.dbf' size 1G AUTOEXTEND ON next 200M;
ALTER tablespace UNDOTBS2 ADD datafile '/oracle/oradata/iss/undotbs2002.dbf' size 1G AUTOEXTEND ON next 200M;
ALTER tablespace UNDOTBS2 ADD datafile '/oracle/oradata/iss/undotbs2003.dbf' size 1G AUTOEXTEND ON next 200M;
ALTER tablespace UNDOTBS2 ADD datafile '/oracle/oradata/iss/undotbs2004.dbf' size 1G AUTOEXTEND ON next 200M;
ALTER tablespace UNDOTBS2 ADD datafile '/oracle/oradata/iss/undotbs2005.dbf' size 1G AUTOEXTEND ON next 200M;
ALTER tablespace UNDOTBS2 ADD datafile '/oracle/oradata/iss/undotbs2006.dbf' size 1G AUTOEXTEND ON next 200M;
SQL> select file_name,tablespace_name,online_status from dba_data_files where tablespace_name like '%UNDO%';
SQL> show parameter undo;
SQL> alter system set undo_management='AUTO' scope=spfile;
SQL> alter system set undo_tablespace=UNDOTBS2;

1.3.2.9 版本升级执行

如果系统版本存在升级,需要根据readme.html中的要求执行脚本。如果存在新的补丁的,执行补丁对应的SQL脚本。执行升级脚本(如果不存在版本升级,不需要执行)

SQL> select count(1) from registry$database;
SQL> select * from registry$database;
SQL> delete from registry$database;

若不存在registry$database表,则手工创建:

SQL> CREATE TABLE registry$database
​ (platform_id NUMBER, platform_name VARCHAR2(101),
​ edition VARCHAR2(30), tz_version NUMBER);
并做insert 操作:
SQL> INSERT into registry$database
​ (platform_id, platform_name, edition, tz_version)
​ VALUES ((select platform_id from v$database),
​ (select platform_name from v$database),
​ NULL,
​ (select version from v$timezone_file));
SQL> @?/rdbms/admin/catupgrd.sql

1.3.2.10 重新编译数据库

重新编译PLSQL代码块,并重新编译无效对象,注意不是utlrp脚本,而是使用utlirp。

命令:

@?/rdbms/admin/utlirp.sql
@?/rdbms/admin/utlrp.sql

1.3.2.11 重启数据库

SQL> shutdown immediate
SQL> startup

Oracle部署迁移手册的更多相关文章

  1. Oracle数据库迁移到AWS云的方案

    当前云已经成为常态,越来越多的企业希望使用云来增加基础设施的弹性.减轻基础设施的维护压力,运维的成本等.很多企业使用云碰到的难题之一是如何将现有的应用迁移到云上,将现有应用的中间件系统.Web系统及其 ...

  2. Oracle JDK迁移指南

    Oracle JDK迁移指南 https://docs.oracle.com/en/java/javase/11/migrate/index.html#JSMIG-GUID-C25E2B1D-6C24 ...

  3. Oracle 服务器迁移的一些经验

    前言 通过此文章来分享一下 Oracle 服务器迁移过程中的一些经验,希望对大家有些许帮助. 本文旨在帮助更多的同学,会提及一些基本命令或技巧,但不赘述,后续有机会再进一步分享各个细节. 背景 之前因 ...

  4. 将Oracle数据库迁移到达梦数据库

    公司某产品在项目现场上常用到的数据库有Oracle和达梦. 做性能测试需要根据项目现场预埋大量的基础数据和业务数据,耗费时间.精力.故完成Oracle数据库的性能测试之后,采用直接将Oracle数据库 ...

  5. SQL SERVER 2008向ORACLE 11G迁移示例

    来源于:http://www.cnblogs.com/hiizsk/ 由SQL SERVER 2008向ORACLE 11G迁移过程记录之一-表 使用Oracle Sql Developer将SQL ...

  6. oracle 表迁移方法 (二) 约束不失效

    DB:11.2.0.3.0 在oracle 表迁移方法 (一)中,只是move了一张普通的表,如果表的字段带有主键约束呢 ? [oracle@db01 ~]$ sqlplus / as sysdba ...

  7. 经历:asp.net oracle 部署问题以及解决方法

    原文:[原创]经历:asp.net oracle 部署问题以及解决方法 精简的美丽...... 一.环境    开发环境        win7 64bit         Vs2010       ...

  8. ORACLE日常操作手册

    转发自:http://blog.csdn.net/lichangzai/article/details/7955766 以前为开发人员编写的oracle基础操作手册,都基本的oracle操作和SQL语 ...

  9. Oracle数据迁移至HBase操作记录

    Oracle数据迁移至HBase操作记录 @(HBase) 近期需要把Oracle数据库中的十几张表T级别的数据迁移至HBase中,过程中遇到了许多苦难和疑惑,在此记录一下希望能帮到一些有同样需求的兄 ...

随机推荐

  1. echatrts 各参数快速了解(+实例)

    实例:https://www.jianshu.com/p/8cac22daca98 参数详解:https://echarts.baidu.com/option.html#title.textStyle ...

  2. Qt简单的解析Json数据例子(一)

    要解析的json的格式为: { "rootpath": "001", "usernum": 111, "childdep" ...

  3. java中jre\bin目录和jdk\bin目录下的工具功能介绍

    转自:https://blog.csdn.net/eclipse_yin/article/details/51051096 jre/bin目录下面工具说明 javac:Java编译器,将Java源代码 ...

  4. 详细解读go语言中的map

    Map map底层是由哈希表实现的 Go使用链地址法来解决键冲突. map本质上是一个指针,指向hmap 这里的buckets就是桶,bmap 每一个bucket最多可以放8个键值对,但是为了让内存排 ...

  5. sql函数大全

    sql函数大全 一.内部函数 1.内部合计函数 1)COUNT(*) 返回行数 2)COUNT(DISTINCT COLNAME) 返回指定列中唯一值的个数 3)SUM(COLNAME/EXPRESS ...

  6. 性能环境之docker操作指南4(全网最全)

    容器的常用操作 docker run -i -t  /bin/bash 使用image创建container并进入交互模式, login shell是/bin/bash 实例: $ docker ru ...

  7. Django——Ajax发送请求验证用户名是否被注册

    场景: 用户注册的时候,输入用户名之后,Ajax发送请求到后端,后端验证该用户名是否已经被注册,然后返回到注册页面提示用户. 1.模型: from django.db import models cl ...

  8. Dockerfile自动化制作镜像

    1.创建Dockerfile文件:vim Dockerfile 2.Dockerfile的编写内容如下: 3.开始制作镜像 制作命令: docker build -t 镜像名:版本号 4.查看已经做好 ...

  9. Django项目从创建到运行

    环境: Windows Server 2008 R2 标准版 1.安装python运行环境(省略) 2.安装Django pip install Django==3.1.5 # 不写版本号也可以 3. ...

  10. Git 系列教程(13)- 分支管理

    查看分支列表 $ git branch iss53 * master testing  注意 master 分支前的 * 字符:它代表现在 checkout 的那一个分支(也就是说,当前 HEAD 指 ...