搜索词: 加节点,add node
原系统基本情况: Linux AS3.0 2.4.21-4.ELsmp Oracle 9.2.0.4
注意: 以下步骤需要停机作业 。
1、 安装新节点的HBA卡等硬件。 由于是3节点,所有如果原来使用反线连接作为心跳线,现在需要使用一台HUB或交换机来连接3台节点机器。
2、 安装节点的操作系统,与已经运行的节点一致,比如Linux AS3.0 2.4.21-4.ELsmp .
3、 配置系统参数和ORACLE的安装环境。
安装Oracle软件之前的准备和安装单机时候一样,这里略过 。
确认节点1,2,3 时间一样,最好使用时间同步服务器同步。
拷贝节点1,2的.bash_profile 环境设置,修改其中的SID部分。
备份节点1,2的以下两个文件。
修改节点1,2,3的/etc/hosts文件及/etc/hosts.equiv 文件
/etc/hosts 內容如下:
10.156.4.98 dmdii-node1
172.20.1.148 dmdii-node1
10.1.1.7 dmdii-pri1
10.156.4.99 dmdii-node2
172.20.1.149 dmdii-node2
10.1.1.8 dmdii-pri2
10.156.4.103 dmdii-node3
172.20.1.147 dmdii-node3
10.1.1.9 dmdii-pri3
/etc/hosts.equiv 內容如下:
dmdii-node1 oracle
dmdii-node2 oracle
dmdii-node3 oracle
dmdii-pri1 oracle
dmdii-pri2 oracle
dmdii-pri3 oracle
4、 从运行节点的机器上把$ORACLE_HOME、$ORACLE_BASE、/etc/ora*复制到新安装机器上
对应的目录,要同源地址一致。下面注意点只是做一些解释,如果你是按照上面方式拷贝的Oracle软体,就不需要下面的这些步骤 。
注意: 最好是拷贝运行节点上的oracle相关目录。 如果单独在新节点上安装Oracle , 会安装不了Real Application Cluster 组件,而且lib, bin 等oracle目录下会有很多比如gsd, gsdctl , libxxx.so 等文件不会安装进去。最后还是需要拷贝oracle相关目录下的文件覆盖 。
没有安装RAC组件,后面开启新节点的时候会报错 ORA-00439: feature not enabled: Real Application Clusters,需要如下设置才能enable RAC :
RAC ON
1). Login as the Oracle software owner and shutdown all database instances on all nodes in the cluster.
2). cd $ORACLE_HOME/rdbms/lib
3). make -f ins_rdbms.mk rac_on
If this step did not fail with fatal errors then proceed to step 4.
4). make -f ins_rdbms.mk ioracle
5、 运行新装节点的$ORACLE_HOME下的root.sh。
6, 修改所有机器$ORACLE_HOME/oracm/admin下RAC配置。
备份节点1,2上的OCM配置文件 $ORACLE_HOME/oracm/admin/cmcfg.ora 。
开始配置节点1,2,3上的OCM配置文件,$ORACLE_HOME/oracm/admin/cmcfg.ora
节点1,2,3 类似如下,只是HostName不一样而已。注意检查所有节点:
dmdii-node1$cat cmcfg.ora
HeartBeat=15000
ClusterName=Oracle Cluster Manager, version 9i
PollInterval=1000
MissCount=210
PrivateNodeNames=dmdii-pri1 dmdii-pri2 dmdii-pri3
PublicNodeNames=dmdii-node1 dmdii-node2 dmdii-node3
ServicePort=9998
CmDiskFile=/ocfs_data/quorum.dbf
HostName=dmdii-pri1
KernelModuleName=hangcheck-timer
所有节点cmcfg.ora文件配置完成后,重新启动,开启各个节点的oracm测试(注意 su root) , ps -ef| grep oracm 查看进程。
7, 确认当前数据库的MAXINSTANCES大于等于您新加机器后的节点数,否则需重建控制文
件(但一般都够,默认好像32 ),所以这一步不用修改。
8, 备份节点1,2的listener.ora ,tnsnames.ora 。然后开始修改节点1,2,3的
listener.ora ,tnsnames.ora 。
范例如下:
dmdii-node1$cat tnsnames.ora
LISTENERS_INTEL =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node2)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node3)(PORT = 1521))
)
LISTENER_INTEL1 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node1)(PORT = 1521))
)
INTEL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node2)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = INTEL)
)
)
INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
INTEL1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node1)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = INTEL)
(INSTANCE_NAME = INTEL1)
)
)
INTEL2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node2)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = INTEL)
(INSTANCE_NAME = INTEL2)
)
)
INTEL3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dmdii-node3)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = INTEL)
(INSTANCE_NAME = INTEL3)
)
)
dmdii-node1$cat listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.1.148)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.156.4.98)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/product/oracle)
(PROGRAM = extproc)
)
(SID_DESC =
(ORACLE_HOME = /u01/product/oracle)
(SID_NAME = intel1)
)
)
9, 在节点3 上执行命令初始化共享文件
#su – oracle
$srvconfig -init
开启GSD, $gsdctl start
10, 配置节点1,2,3的 spfile参数文件。
范例如下:
*.background_dump_dest='/u01/product/admin/intel/bdump'
*.cluster_database_instances=3
*.cluster_database=true
*.compatible='9.2.0.0.0'
*.control_files='/ocfs_ctrl_redo/intel/control01.ctl','/ocfs_ctrl_redo/intel/control02.ctl','/ocfs_ctrl_redo/intel/control03.ctl'
*.core_dump_dest='/u01/product/admin/intel/cdump'
*.cursor_sharing='EXACT'
*.db_block_size=8192
*.db_cache_size=1073741824
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_files=1000
*.db_name='intel'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=intelXDB)'
*.fast_start_mttr_target=300
*.hash_join_enabled=TRUE
intel1.instance_name='intel1'
intel2.instance_name='intel2'
intel3.instance_name='intel3'
intel1.instance_number=1
intel2.instance_number=2
intel3.instance_number=3
*.java_pool_size=31457280
*.job_queue_processes=36
*.large_pool_size=20971520
intel1.local_listener='LISTENER_INTEL1'
intel2.local_listener='LISTENER_INTEL2'
intel3.local_listener='LISTENER_INTEL3'
intel1.log_archive_dest_1='LOCATION=/ocfs_arch1/intel/'
intel2.log_archive_dest_1='LOCATION=/ocfs_arch2/intel/'
intel3.log_archive_dest_1='LOCATION=/ocfs_arch2/intel/'
*.log_archive_format='%t_%s.dbf'
*.log_archive_start=true
*.open_cursors=4000
*.optimizer_index_cost_adj=30
*.optimizer_mode='rule'
*.pga_aggregate_target=314572800
*.processes=1015
*.query_rewrite_enabled='FALSE'
intel1.remote_listener='LISTENERS_INTEL'
intel2.remote_listener='LISTENERS_INTEL'
intel3.remote_listener='LISTENERS_INTEL'
*.remote_login_passwordfile='exclusive'
*.resource_limit=TRUE
*.service_names='intel'
*.session_cached_cursors=20
*.shared_pool_size=419430400
*.sort_area_size=2097152
*.star_transformation_enabled='FALSE'
intel1.thread=1
intel2.thread=2
intel3.thread=3
*.timed_statistics=TRUE
*.trace_enabled=false
*.undo_management='AUTO'
*.undo_retention=10800
intel1.undo_tablespace='UNDOTBS1'
intel2.undo_tablespace='UNDOTBS2'
intel3.undo_tablespace='UNDOTBS3'
*.user_dump_dest='/u01/product/admin/intel/udump'
11、在数据库中添加新的redo logfile 及undo :
开启节点1的实例到mount状态,在节点1上为节点3建立redo log及undo tbs :
SQL> startup mount
SQL> ALTER DATABASE ADD LOGFILE THREAD 3
GROUP 9 ('/ocfs_ctrl_redo/intel/redo09.log', '/ocfs_data/intel/redo09b.log') size 100m,
GROUP 10 ('/ocfs_ctrl_redo/intel/redo10.log', '/ocfs_data/intel/redo10b.log') size 100m,
GROUP 11 ('/ocfs_ctrl_redo/intel/redo11.log', '/ocfs_data/intel/redo11b.log') size 100m,
GROUP 12 ('/ocfs_ctrl_redo/intel/redo12.log', '/ocfs_data/intel/redo12b.log') size 100m ;
SQL> alter database open ;
SQL> alter database enable public thread 3 ;
SQL> create undo tablespace undotbs3 datafile ‘/ocfs_data/intel/undotbs03_1.dbf’ size 2048064K ;
13、确认新节点的环境变量(ORACLE_HOME、ORACLE_SID等),确认spfile修改OK ,且节点3的online redo 及undo加入OK,以及节点3实例的实例目录及密码文件,各个目录权限等都OK . 开始开启各个节点的 oracm ,gsdctl, 如果密码文件有问题,重建新节点的密码文件,开启数据库,监听。
14、 可以通过srvctl的配置增加对新节点的管理。具体查看srvctl帮助,例:srvctl -h srvctl config -h
15, 验证RAC:
SQL> select THREAD#,STATUS,ENABLED from gv$thread ;
THREAD# STATUS ENABLED
1 OPEN PUBLIC
2 OPEN PUBLIC
3 OPEN PUBLIC
1 OPEN PUBLIC
2 OPEN PUBLIC
3 OPEN PUBLIC
1 OPEN PUBLIC
2 OPEN PUBLIC
3 OPEN PUBLIC
SQL> select INSTANCE_NUMBER,STATUS,HOST_NAME from gv$instance ;
INSTANCE_NUMBER STATUS HOST_NAME
1 OPEN dmdii-node1
2 OPEN dmdii-node2
3 OPEN dmdii-node3
$lsnodes 查看是否监测到多个节点。
$ lsnrctl status 查看cluster状态。客户端单独连接测试。
添加更多的实例方法相同。
如果还有问题,可以参考Oracle文档
http://download.oracle.com/docs/cd/B10501_01/rac.920/a96596/addmig.htm
或者参考 metalink.oracle.com
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-586720/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/35489/viewspace-586720/