Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6636156
  • 博文数量: 915
  • 博客积分: 17977
  • 博客等级: 上将
  • 技术积分: 8846
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-26 09:59
个人简介

一个好老好老的老程序员了。

文章分类

全部博文(915)

文章存档

2022年(9)

2021年(13)

2020年(10)

2019年(40)

2018年(88)

2017年(130)

2015年(5)

2014年(12)

2013年(41)

2012年(36)

2011年(272)

2010年(1)

2009年(53)

2008年(65)

2007年(47)

2006年(81)

2005年(12)

分类:

2006-04-14 10:49:48

6,接下来就进入到安装界面,可以看到Oracle安装到了所有节点



同样,安装后期会提示用户在所有节点上以root身份运行脚本root.sh,这时在RAC1运行是还要进行VIP配置。


/u01/app/oracle/product/10.1.0.3/oracle/root.sh

Running Oracle10 root.sh script...


The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /u01/app/oracle/product/10.1.0.3/oracle


Enter the full pathname of the local bin directory: [/usr/local/bin]:

Creating /usr/local/bin directory...

Copying dbhome to /usr/local/bin ...

Copying oraenv to /usr/local/bin ...

Copying coraenv to /usr/local/bin ...


Adding entry to /var/opt/oracle/oratab file...

Entries will be added to the /var/opt/oracle/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

此时Oracle安装程序会进行VIP配置,需要选择网络接口和各个节点的虚拟地址








配置完成后会出现显示整个配置的结果:




同时需要在另一个节点RAC2上运行root.sh


/u01/app/oracle/product/10.1.0.3/oracle/root.sh

Running Oracle10 root.sh script...


The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /u01/app/oracle/product/10.1.0.3/oracle


Enter the full pathname of the local bin directory: [/usr/local/bin]:

Creating /usr/local/bin directory...

Copying dbhome to /usr/local/bin ...

Copying oraenv to /usr/local/bin ...

Copying coraenv to /usr/local/bin ...


Creating /var/opt/oracle/oratab file...

Adding entry to /var/opt/oracle/oratab file...

Entries will be added to the /var/opt/oracle/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.



CRS resources are already configured

以上步骤完成后,整个Oracle 10g的安装就完成了。





下面我们还需要进行Oracle网络服务的配置,具体步骤如下:


netca

Oracle Net Services Configuration:

1, 在网络服务配置时选择”Cluster configuration”,如下图所示:



2,选中需要进行配置的节点,这里选中RAC1RAC2






3,以后的配置可以按照缺省项一步步进行,最后直到配置成功完成。


1,在创建数据库之前,我们还需要添加一个Oracle的补丁4186426,这个补丁解决了启动Oracle实例时会失败的错误,用户可以从上得到这一补丁,需要注意的是安装这个补丁时要按照它提供的步骤进行,这里不做详述.



在所有节点上创建数据库


1,由于创建oracle数据库需要多个raw devices,这里为了方便起见,将这些raw devices的设备文件连接成更易懂的文件名,同时需要设置相应的属主和权限,具体步骤如下:

cd ORACLE

mkdir db

chown oracle:root db

cd db

ls

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s0 system

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s1 sysaux

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s3 undotbs1

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s4 undotbs2

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s5 temp

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s0 example

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s1 users

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s3 redo1_1

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s4 redo1_2

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s5 redo2_1

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s6 redo2_2

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s7 spfile

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C802d0s3 control1

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C802d0s4 control2

ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C802d0s5 pwdfile

pwd

/ORACLE/db

chown -RL oracle:dba *

chmod -R 660 *



将以上的目录做为创建数据库所需raw devices的配置文件,具体步骤为:


mkdir -p /u01/app/oracle/oradata/tree


并在此目录下创建文件tree_raw.conf,具体内容如下:


cat tree_raw.conf

system=/ORACLE/db/system

sysaux=/ORACLE/db/sysaux

example=/ORACLE/db/example

users=/ORACLE/db/users

temp=/ORACLE/db/temp

undotbs1=/ORACLE/db/undotbs1

undotbs2=/ORACLE/db/undotbs2

