标签归档:RAC

Oracle 11gR2 RAC配置DNS解析SCAN IP

Oracle 11g RAC集群中引入了SCAN(Single Client Access Name)的概念,也就是指集群的单客户端访问名称。SCAN这个特性为客户端提供了单一的主机名,用于访问集群中运行的Oracle数据库。如果您在集群中添加或删除节点,使用SCAN的客户端无需更改自己的TNS配置,无论集群包含哪些节点,SCAN资源及其关联的IP地址提供了一个稳定的名称供客户端进行连接使用。在Oracle 11g Grid安装时即要求为该特性配置DNS解析方式或GNS解析方式,本文描述了安装Oracle 11g Grid时的DNS配置。

关于配置DNS之前的几点说明:
#配置DNS可以使用单独的DNS服务器,也可以直接使用RAC的一个节点来提供DNS解析;
#直接使用某个节点时,容易出现该节点如果宕机将导致SCAN无法解析,客户端无法连接数据库;
#本文仅作演示,使用节点1的Public IP用作DNS Server,不考虑上面描述的情形以及DNS安全性等。
#本文使用DNS将SCAN解析为三个IP地址,分别为:
192.0.2.111
192.0.2.112
192.0.2.113
#DNS的守护进程
/usr/sbin/named   
/usr/sbin/rndc
#DNS的脚本
/etc/init.d/named
#DNS的端口
53 953(tcp udp) 
#DNS的配置文件
/var/named/chroot/etc/named.conf(主配置文件)  
/var/named/chroot/*

1.安装环境
[root@rac1 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)
Kernel \r on an \m
[root@rac2 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)
Kernel \r on an \m

2.主机节点host信息
[root@rac1 ~]# 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

##Public Network
192.0.2.101 rac1.oracle.com rac1   #该地址作为DNS服务器地址
192.0.2.102 rac2.oracle.com rac2
##Public Virtual IP(VIP) addresses
192.0.2.103 rac1-vip.oracle.com rac1-vip
192.0.2.104 rac2-vip.oracle.com rac2-vip
##Private Interconnect
192.168.0.101 rac1-priv.oracle.com rac1-priv
192.168.0.102 rac2-priv.oracle.com rac2-priv

[root@rac2 ~]# 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

##Public Network
192.0.2.101 rac1.oracle.com rac1
192.0.2.102 rac2.oracle.com rac2
##Public Virtual IP(VIP) addresses
192.0.2.103 rac1-vip.oracle.com rac1-vip
192.0.2.104 rac2-vip.oracle.com rac2-vip
##Private Interconnect
192.168.0.101 rac1-priv.oracle.com rac1-priv
192.168.0.102 rac2-priv.oracle.com rac2-priv

3.安装DNS Server(节点1操作)
rpm -ivh bind-9.3.6-16.P1.el5.i386.rpm
rpm -ivh bind-chroot-9.3.6-16.P1.el5.i386.rpm
rpm -ivh caching-nameserver-9.3.6-16.P1.el5.i386.rpm

4.配置DNS Server
关于DNS的配置,分为以下几个步骤:
#a.配置named.conf文件
#b.配置zone文件,包括正向和反向zone文件
#c.配置解析文件resolv.conf
#d.启动DNS服务
#e.验证DNS

a.配置named.conf文件(节点1操作)
[root@rac1 ~]# cd /var/named/chroot/etc/
[root@rac1 etc]# ls -l
total 20
-rw-r–r– 1 root root   405 Apr 12 23:22 localtime
-rw-r—– 1 root named 1230 Sep  3  2009 named.caching-nameserver.conf
-rw-r—– 1 root named 1190 Apr 16 01:21 named.rfc1912.zones
-rw-r—– 1 root named  113 Apr 16 00:22 rndc.key

[root@rac1 etc]# cp -p named.caching-nameserver.conf named.conf #修改named.conf文件,将源文件中的所有localhost以及127.0.0.1修改成any,注意any;前后保留空格
#该文件主要是配置dns监听那些端口以及ip地址并指明相应的名字解析zone文件名named.zones
#下面是修改后的named.conf文件
[root@rac1 etc]# more named.conf 
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver 
// (as a localhost DNS resolver only). 
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE – use system-config-bind or an editor
// to create named.conf – edits to this file will be lost on 
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { ::1; };
        directory       “/var/named”;
        dump-file       “/var/named/data/cache_dump.db”;
        statistics-file “/var/named/data/named_stats.txt”;
        memstatistics-file “/var/named/data/named_mem_stats.txt”;

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     { any; };
        allow-query-cache { any; };
};
logging {
        channel default_debug {
                file “data/named.run”;
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { any; };
        match-destinations { any; };
        recursion yes;
        include “/etc/named.rfc1912.zones”;
};

b.配置正向解析和反向解析zone(节点1操作)
[root@rac1 etc]# more named.rfc1912.zones 
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package 
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// 
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone “.” IN {
        type hint;
        file “named.ca”;
};

zone “localdomain” IN {
        type master;
        file “localdomain.zone”;
        allow-update { none; };
};

zone “localhost” IN {
        type master;
        file “localhost.zone”;
        allow-update { none; };
};

zone “0.0.127.in-addr.arpa” IN {
        type master;
        file “named.local”;
        allow-update { none; };
};

zone “0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa” IN
 {
        type master;
        file “named.ip6.local”;
        allow-update { none; };
};

zone “255.in-addr.arpa” IN {
        type master;
        file “named.broadcast”;
        allow-update { none; };
};

zone “0.in-addr.arpa” IN {
        type master;
        file “named.zero”;
        allow-update { none; };
};

zone “oracle.com” IN {
        type master;
        file “oracle.com.zone”;
        allow-update { none; };
};

zone “2.0.192.in-addr.arpa” IN {
        type master;
        file “oracle.com.local”;
        allow-update { none; };
};

# 这里需要注意的是,反向解析从左到右读取IP地址时是以相反的方向解析的,所以需要将IP地址反向排列。这里,192.0.2.*网段的反向解析域名为2.0.192.in-addr.arpa

#利用模板文件创建用于正向解析和反向解析数据库文件(节点1操作)
[root@rac1 ~]# cd /var/named/chroot/var/named
[root@rac1 named]# ls -l
total 44
drwxrwx— 2 named named 4096 Apr 16 01:10 data
-rw-r—– 1 root  named  198 Sep  3  2009 localdomain.zone
-rw-r—– 1 root  named  195 Sep  3  2009 localhost.zone
-rw-r—– 1 root  named  427 Sep  3  2009 named.broadcast
-rw-r—– 1 root  named 1892 Sep  3  2009 named.ca
-rw-r—– 1 root  named  424 Sep  3  2009 named.ip6.local
-rw-r—– 1 root  named  426 Sep  3  2009 named.local
-rw-r—– 1 root  named  427 Sep  3  2009 named.zero
drwxrwx— 2 named named 4096 Jul 27  2004 slaves

[root@rac1 named]# cp -p named.local oracle.com.local
[root@rac1 named]# cp -p named.zero oracle.com.zone 
#下面是修改之后的正向搜索文件,可以将host文件的其他ip对照编辑到正向搜索文件以实现解析
#下面的例子将SCAN IP的参照关系也添加到解析文件
[root@rac1 named]# cat oracle.com.zone 
$TTL    86400
@       IN SOA  oracle.com.     root.oracle.com. (
                                42               ; serial (d. adams)
                                3H               ; refresh
                                15M              ; retry
                                1W               ; expiry
                                1D )             ; minimum

        IN NS           oracle.com.
scan    IN A            192.0.2.111
scan    IN A            192.0.2.112
scan    IN A            192.0.2.113

#创建反向解析数据库文件
[root@rac1 named]# cat oracle.com.local 
$TTL    86400
@       IN      SOA     oracle.com.   root.oracle.com. (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      oracle.com.
111     IN      PTR     scan.oracle.com.
112     IN      PTR     scan.oracle.com.
113     IN      PTR     scan.oracle.com.
#无论RAC有多少节点SCAN VIP的个数只能有3个
#数字写IP地址的最后一个,如192.0.2.111就写111

c.配置解析文件resolv.conf(所有节点)
[root@rac1 ~]# more /etc/resolv.conf 
search oracle.com
nameserver 192.0.2.101
[root@rac2 ~]# cat /etc/resolv.conf 
search oracle.com
nameserver 192.0.2.101

d.启动DNS Server
[root@rac1 ~]# service named restart
Stopping named:[  OK ]
Starting named:[  OK ]

e.验证DNS配置(所有节点操作)
[root@rac1 ~]# nslookup 192.0.2.111
Server:         192.0.2.101
Address:        192.0.2.101#53

111.2.0.192.in-addr.arpa        name = scan.oracle.com.

[root@rac1 ~]# nslookup 192.0.2.112
Server:         192.0.2.101
Address:        192.0.2.101#53

112.2.0.192.in-addr.arpa        name = scan.oracle.com.

[root@rac1 ~]# nslookup 192.0.2.113
Server:         192.0.2.101
Address:        192.0.2.101#53

113.2.0.192.in-addr.arpa        name = scan.oracle.com.

[root@rac2 ~]# nslookup scan
Server:         192.0.2.101
Address:        192.0.2.101#53

Name:   scan.oracle.com
Address: 192.0.2.111
Name:   scan.oracle.com
Address: 192.0.2.112
Name:   scan.oracle.com
Address: 192.0.2.113

[root@rac2 ~]# nslookup 192.0.2.111
Server:         192.0.2.101
Address:        192.0.2.101#53

111.2.0.192.in-addr.arpa        name = scan.oracle.com.

[root@rac2 ~]# nslookup 192.0.2.112
Server:         192.0.2.101
Address:        192.0.2.101#53

112.2.0.192.in-addr.arpa        name = scan.oracle.com.

[root@rac2 ~]# nslookup 192.0.2.113
Server:         192.0.2.101
Address:        192.0.2.101#53

113.2.0.192.in-addr.arpa        name = scan.oracle.com.

到此DNS配置完成,SCAN IP正反向解析均成功。不过这里DNS采用RAC中的一个节点作为Server,这在生产环境下是不合理的,需要注意。

Oracle 10g RAC修改数据库名与实例名

生产数据库系统在某些情况下[数据库名与业务系统名匹配],可能需要修改数据库和实例名,该篇将详细演示,如何修改RAC数据库及实例名。
###原数据库及实例名
db_name: test
instance_name1: tets1
instance_name2: test2
###修改后数据库及实例名
db_name: k13test
instance_name1: k13tets1
instance_name2: k13test2

---查看原集群数据库和实例名运行状态
[oracle@k1rac3 ~]$ crs_stat.sh
Name                                Target     State      Host      
----------------------------------- ---------- ---------  -------   
ora.k1rac1.LISTENER_K1RAC1.lsnr     ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                      ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr     ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                      ONLINE     ONLINE     k1rac3    
ora.test.p1p2.cs                    ONLINE     ONLINE     k1rac3    
ora.test.p1p2.test1.srv             ONLINE     ONLINE     k1rac1    
ora.test.p1p2.test2.srv             ONLINE     ONLINE     k1rac3    
ora.test.db                         ONLINE     ONLINE     k1rac3    
ora.test.test1.inst                 ONLINE     ONLINE     k1rac1    
ora.test.test2.inst                 ONLINE     ONLINE     k1rac3    

---查看集群数据库实例spfile文件位置
SQL> show parameter spfile
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /home/db/oracle/oradata/spfile

---创建集群数据库实例pfile文件
SQL> create pfile='/tmp/pfiletest.ora' from spfile;
 
File created.

---停止集群数据库和实例
[oracle@k1rac3 ~]$ srvctl stop database -d test
[oracle@k1rac3 ~]$ crs_stat.sh
Name                                Target     State      Host      
----------------------------------- ---------- ---------  -------   
ora.k1rac1.LISTENER_K1RAC1.lsnr     ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                      ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr     ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                      ONLINE     ONLINE     k1rac3    
ora.test.p1p2.cs                    OFFLINE    OFFLINE              
ora.test.p1p2.test1.srv             OFFLINE    OFFLINE              
ora.test.p1p2.test2.srv             OFFLINE    OFFLINE              
ora.test.db                         OFFLINE    OFFLINE              
ora.test.test1.inst                 OFFLINE    OFFLINE              
ora.test.test2.inst                 OFFLINE    OFFLINE              

---将新创建的集群数据库实例pfile文件中cluster_database参数值修改为flase
[oracle@k1rac1 ~]$ cat /tmp/pfiletest.ora
test1.__db_cache_size=80815849472
test2.__db_cache_size=82376130560
test1.__java_pool_size=117440512
test2.__java_pool_size=117440512
test1.__large_pool_size=33554432
test2.__large_pool_size=33554432
test1.__shared_pool_size=4764729344
test2.__shared_pool_size=3321888768
test1.__streams_pool_size=150994944
test2.__streams_pool_size=33554432
*.audit_file_dest='/home/db/oracle/admin/test/adump'
*.background_dump_dest='/home/db/oracle/admin/test/bdump'
*.cluster_database_instances=2
*.compatible='10.2.0.5.0'
*.control_files='/home/db/oracle/oradata/control1.ctl','/home/db/oracle/oradata/control2.ctl','/home/db/oracle/oradata/control3.ctl'
*.cluster_database=flase
*.core_dump_dest='/home/db/oracle/admin/test/cdump'
*.db_block_size=32768
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
test1.instance_number=1
test2.instance_number=2
*.job_queue_processes=10
test1.local_listener='LISTENER_K1RAC1'
test2.local_listener='LISTENER_K1RAC3'
*.open_cursors=300
*.parallel_max_servers=256
*.parallel_min_servers=0
*.pga_aggregate_target=21474836480
*.processes=1000
*.remote_listener='LISTENERS_p1p2'
*.remote_login_passwordfile='exclusive'
*.service_names='p1p2'
*.sessions=1100
*.sga_max_size=85899345920
*.sga_target=85899345920
test1.thread=1
test2.thread=2
*.undo_management='AUTO'
test1.undo_tablespace='UNDOTBS1'
test2.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/home/db/oracle/admin/test/udump'
*.utl_file_dir='/home/db/oracle/logmnr'

---使用修改后的pfile参数文件以单一方式启动集群数据库到mount状态
[oracle@k1rac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Dec 19 11:52:22 2014

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount pfile='/tmp/pfiletest.ora'
ORACLE instance started.

Total System Global Area 8.5899E+10 bytes
Fixed Size                  2230024 bytes
Variable Size            5066733816 bytes
Database Buffers         8.0816E+10 bytes
Redo Buffers               14532608 bytes
Database mounted.

---使用nid工具将原集群数据库名test修改为k13test
[oracle@k1rac1 ~]$ nid

DBNEWID: Release 10.2.0.5.0 - Production on Fri Dec 19 11:53:40 2014

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Keyword     Description                    (Default)
----------------------------------------------------
TARGET      Username/Password              (NONE)
DBNAME      New database name              (NONE)
LOGFILE     Output Log                     (NONE)
REVERT      Revert failed change           NO
SETNAME     Set a new database name only   NO
APPEND      Append to output log           NO
HELP        Displays these messages        NO

[oracle@k1rac1 ~]$ nid TARGET=sys/manager DBNAME=k13test setname=y

DBNEWID: Release 10.2.0.5.0 - Production on Fri Dec 19 11:57:29 2014

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to database TEST (DBID=2141888172)

Connected to server version 10.2.0

Control Files in database:
    /home/db/oracle/oradata/control1.ctl
    /home/db/oracle/oradata/control2.ctl
    /home/db/oracle/oradata/control3.ctl

Change database name of database TEST to K13TEST? (Y/[N]) => y

Proceeding with operation
Changing database name from TEST to K13TEST
    Control File /home/db/oracle/oradata/control1.ctl - modified
    Control File /home/db/oracle/oradata/control2.ctl - modified
    Control File /home/db/oracle/oradata/control3.ctl - modified
    Datafile /home/db/oracle/oradata/system01.dbf - wrote new name
    Datafile /home/db/oracle/oradata/undotbs01.dbf - wrote new name
    Datafile /home/db/oracle/oradata/sysaux01.dbf - wrote new name
    Datafile /home/db/oracle/oradata/undotbs02.dbf - wrote new name
    Datafile /home/db/oracle/oradata/users01.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata028.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata029.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata030.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata031.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata032.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata033.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata034.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata035.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata036.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata037.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata038.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata039.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata040.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata041.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata042.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata043.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata044.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata045.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata046.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata047.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata048.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata049.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata050.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata051.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata052.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata053.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata054.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata055.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata056.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata057.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata058.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata059.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata060.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata061.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata062.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata068.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata063.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata064.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata065.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata066.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata067.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata069.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata070.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata071.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata072.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata073.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata074.dbf - wrote new name
    Datafile /home/db/oracle/oradata/userdata075.dbf - wrote new name
    Datafile /home/db/oracle/oradata/undotbs03.dbf - wrote new name
    Datafile /home/db/oracle/oradata/undotbs04.dbf - wrote new name
    Datafile /home/db/oracle/oradata/undotbs06.dbf - wrote new name
    Datafile /home/db/oracle/oradata/undotbs05.dbf - wrote new name
    Datafile /home/db/oracle/oradata/temp01.dbf - wrote new name
    Datafile /home/db/oracle/oradata/temp02.dbf - wrote new name
    Datafile /home/db/oracle/oradata/temp03.dbf - wrote new name
    Control File /home/db/oracle/oradata/control1.ctl - wrote new name
    Control File /home/db/oracle/oradata/control2.ctl - wrote new name
    Control File /home/db/oracle/oradata/control3.ctl - wrote new name
    Instance shut down

Database name changed to K13TEST.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.

---使用nid工具修改完数据库名后会自动将数据库shutdown
[oracle@k1rac1 ~]$ ps -ef|grep smon
oracle    9005 12698  0 11:58 pts/0    00:00:00 grep smon

---将创建的集群数据库实例pfile文件中test1全局替换成k13test1,test2全局替换成k13test2,test全局替换成k13test
[oracle@k1rac1 ~]$ cat /tmp/pfiletest.ora 
k13test1.__db_cache_size=80815849472
k13test2.__db_cache_size=82376130560
k13test1.__java_pool_size=117440512
k13test2.__java_pool_size=117440512
k13test1.__large_pool_size=33554432
k13test2.__large_pool_size=33554432
k13test1.__shared_pool_size=4764729344
k13test2.__shared_pool_size=3321888768
k13test1.__streams_pool_size=150994944
k13test2.__streams_pool_size=33554432
*.audit_file_dest='/home/db/oracle/admin/k13test/adump'
*.background_dump_dest='/home/db/oracle/admin/k13test/bdump'
*.cluster_database_instances=2
*.compatible='10.2.0.5.0'
*.control_files='/home/db/oracle/oradata/control1.ctl','/home/db/oracle/oradata/control2.ctl','/home/db/oracle/oradata/control3.ctl'
*.cluster_database=true
*.core_dump_dest='/home/db/oracle/admin/k13test/cdump'
*.db_block_size=32768
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='k13test'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
k13test1.instance_number=1
k13test2.instance_number=2
*.job_queue_processes=10
k13test1.local_listener='LISTENER_K1RAC1'
k13test2.local_listener='LISTENER_K1RAC3'
*.open_cursors=300
*.parallel_max_servers=256
*.parallel_min_servers=0
*.pga_aggregate_target=21474836480
*.processes=1000
*.remote_listener='LISTENERS_p1p2'
*.remote_login_passwordfile='exclusive'
*.service_names='p1p2'
*.sessions=1100
*.sga_max_size=85899345920
*.sga_target=85899345920
k13test1.thread=1
k13test2.thread=2
*.undo_management='AUTO'
k13test1.undo_tablespace='UNDOTBS1'
k13test2.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/home/db/oracle/admin/k13test/udump'
*.utl_file_dir='/home/db/oracle/logmnr'

---两节点分别修改原集群数据库实例dump上层目录名
[oracle@k1rac1 ~]$ cd /home/db/oracle/admin
[oracle@k1rac1 admin]$ mv test k13test
[oracle@k1rac3 ~]$ cd /home/db/oracle/admin
[oracle@k1rac3 admin]$ mv test k13test

---两节点分别修改原集群数据库实例密码文件和参数文件名
[oracle@k1rac1 ~]$ cd $ORACLE_HOME/dbs
[oracle@k1rac1 dbs]$ more inittest1.ora 
SPFILE='/home/db/oracle/oradata/spfile'
[oracle@k1rac1 dbs]$ mv inittest1.ora initk13test1.ora
[oracle@k1rac1 dbs]$ mv orapwtest1 orapwk13test1
[oracle@k1rac3 ~]$ cd $ORACLE_HOME/dbs
[oracle@k1rac3 dbs]$ more inittest2.ora 
SPFILE='/home/db/oracle/oradata/spfile'
[oracle@k1rac3 dbs]$ mv inittest2.ora initk13test2.ora
[oracle@k1rac3 dbs]$ mv orapwtest2 orapwk13test2

---更新集群数据库spfile文件
[oracle@k1rac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Dec 19 12:00:29 2014

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> create SPFILE='/home/db/oracle/oradata/spfile' from pfile='/tmp/pfiletest.ora';

File created.

---将原数据库及实例从集群中移除
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                Target     State      Host      
----------------------------------- ---------- ---------  -------   
ora.k1rac1.LISTENER_K1RAC1.lsnr     ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                      ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr     ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                      ONLINE     ONLINE     k1rac3    
ora.test.p1p2.cs                    OFFLINE    OFFLINE              
ora.test.p1p2.test1.srv             OFFLINE    OFFLINE              
ora.test.p1p2.test2.srv             OFFLINE    OFFLINE              
ora.test.db                         OFFLINE    OFFLINE              
ora.test.test1.inst                 OFFLINE    OFFLINE              
ora.test.test2.inst                 OFFLINE    OFFLINE              
[oracle@k1rac1 ~]$ srvctl remove database -d test
Remove the database test? (y/[n]) y
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                Target     State      Host      
----------------------------------- ---------- ---------  -------   
ora.k1rac1.LISTENER_K1RAC1.lsnr     ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                      ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr     ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                      ONLINE     ONLINE     k1rac3    

---重新将修改完名数据库及实例添加到集群
[oracle@k1rac1 ~]$ srvctl add database -d k13test -o $ORACLE_HOME
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                Target     State      Host      
----------------------------------- ---------- ---------  -------   
ora.k13test.db                      OFFLINE    OFFLINE              
ora.k1rac1.LISTENER_K1RAC1.lsnr     ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                      ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                      ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr     ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                      ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                      ONLINE     ONLINE     k1rac3    
[oracle@k1rac1 ~]$ srvctl add instance -d k13test -i k13test1 -n k1rac1
[oracle@k1rac1 ~]$ srvctl add instance -d k13test -i k13test2 -n k1rac3

------查看集群中数据库及实例状态
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                   Target     State      Host      
-----------------------------------    ---------- ---------  -------   
ora.k13test.db                         OFFLINE    OFFLINE              
ora.k13test.k13test1.inst              OFFLINE    OFFLINE              
ora.k13test.k13test2.inst              OFFLINE    OFFLINE              
ora.k1rac1.LISTENER_K1RAC1.lsnr        ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                         ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr        ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                         ONLINE     ONLINE     k1rac3

---启动集群数据库
[oracle@k1rac1 ~]$ srvctl start database -d k13test
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                   Target     State      Host      
-----------------------------------    ---------- ---------  -------   
ora.k13test.db                         ONLINE     ONLINE     k1rac3    
ora.k13test.k13test1.inst              ONLINE     ONLINE     k1rac1    
ora.k13test.k13test2.inst              ONLINE     ONLINE     k1rac3    
ora.k1rac1.LISTENER_K1RAC1.lsnr        ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                         ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr        ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                         ONLINE     ONLINE     k1rac3    

---添加相应的Service服务
[oracle@k1rac1 ~]$ srvctl add service -d k13test -s p1p2 -r k13test1,k13test2 -P PRECONNECT
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                   Target     State      Host      
-----------------------------------    ---------- ---------  -------   
ora.k1rac1.LISTENER_K1RAC1.lsnr        ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                         ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr        ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                         ONLINE     ONLINE     k1rac3    
ora.k13test.p1p2.cs                    OFFLINE    OFFLINE              
ora.k13test.p1p2.k13test1.srv          OFFLINE    OFFLINE              
ora.k13test.p1p2.k13test2.srv          OFFLINE    OFFLINE              
ora.k13test.db                         ONLINE     ONLINE     k1rac3    
ora.k13test.test1.inst                 ONLINE     ONLINE     k1rac1    
ora.k13test.test2.inst                 ONLINE     ONLINE     k1rac3    

---启动新添加的服务并查看集群状态
[oracle@k1rac1 ~]$ srvctl start service -d k13test
[oracle@k1rac1 ~]$ crs_stat.sh
Name                                   Target     State      Host      
-----------------------------------    ---------- ---------  -------   
ora.k1rac1.LISTENER_K1RAC1.lsnr        ONLINE     ONLINE     k1rac1    
ora.k1rac1.gsd                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.ons                         ONLINE     ONLINE     k1rac1    
ora.k1rac1.vip                         ONLINE     ONLINE     k1rac1    
ora.k1rac3.LISTENER_K1RAC3.lsnr        ONLINE     ONLINE     k1rac3    
ora.k1rac3.gsd                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.ons                         ONLINE     ONLINE     k1rac3    
ora.k1rac3.vip                         ONLINE     ONLINE     k1rac3    
ora.k13test.p1p2.cs                    ONLINE     ONLINE     k1rac3    
ora.k13test.p1p2.k13test1.srv          ONLINE     ONLINE     k1rac1    
ora.k13test.p1p2.k13test2.srv          ONLINE     ONLINE     k1rac3    
ora.k13test.db                         ONLINE     ONLINE     k1rac3    
ora.k13test.test1.inst                 ONLINE     ONLINE     k1rac1    
ora.k13test.test2.inst                 ONLINE     ONLINE     k1rac3    

---最后再更新listener.ora及tnsnames.ora文件信息