1.首先关闭数据库的所的服务
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Sep 6 16:27:19 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@node1 ~]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 06-SEP-2012 16:29:10
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
The command completed successfully
[oracle@node1 ~]$ emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://node1:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped. [oracle@node1 ~]$ ps -ef | grep orcl
oracle 15125 14303 0 16:30 pts/2 00:00:00 grep orcl
[oracle@node1 ~]$ isqlplusctl stop
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
getnameinfo failed
Stopping iSQL*Plus ...
iSQL*Plus stopped.
2.对数据库做个冷备份。
[oracle@node1 orcl]$ mkdir /u01/backup_set
[oracle@node1 orcl]$ cp /u01/app/oracle/oradata/orcl/* /u01/backup_set
[oracle@node1 dbs]$ pwd
/u01/app/oracle/product/10201/dbs
[oracle@node1 dbs]$ cp initorcl.ora /u01/backup_set/
[oracle@node1 dbs]$ cp spfileorcl.ora /u01/backup_set/
3.重新布署第二个节点,以及安装clusterware和oracle software.
参考我在itpub的文章
http://jolly10.itpub.net/post/7268/460356
During the "Install Oracle Database 10g Software with Real Application Clusters", make sure that you select a new Oracle home other than the one from which the single-instance database was running in case the single-instance database is running on one of the systems. Upgrade the RAC RDBMS software to the same version as the original single-instance database.
在安装softeware时选择一个新的ORACLE_HOME,以区别之前single database。
(我在试验时,安装完CRS后,第一个节点的GRS启动不了,试了很多方法都失败,最后只能重新安装了新的RAC,不过没有建立database。此文档记录如何将单进程的database移至另外两台rac的环境中。)
4.新的RAC环境搭建好后,需要手工建立ASM实例和listner.
如何手工建立ASM实例 :
http://blog.csdn.net/jolly10/article/details/7975452
listner可以通过netca创建。
ASM实例和listner配置完后的状态:
[oracle@node1 parameter]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE node1
ora....E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora....SM2.asm application ONLINE ONLINE node2
ora....E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
5.创建ASM磁盘组
可以参考:
RAC环境下增加asm group
[oracle@node1 single_db]$ echo $ORACLE_SID
+ASM1
[oracle@node1 single_db]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 14 10:38:01 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 DATA MOUNTED 2038
2 FLASH_RECOVERY_AREA MOUNTED 2038