redo1_1=/ORACLE/db/redo1_1

redo1_2=/ORACLE/db/redo1_2

redo2_1=/ORACLE/db/redo2_1

redo2_2=/ORACLE/db/redo2_2

control1=/ORACLE/db/control1

control2=/ORACLE/db/control2

spfile=/ORACLE/db/spfile

pwdfile=/ORACLE/db/pwdfile


然后编辑文件/export/home/oracle/.profile,将以下几列加入

DBCA_RAW_CONFIG=/u01/app/oracle/oradata/tree/tree_raw.conf

export DBCA_RAW_CONFIG


2,在各节点上分别设置环境变量

RAC1,

ORACLE_SID=tree1

export ORACLE_SID

RAC2,

ORACLE_SID=tree2

export ORACLE_SID


3,和安装Oracle数据库一样,需要将节点RAC1RAC2上的另一个CPU离线,可参照安装Oracle数据库一节中的步骤来做。


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

oracle用户来创建一个Cluster数据库,具体步骤如下:

dbca


创建数据库步骤:


1,选择数据库的类型,这里需要选择创建Oracle Real Application Clusters database



然后选择创建一个数据库并随后在节点选择时选中两个节点RAC1RAC2.


4,在选择模板时,这里选择创建”General Purpose”的数据库。


5,随后按照提示输入全局数据库的名字,这里设定名字为”tree”




6,在随后的数据库管理选项中选取Oracle Enterprise Manager Grid Control,即不选中”Configure the Database with Enterprise Manage”的选项




以后的步骤中需要设定密码,设定存储和恢复机制以及数据库内容和服务,这里按照缺省值设定即可。



随后要设置数据库的初始参数,在此,根据机器的内存大小,设定SGA800MPGA 200M,用户可根据具体的环境来设定相应的大小





接下来需要配置数据库的存储并设置创建数据库的一些选项,所有这些设置完成后,就开始创建数据库,最终顺利建立,见下图:



在此我们还可以来起动并验证一下刚刚创建的数据库

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

oracle:RAC1>srvctl status database -d tree

Instance tree1 is running on node rac1

Instance tree2 is running on node rac2


srvctl status nodeapps -n RAC1

VIP is running on node: RAC1

GSD is running on node: RAC1

Listener is running on node: RAC1

ONS daemon is running on node: RAC1


srvctl status nodeapps -n RAC2

VIP is running on node: RAC2

GSD is running on node: RAC2

Listener is running on node: RAC2

ONS daemon is running on node: RAC2


srvctl stop database -d tree


srvctl status database -d tree

Instance tree1 is not running on node rac1

Instance tree2 is not running on node rac2


srvctl status nodeapps -n RAC1

VIP is running on node: RAC1

GSD is running on node: RAC1

Listener is running on node: RAC1

ONS daemon is running on node: RAC1


srvctl status nodeapps -n RAC2

VIP is running on node: RAC2

GSD is running on node: RAC2

Listener is running on node: RAC2

ONS daemon is running on node: RAC2


srvctl start database -d tree

srvctl status database -d tree

Instance tree1 is running on node rac1

Instance tree2 is running on node rac2


sqlplus /nolog


SQL*Plus: Release 10.1.0.3.0 - Production on Tue Jan 24 17:00:22 2006


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


SQL> connect / as sysdba

Connected.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup


ORACLE instance started.


Total System Global Area 838860800 bytes

Fixed Size 781424 bytes

Variable Size 221254544 bytes

Database Buffers 616562688 bytes

Redo Buffers 262144 bytes

Database mounted.

Database opened.

SQL> SELECT * FROM V$ACTIVE_INSTANCES;


INST_NUMBER INST_NAME

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

1 RAC1:tree1

2 RAC2:tree2


SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production

With the Partitioning, Real Application Clusters, OLAP and Data Mining options


参考文献:


Oracle Real Application Clusters Installation and Configuration Guide 10g Release 1 (10.1)

for AIX-Based Systems, Apple Mac OS X, hp HP-UX, hp Tru64 UNIX, Linux, Solaris Operating System, and Windows Platforms Part No. B10766-08

阅读(3089) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~