操作系统版本: RHEL 6.5 x64
1. 源数据库服务器Oracle版本: Oracle 11g 11.2.0.4 64位(单机)
Oracle_SID: orcl
db_name : orcl
背景:一台生产oracle10g(10.2.0.5)数据库计划迁移到Oracle 11.2.0.4.0 RAC.
1) 先oracle10g(10.2.0.5)升级到Oracle 11.2.0.4(过程略)
2)再Oracle 11.2.0.4单实例迁移到Oracle 11.2.0.4 RAC集群
操作系统:RHEL 6.8 x64 安装注意点:
Oracle版本: Oracle 11g 11.2.0.4 RAC 64位
Oracle_SID: orcl1 / orcl2
db_name : orcl
说明:
1)RAC与单实例的数据库名一致,不需要重新创建一个实例或恢复一个实例,这也是需要提前考虑的内容。
2)可以直接在RAC原实例上做恢复处理,可以减少一些操作步骤,例如参数文件、口令文件等可以利用原RAC配置即可,无需要修改。
源服务器通过执行 RMAN备份,需要执行异机RAC恢复操作。
2. 备份源数据库备份脚本内容
#!/bin/bash
# ScriptName:rmanbakup.sh
# Usage: backup all files in oracle user environment.
# Author: koumm
# Creation: 2017-09-16
# Version: 1.0.0
#Define variable <You may need to change the value of basedir.>
basedir=/u01/orabak
date=`date +%Y%m%d`
#Create pfile
sqlplus / as sysdba <<EOF
create pfile='$basedir/pfile$date.ora' from spfile;
EOF
#RMAN BACKUP
rman target / log=$basedir/backup_all_$date.log <<EOF
run{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup database filesperset 4 format '$basedir/full_%d_%T_%s_%p';
sql 'alter system archive log current';
sql 'alter system archive log current';
sql 'alter system archive log current';
sql 'alter system archive log current';
backup archivelog all format '$basedir/arch_%d_%T_%s_%p' delete input;
backup current controlfile format '$basedir/ctl_%d_%T_%s_%p';
release channel c1;
release channel c2;
}
EOF
[oracle@ora11g orabak]$ ll -h
total 1.4G
-rw-r----- 1 oracle oinstall 16M Sep 16 08:29 arch_ORCL_20170916_5_1
-rw-r----- 1 oracle oinstall 3.5K Sep 16 08:29 arch_ORCL_20170916_6_1
-rw-r----- 1 oracle oinstall 2.5K Sep 16 08:29 arch_ORCL_20170916_7_1
-rw-r--r-- 1 oracle oinstall 4.8K Sep 16 08:29 backup_all_20170916.log
-rw-r----- 1 oracle oinstall 9.4M Sep 16 08:29 ctl_ORCL_20170916_8_1
-rw-r----- 1 oracle oinstall 707M Sep 16 08:29 full_ORCL_20170916_1_1
-rw-r----- 1 oracle oinstall 642M Sep 16 08:28 full_ORCL_20170916_2_1
-rw-r----- 1 oracle oinstall 9.4M Sep 16 08:28 full_ORCL_20170916_3_1
-rw-r----- 1 oracle oinstall 96K Sep 16 08:28 full_ORCL_20170916_4_1
-rw-r--r-- 1 oracle oinstall 1.1K Sep 16 08:28 pfile20170916.ora
[oracle@ora11g orabak]$
[root@ora11g u01]# scp -r /u01/orabak 192.168.0.135:/u01/
root@192.168.0.135's password:
full_ORCL_20170916_2_1 100% 641MB 106.9MB/s 00:06
full_ORCL_20170916_1_1 100% 707MB 88.3MB/s 00:08
ctl_ORCL_20170916_8_1 100% 9568KB 9.3MB/s 00:00
arch_ORCL_20170916_7_1 100% 2560 2.5KB/s 00:00
pfile20170916.ora 100% 1053 1.0KB/s 00:00
full_ORCL_20170916_3_1 100% 9568KB 9.3MB/s 00:00
full_ORCL_20170916_4_1 100% 96KB 96.0KB/s 00:00
arch_ORCL_20170916_5_1 100% 16MB 15.7MB/s 00:00
arch_ORCL_20170916_6_1 100% 3584 3.5KB/s 00:00
backup_all_20170916.log 100% 4851 4.7KB/s 00:00
[root@db1 ~]# su - grid
[root@db1 ~]$ sqlplus / as sysasm
col name for a10
col state for a10
select group_number , name , state, type, total_mb, free_mb from v$asm_diskgroup ;
SQL> select group_number , name , state, type, total_mb, free_mb from v$asm_diskgroup ;