6,接下来就进入到安装界面,可以看到Oracle安装到了所有节点
点击查看大图同样,安装后期会提示用户在所有节点上以root身份运行脚本root.sh,这时在RAC1运行是还要进行Vip配置。
<root:RAC1>/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= oracleORACLE_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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.此时Oracle安装程序会进行VIP配置,需要选择网络接口和各个节点的虚拟地址
点击查看大图 点击查看大图配置完成后会出现显示整个配置的结果:
点击查看大图 同时需要在另一个节点RAC2上运行root.sh
<root:RAC2>/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= oracleORACLE_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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.
CRS resources are already configured以上步骤完成后,整个Oracle 10g的安装就完成了。
点击查看大图下面我们还需要进行Oracle网络服务的配置,具体步骤如下:
<oracle:RAC1>netcaOracle Net Services Configuration:1, 在网络服务配置时选择”Cluster configuration”,如下图所示:
点击查看大图2,选中需要进行配置的节点,这里选中RAC1和RAC2。
点击查看大图 3,以后的配置可以按照缺省项一步步进行,最后直到配置成功完成。
1,在创建数据库之前,我们还需要添加一个Oracle的补丁
4186426,这个补丁解决了启动Oracle实例时会失败的错误,用户可以从http://metalink.oracle.com上得到这一补丁,需要注重的是安装这个补丁时要按照它提供的步骤进行,这里不做详述.
在所有节点上创建数据库
1,由于创建oracle数据库需要多个raw devices,这里为了方便起见,将这些raw devices的设备文件连接成更易懂的文件名,同时需要设置相应的属主和权限,具体步骤如下:<root:RAC1>cd ORACLE<root:RAC1>mkdir db<root:RAC1>chown oracle:root db<root:RAC1>cd db<root:RAC1>ls<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s0 system<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s1 sysaux<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s3 undotbs1<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s4 undotbs2<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C800d0s5 temp <root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s0 example<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s1 users <root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s3 redo1_1<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s4 redo1_2<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s5 redo2_1<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s6 redo2_2<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C801d0s7 spfile <root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C802d0s3 control1<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C802d0s4 control2<root:RAC1>ln -s /dev/rdsk/c3t600C0FF00000000007D35237AD84C802d0s5 pwdfile <root:RAC1>pwd /ORACLE/db<root:RAC1>chown -RL oracle:dba *<root:RAC1>chmod -R 660 *
将以上的目录做为创建数据库所需raw devices的配置文件,具体步骤为:
<oracle:RAC1>mkdir -p /u01/app/oracle/oradata/tree
并在此目录下创建文件tree_raw.conf,具体内容如下:
<oracle:RAC1>cat tree_raw.conf system=/ORACLE/db/systemsysaux=/ORACLE/db/sysauxexample=/ORACLE/db/exampleusers=/ORACLE/db/userstemp=/ORACLE/db/tempundotbs1=/ORACLE/db/undotbs1undotbs2=/ORACLE/db/undotbs2redo1_1=/ORACLE/db/redo1_1redo1_2=/ORACLE/db/redo1_2redo2_1=/ORACLE/db/redo2_1redo2_2=/ORACLE/db/redo2_2control1=/ORACLE/db/control1control2=/ORACLE/db/control2spfile=/ORACLE/db/spfilepwdfile=/ORACLE/db/pwdfile
然后编辑文件/eXPort/home/oracle/.profile,将以下几列加入DBCA_RAW_CONFIG=/u01/app/oracle/oradata/tree/tree_raw.confexport DBCA_RAW_CONFIG
2,在各节点上分别设置环境变量RAC1,ORACLE_SID=tree1export ORACLE_SIDRAC2,ORACLE_SID=tree2export ORACLE_SID
3,和安装Oracle数据库一样,需要将节点RAC1和RAC2上的另一个CPU离线,可参照安装Oracle数据库一节中的步骤来做。
=====================================================以oracle用户来创建一个Cluster数据库,具体步骤如下:<oracle:RAC1>dbca
创建数据库步骤:
1,选择数据库的类型,这里需要选择创建Oracle Real application Clusters database
点击查看大图然后选择创建一个数据库并随后在节点选择时选中两个节点RAC1和RAC2.
4,在选择模板时,这里选择创建”General Purpose”的数据库。
5,随后按照提示输入全局数据库的名字,这里设定名字为”tree”
点击查看大图6,在随后的数据库治理选项中选取Oracle Enterprise Manager Grid Control,即不选中”Configure the Database with Enterprise Manage”的选项
点击查看大图以后的步骤中需要设定密码,设定存储和恢复机制以及数据库内容和服务,这里按照缺省值设定即可。
随后要设置数据库的初始参数,在此,根据机器的内存大小,设定SGA为800M,PGA 为200M,用户可根据具体的环境来设定相应的大小
点击查看大图接下来需要配置数据库的存储并设置创建数据库的一些选项,所有这些设置完成后,就开始创建数据库,最终顺利建立,见下图:
点击查看大图在此我们还可以来起动并验证一下刚刚创建的数据库------------------------------------------------oracle:RAC1>srvctl status database -d treeInstance tree1 is running on node rac1Instance tree2 is running on node rac2
<oracle:RAC1>srvctl status nodeapps -n RAC1VIP is running on node: RAC1GSD is running on node: RAC1Listener is running on node: RAC1ONS daemon is running on node: RAC1
<oracle:RAC1>srvctl status nodeapps -n RAC2VIP is running on node: RAC2GSD is running on node: RAC2Listener is running on node: RAC2ONS daemon is running on node: RAC2
<oracle:RAC1>srvctl stop database -d tree
<oracle:RAC1>srvctl status database -d treeInstance tree1 is not running on node rac1Instance tree2 is not running on node rac2
<oracle:RAC1>srvctl status nodeapps -n RAC1VIP is running on node: RAC1GSD is running on node: RAC1Listener is running on node: RAC1ONS daemon is running on node: RAC1
<oracle:RAC1>srvctl status nodeapps -n RAC2VIP is running on node: RAC2GSD is running on node: RAC2Listener is running on node: RAC2ONS daemon is running on node: RAC2
<oracle:RAC1>srvctl start database -d tree<oracle:RAC1>srvctl status database -d treeInstance tree1 is running on node rac1Instance tree2 is running on node rac2
<oracle:RAC1>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 sysdbaConnected.SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup
ORACLE instance started.
Total System Global Area 838860800 bytesFixed Size 781424 bytesVariable Size 221254544 bytesDatabase Buffers 616562688 bytesRedo Buffers 262144 bytesDatabase mounted.Database opened.SQL> SELECT * FROM V$ACTIVE_INSTANCES;
INST_NUMBER INST_NAME----------- ------------------------------------------------------------1 RAC1:tree12 RAC2:tree2
SQL> exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - ProductionWith 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