Oracle DataBase单实例迁移到Oracle RAC

Oracle DataBase单实例迁移到Oracle RAC步骤

--------------------------------------分割线 --------------------------------------

VMware+Linux+Oracle 10G RAC全程详细图解

CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

Oracle 11gR2 在VMWare虚拟机中安装步骤

--------------------------------------分割线 --------------------------------------

迁移前单实例环境介绍:

数据库版本:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production

数据库物理结构:

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace          RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    440      SYSTEM              ***    /u01/app/oracle/oradata/orcl/system01.dbf
2    25      UNDOTBS1            ***    /u01/app/oracle/oradata/orcl/undotbs01.dbf
3    250      SYSAUX              ***    /u01/app/oracle/oradata/orcl/sysaux01.dbf
4    5        USERS                ***    /u01/app/oracle/oradata/orcl/users01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace          Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20      TEMP                32767      /u01/app/oracle/oradata/orcl/temp01.dbf

RMAN>

主机环境

[oracle@rac1 admin]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1      localhost.localdomain localhost
::1            localhost6.localdomain6 localhost6


192.168.2.101  rac1.localdomain  rac1
192.168.2.102  rac2.localdomain  rac2
192.168.0.101  rac1-priv.localdomain rac1-priv
192.168.0.102  rac2-priv.localdomain rac2-priv
192.168.2.103  rac1-vip.localdomain  rac1-vip
192.168.2.104  rac2-vip.localdomain  rac2-vip

[oracle@rac1 admin]$

================================================================================


1. 单节点数据库备份

注:单节点数据库的备份已经传送到/u02目录下,直接执行下面的解压即可。

[oracle@rac1 u02]$ cd /u02
[oracle@rac1 u02]$ tar zxvf backup_db.orcl.tar.gz
backup_db/
backup_db/ORCL_24_798936483_1_full_arch.bus
backup_db/ORCL_25_798936484_1_full_ctl.bus
backup_db/ORCL_26_798936485_1_full_spfile.bus
backup_db/ORCL_22_798936465_1_full_db.bus
backup_db/initorcl.ora
backup_db/ORCL_20_798936465_1_full_db.bus
backup_db/ORCL_21_798936465_1_full_db.bus
backup_db/ORCL_23_798936466_1_full_db.bus
backup_db/ORCL_19_798936465_1_full_arch.bus
[oracle@rac1 u02]$


-------------------------------------------------------------------------

mkdir -p /u02/backup_db/
chown oracle:dba /u02/backup_db/
chmod 770 /u02/backup_db/

rman target /

run{
allocate channel d1 type disk maxpiecesize=10G;
allocate channel d2 type disk maxpiecesize=10G;
allocate channel d3 type disk maxpiecesize=10G;
backup tag 'full_db_bk' filesperset 10
as compressed backupset database force noexclude
format '/u02/backup_db/%d_%s_%t_%p_full_db.bus'
plus archivelog delete all input
format '/u02/backup_db/%d_%s_%t_%p_full_arch.bus';

backup  current controlfile tag 'full_db_cntl' format '/u02/backup_db/%d_%s_%t_%p_full_ctl.bus';
backup  spfile tag 'full_db_spfile' format '/u02/backup_db/%d_%s_%t_%p_full_spfile.bus';

release channel d1;
release channel d2;
release channel d3;
}


SQL> create pfile from spfile;


[oracle@ocm18 dbs]$ cat initorcl.ora
orcl.__db_cache_size=432013312
orcl.__java_pool_size=8388608
orcl.__large_pool_size=4194304
orcl.__shared_pool_size=159383552
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.background_dump_dest='/u01/app/oracle/admin/orcl/bdump'
*.compatible='10.2.0.5.0'
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/orcl/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='orcl'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=10
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=201326592
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=605028352
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/orcl/udump'
[oracle@ocm18 dbs]$

2. RAC环境建立


在两个节点操作:
cd $ORACLE_BASE/admin
mkdir orcl
cd orcl/
mkdir -p adump  bdump  cdump  dpdump  hdump  pfile  scripts  udump


在节点1 操作:
[oracle@rac1 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac1 dbs]$ orapwd file=orapworcl1 password=oracle
[oracle@rac1 dbs]$

在节点2 操作:
[oracle@rac2 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac2 dbs]$ orapwd file=orapworcl2 password=oracle
[oracle@rac2 dbs]$


3. 修改初始化参数文件


[oracle@rac1 ~]$ cp /u02/backup_db/initorcl.ora  $ORACLE_HOME/dbs/initorcl1.ora

[oracle@rac1 dbs]$ vi $ORACLE_HOME/dbs/initorcl1.ora

添加:

*.cluster_database = TRUE
*.cluster_database_instances = 2
*.undo_management=AUTO
orcl1.undo_tablespace=UNDOTBS1
orcl1.instance_name=orcl1
orcl1.instance_number=1
orcl1.thread=1
orcl1.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.72.101)(PORT=1521))'
orcl2.instance_name=orcl2
orcl2.instance_number=2
orcl2.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.72.102)(PORT=1521))'
orcl2.thread=2
orcl2.undo_tablespace=UNDOTBS2
orcl2.cluster_database = TRUE
orcl2.cluster_database_instances = 2

添加的参数可以参照下面的文档:

*.cluster_database = TRUE
*.cluster_database_instances = 2
*.undo_management=AUTO
<SID1>.undo_tablespace=undotbs (undo tablespace which already exists)
<SID1>.instance_name=<SID1>
<SID1>.instance_number=1
<SID1>.thread=1
<SID1>.local_listener=<LISTENERNAME>_<HOSTNAME1>
<SID2>.instance_name=<SID2>
<SID2>.instance_number=2
<SID2>.local_listener=<LISTENERNAME>_<HOSTNAME2>
<SID2>.thread=2
<SID2>.undo_tablespace=UNDOTBS2
<SID2>.cluster_database = TRUE
<SID2>.cluster_database_instances = 2

<SID1> is equal to "<db_name>1". <SID2> is equal to "<db_name>2", e.g. ORCL1, ORCL2.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7590481f361b3cdf684cf4da1a3a99e3.html