在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

同样,安装后期会提示用户在所有节点上以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配置,需要选择网络接口和各个节点的虚拟地址


在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)



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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)


同时需要在另一个节点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的安装就完成了。


在Solaris 10 X86上安装Oracle 10g RAC详解 (2)


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


netca

Oracle Net Services Configuration:

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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)




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


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



在所有节点上创建数据库


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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

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


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


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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)


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


在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

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



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


在Solaris 10 X86上安装Oracle 10g RAC详解 (2)


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

在Solaris 10 X86上安装Oracle 10g RAC详解 (2)

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

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

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

上一篇:Intel TME和MKTME技术解析


下一篇:API Playbook 业界首发,教你玩 High 阿里云 API!