Solaris10下安装Oracle10203RAC环境 (zt)

首先是建立用户:

在第一个节点:

root@ahrac1 # groupadd oinstall
root@ahrac1 # groupadd dba
root@ahrac1 # mkdir -p /export/home/oracle
root@ahrac1 # useradd -g oinstall -G dba -d /export/home/oracle oracle
root@ahrac1 # chown oracle:oinstall /export/home/oracle
root@ahrac1 # mkdir /data
root@ahrac1 # chown oracle:oinstall /data
root@ahrac1 # passwd oracle


root@ahrac1 # id nobody
uid=60001(nobody) gid=60001(nobody)
root@ahrac1 # id oracle
uid=101(oracle) gid=101(oinstall)
root@ahrac1 # more /etc/group
root::0:
other::1:root
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
mail::6:root
tty::7:root,adm
lp::8:root,adm
nuucp::9:root
staff::10:
daemon::12:root
sysadmin::14:
smmsp::25:
gdm::50:
webservd::80:
nobody::60001:
noaccess::60002:
nogroup::65534:
test::100:
oinstall::101:
dba::102:oracle

在节点二:

root@ahrac2 # groupadd -g 101 oinstall
root@ahrac2 # groupadd -g 102 dba
root@ahrac2 # mkdir -p /export/home/oracle
root@ahrac2 # useradd -u 101 -g oinstall -G dba -d /export/home/oracle oracle
root@ahrac2 # chown oracle:oinstall /export/home/oracle
root@ahrac2 # mkdir /data
root@ahrac2 # chown oracle:oinstall /data
root@ahrac2 # id nobody
uid=60001(nobody) gid=60001(nobody)
root@ahrac2 # passwd oracle

设置两个节点的环境变量,注意节点二的环境变量中的ORACLE_SIDtradedb2

root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ vi .profile
umask 022
ORACLE_SID=tradedb1
export ORACLE_SID
ORACLE_BASE=/data/oracle
export ORACLE_BASE
ORACLE_HOME=/data/oracle/product/10.2/database
export ORACLE_HOME
NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
export NLS_LANG
PATH=$PATH:$ORACLE_HOME/bin
export PATH
DISPLAY=172.25.6.201:1.0
export DISPLAY

再上一篇文章中,介绍了通过rcp的方式配置远端访问方式,这篇给出配置ssh的方式。首先在两个节点上执行下面的操作,产生ssh命令所需的key文件:

root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ mkdir .ssh
$ chmod 700 .ssh
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
64:0a:45:ce:a6:de:8b:f7:ba:b3:15:87:38:46:f6:c7 oracle@ahrac1
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
/export/home/oracle/.ssh/id_rsa already exists.
Overwrite (yes/no)? no
$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
4f:58:55:da:5a:f1:11:3c:07:bb:84:44:1b:23:96:f0 oracle@ahrac1

$ touch .ssh/authorized_keys
$ cd .ssh
$ ls
authorized_keys id_dsa id_dsa.pub id_rsa id_rsa.pub

产生了key之后,利用ssh命令将key添加到authorized_keys文件中,并拷贝到节点二:

$ ssh ahrac1 cat /export/home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'ahrac1 (172.25.198.42)' can't be established.
RSA key fingerprint is 29:d2:ab:dc:ff:a3:24:70:14:7a:8e:70:01:f7:be:46.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ahrac1,172.25.198.42' (RSA) to the list of known hosts.
Password:
$ ssh ahrac1 cat /export/home/oracle/.ssh/id_dsa.pub >> authorized_keys
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
$ ssh ahrac2 cat /export/home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'ahrac2 (172.25.198.43)' can't be established.
RSA key fingerprint is 74:55:ef:49:2b:f4:a0:2c:52:44:83:09:ac:fb:b1:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ahrac2,172.25.198.43' (RSA) to the list of known hosts.
Password:
$ ssh ahrac2 cat /export/home/oracle/.ssh/id_dsa.pub >> authorized_keys
Password:
$ scp authorized_keys ahrac2:/export/home/oracle/.ssh/
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
authorized_keys 100% |*********************************************************************************| 1652 00:00

操作完成后,在节点二上重复这个步骤,将最终的authorized_keys拷贝回节点一。

然后在两个节点上分别修改authorized_keys的文件属性:

$ chmod 600 authorized_keys

为了ssh命令执行的时候不输入密码验证,在需要启动安装程序的节点进行如下的设置(这个操作在重启后失效,需要重启系统后手工执行这个步骤)

$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
Enter passphrase for /export/home/oracle/.ssh/id_rsa:
Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)
Enter passphrase for /export/home/oracle/.ssh/id_dsa:
Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)

下面可以验证一下是否不需要输入密码执行ssh命令:

$ ssh ahrac1 date
Mon Mar 26 15:56:06 CST 2007
$ ssh ahrac2 date
Mon Mar 26 15:55:13 CST 2007

网络配置部分完成,下面检查系统的硬件是否满足安装需要:

root@ahrac1 # /usr/sbin/prtconf | grep "Memory size"
Memory size: 32768 Megabytes
root@ahrac1 # /usr/sbin/swap -s
total: 298240k bytes allocated + 60184k reserved = 358424k used, 60398552k available
root@ahrac1 # df -k /tmp
Filesystem kbytes used avail capacity Mounted on
swap 60397080 224 60396856 1% /tmp
root@ahrac1 # /bin/isainfo -kv
64-bit sparcv9 kernel modules

内容需要1G以上,如果内存小于2G,则swap空间至少是内存的1.5倍,内存大于2G,则swap空间最小和内存大小相同。/tmp目录需要至少400M空间。安装Oracle的目录至少需要5.2G以上的空间。使用isainfo检查系统的架构,当前芯片是64SPARC

在两个节点下分别0修改/etc/hosts文件,添加public ipprivate ip,和vip

root@ahrac1 # vi /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
172.25.198.42 ahrac1 loghost
172.25.198.44 ahrac1-vip
10.0.0.3 ahrac1-priv
172.25.198.43 ahrac2
172.25.198.45 ahrac2-vip
10.0.0.4 ahrac2-priv

在两个节点上添加默认的路由:

vi /etc/defaultrouter
172.25.2.1

添加主键的PRIVATE IP

root@ahrac1 # ifconfig ce1 plumb
root@ahrac1 # ifconfig ce1 10.0.0.3 netmask 255.255.255.0 broadcast 10.0.0.255 up
root@ahrac1 # vi /etc/hostname.ce1
ahrac1-priv

另一个节点执行类似的操作,添加其PRIVATE IP

修改两个节点的默认子网掩码,将第二IP的掩码信息加入:

root@ahrac2 # vi /etc/netmasks
"/etc/netmasks" [Read only] 15 lines, 379 characters
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
172.25.0.0 255.255.0.0
10.0.0.0 255.255.255.0

检查ncsd进程已经启动:

root@ahrac1 # ps -ef|grep nscd
root 164 1 0 Mar 23 ? 0:10 /usr/sbin/nscd
root 16748 29168 0 16:24:45 pts/2 0:00 grep nscd

如果没有启动,可以使用/etc/init.d/nscd start来启动。

下面检查系统的软件是否满足安装RAC的需要,检查系统包是否安装完毕:

root@ahrac1 # uname -a
SunOS ahrac1 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V490

root@ahrac1 # pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWxwfnt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibC Sun Workshop Compilers Bundled libC
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts

下面配置系统的核心参数,在两个节点上修改/etc/system文件:

root@ahrac1 # vi /etc/system

set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=21474836479
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10

下面检查UDP协议的配置:

root@ahrac1 # ndd /dev/udp udp_xmit_hiwat
57344
root@ahrac1 # ndd /dev/udp udp_recv_hiwat
57344

Solaris在这里进行了优化,这个值已经很接近Oracle的推荐值了,这里就不修改了。

下面重启系统,安装的准备工作到此结束。

root@ahrac1 # init 6

这篇介绍Oracle Clusterware的安装过程。

RAC安装的准备工作可以参考:Solaris10下安装Oracle10203RAC环境(一):http://yangtingkun.itpub.net/post/468/276589

首先,解开CLUSTERWARE压缩包:

$ gunzip 10gr2_cluster_sol.cpio.gz
$ cpio -idmv < 10gr2_cluster_sol.cpio$ gunzip 10gr2_cluster_sol.cpio.gz
$ cpio -idmv < 10gr2_cluster_sol.cpio

建立安装所需的目录:

$ mkdir -p /data/oracle/product/10.2
$ mkdir /data/oracle/oraInventory
$ mkdir /data/oracle/product/10.2/crs
$ mkdir /data/oracle/product/10.2/database

建立ocrvoting disk所需的裸设备,使用VeritasVolumn Manager建立所需的裸设备:

root@ahrac1 # cd /dev/vx/rdsk/datadg
root@ahrac1 # vxassist make ocr 300m
root@ahrac1 # vxassist make ocr2 300m
root@ahrac1 # vxassist make vot 300m
root@ahrac1 # vxassist make vot2 300m
root@ahrac1 # vxassist make vot3 300m
root@ahrac1 # chown oracle:oinstall *

利用root登陆图形界面执行,注意,一定需要在安装之前执行ssh的验证工作,否则安装过程执行一半的时候会出现错误:Specified Nodes Are Not Clusterable

root@ahrac1 # xhost +
access control disabled, clients can connect from any host
root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ ssh ahrac1 date

Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':

Mon Mar 26 18:31:18 CST 2007

$ exec /usr/bin/ssh-agent $SHELL

$ /usr/bin/ssh-add

Enter passphrase for /export/home/oracle/.ssh/id_rsa:

Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)

Enter passphrase for /export/home/oracle/.ssh/id_dsa:

Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)

$ cd /data
$ cd cluster_disk
$ ./runInstaller

安装步骤中在Cluster主目录位置填入:OraCrs10g_home1/data/oracle/product/10.2/crs信息,并选择简体中文字符。

Cluster配置页面选择默认的Cluster namecrs,并输入节点二的信息:ahrac2ahrac2-privahrac2-vip

interface的选择界面:由于Oracle对于IP地址的解析存在bug,因此这里将172.25.0.0interface类型改为PUBLIC

orc配置界面,输入刚才建立好的/dev/vx/rdsk/datadg/ocr/dev/vx/rdsk/datadg/ocr2,点击确定。

Voting disk配置界面,分别输入刚才建立好的/dev/vx/rdsk/datadg/vot/dev/vx/rdsk/datadg/vot2/dev/vx/rdsk/datadg/vot3,点击确定。

检查弹出的汇总信息,确认无误后,点击开始安装。

安装完成后,分别在两个节点执行下面的两个脚本:

root@ahrac1 # . /data/oracle/oraInventory/orainstRoot.sh
Changing permissions of /data/oracle/oraInventory to 770.
Changing groupname of /data/oracle/oraInventory to oinstall.
The execution of the script is complete
root@ahrac1 # . /data/oracle/product/10.2/crs/root.sh
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: ahrac1 ahrac1-priv ahrac1
node 2: ahrac2 ahrac2-priv ahrac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/vx/rdsk/datadg/vot
Now formatting voting device: /dev/vx/rdsk/datadg/vot2
Now formatting voting device: /dev/vx/rdsk/datadg/vot3
Format of 3 voting devices complete.
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
ahrac1
CSS is inactive on these nodes.
ahrac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.

另一个节点执行root.sh脚本的时候会报错:

root@ahrac2 # . /data/oracle/product/10.2/crs/root.sh
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: ahrac1 ahrac1-priv ahrac1
node 2: ahrac2 ahrac2-priv ahrac2
clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
ahrac1
ahrac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
The given interface(s), "ce0" is not public. Public interfaces should be used to configure virtual IPs.

这个错误的具体描述在Solaris8RAC安装文档中已经详细描述了,解决方法是手工启动vipca进行配置。

root@ahrac1 # cd /data/oracle/product/10.2/crs/bin
root@ahrac1 # ./vipca

Xmanager中启动一个终端,启动vipca图形界面。点击next,出现所有可用的网络接口,由于ce0配置的是PUBLIC INTERFACT,这里选择ce0,点击next,在出现的配置中IP Alias Name分别填入:ahrac1-vipahrac2-vipIP address处填入:172.25.198.44172.25.198.45。这里如果你的配置是正确的,那么你填完一个IPOracle会自动将剩下三个配置补齐。点击next,出现汇总页面,检查无误后,点击Finish

Oracle会执行6个步骤,Create VIP application resourceCreate GSD application resourceCreate ONS application resourceStart VIP application resourceStart GSD application resourceStart ONS application resource

全部成功后点击OK,结束VIPCA的配置。

这时候返回Cluster Ware的安装界面,点击OKOracle自动启动两个工具,并再次执行验证,顺利结束后,安装完成。

这篇介绍Oracle Database的安装过程。

RAC安装的准备工作可以参考:Solaris10下安装Oracle10203RAC环境(一): http://yangtingkun.itpub.net/post/468/276589

ORACLE CLUSTERWARE的安装可以参考:Solaris10下安装Oracle10203RAC环境(二): http://yangtingkun.itpub.net/post/468/277075

Solaris8RAC安装过程中,采用了ASM管理磁盘的方式,这里由于配置的Volumn Manager,可以更加方便的管理裸设备。因此选择采用裸设备建立Oracle数据库。

建立数据文件、控制文件、日志文件、参数文件和密码文件所需的裸设备:

root@ahrac1 # vxassist make tradedb_system_1 2048m user=oracle group=oinstall mode=660
root@ahrac1 # vxassist make tradedb_undotbs1_1 4096m user=oracle group=oinstall mode=660
root@ahrac1 # vxassist make tradedb_undotbs2_1 4096m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_temp_1 4096m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_sysaux_1 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_users_1 200m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo1_1 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo1_2 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo1_3 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo2_1 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo2_2 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo2_3 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_control1 120m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_control2 120m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_control3 120m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_spfile 10m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_pwdfile 10m user=oracle group=oinstall mode=660

root@ahrac1 # vxassist make tradedb_flasharea 16384m user=oracle group=oinstall mode=660

然后在节点一编辑映射文件:

root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ vi tradedb_raw.conf
system=/dev/vx/rdsk/datadg/tradedb_system_1
undotbs1=/dev/vx/rdsk/datadg/tradedb_undotbs1_1
undotbs2=/dev/vx/rdsk/datadg/tradedb_undotbs2_1
temp=/dev/vx/rdsk/datadg/tradedb_temp_1
sysaux=/dev/vx/rdsk/datadg/tradedb_sysaux_1
users=/dev/vx/rdsk/datadg/tradedb_users_1
redo1_1=/dev/vx/rdsk/datadg/tradedb_redo1_1
redo1_2=/dev/vx/rdsk/datadg/tradedb_redo1_2
redo1_3=/dev/vx/rdsk/datadg/tradedb_redo1_3
redo2_1=/dev/vx/rdsk/datadg/tradedb_redo2_1
redo2_2=/dev/vx/rdsk/datadg/tradedb_redo2_2
redo2_3=/dev/vx/rdsk/datadg/tradedb_redo2_3
control1=/dev/vx/rdsk/datadg/tradedb_control1
control2=/dev/vx/rdsk/datadg/tradedb_control2
control3=/dev/vx/rdsk/datadg/tradedb_control3
spfile=/dev/vx/rdsk/datadg/tradedb_spfile
pwdfile=/dev/vx/rdsk/datadg/tradedb_pwdfile

然后设置oracle用户的环境变量,添加如下内容:

DBCA_RAW_CONFIG=/export/home/oracle/tradedb_raw.conf
export DBCA_RAW_CONFIG

在节点一建立归档目录:

$ mkdir -p /data/oracle/oradata/tradedb/archive1

节点二建立归档目录:

$ mkdir -p /data/oracle/oradata/tradedb/archive2

下面可以解开Oracle安装文件,展开完毕后,使用root登陆图形界面执行:

root@ahrac1 # xhost +
access control disabled, clients can connect from any host
root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
Enter passphrase for /export/home/oracle/.ssh/id_rsa:
Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)
Enter passphrase for /export/home/oracle/.ssh/id_dsa:
Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)
$ cd /data/disk1
$ ./runInstaller

注意,需要设置ssh的验证,否则安装会失败。

在产品界面选择企业版,并选择简体中文。

检查$ORACLE_HOME路径是否正确,这里的配置应该是:/data/oracle/product/10.2/database

选择Cluster Installation,并将节点二选上。

Oracle执行完检测后,进入配置选项。由于不打算使用ASM,这里选择了Create a database

数据库的配置选择都和我的要求有所差别,这里选择高级安装。

检查弹出的汇总信息后,开始数据库软件的安装。

安装完成后,Oracle自动启动Oracle Net Configuration AssistantOracle Database Configuration Assistant

NETCA以命令行方式运行成功后,启动图形化DBCA

数据库模板选择Custom Database

全局数据库名:tradedb.us.oracle.comSID前缀:tradedb

输入SYS/SYSTEM/DBSNMP/SYSMAN等用户密码。

由于设置了DBCA_RAW_CONFIGOracle自动选择裸设备作为存储机制,而且自动找到裸设备映射文件。

由于裸设备不支持FLASH RECOVERY AREA,这里不选择FLASH RECOVERY AREA

选择归档,选择自动归档,输入节点一和节点二上的归档目录:/data/oracle/oradata/tradedb/archive1/data/oracle/oradata/tradedb/archive2。由于裸设备也不支持归档日志,这里将归档目录放在本地硬盘上。

Database Service界面选择tradedb.us.oracle.com,增加实例。输入服务名tradedb后,Oracle自动显示tradedb1tradedb2两个实例的信息。这里可以将TAF设置为BASIC模式。

设置Oracle的内容分配、字符集、BLOCK SIZE、连接模式和参数文件。

设置表空间、数据文件的大小,然后开始建库。

建库完成后,点击EXIT。安装完毕。

最后在两个节点分别用root执行root.sh,结束数据库的安装操作。

root@ahrac1 # . /data/oracle/product/10.2/database/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /data/oracle/product/10.2/database

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...


Creating /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.

这篇文档简单描述一下RAC环境安装过程中碰到的问题。

RAC安装的准备工作可以参考:Solaris10下安装Oracle10203RAC环境(一):http://yangtingkun.itpub.net/post/468/276589

ORACLE CLUSTERWARE的安装可以参考:Solaris10下安装Oracle10203RAC环境(二):http://yangtingkun.itpub.net/post/468/277075

ORACLE DATABASE的安装可以参考:Solaris10下安装Oracle10203RAC环境(三):http://yangtingkun.itpub.net/post/468/277419

ORACLE 10203补丁安装可以参考:Solaris10下安装Oracle10203RAC环境(四):http://yangtingkun.itpub.net/post/468/277626

由于有了在Solaris8上安装RAC的经验,在Solaris10下安装还算比较顺利。

不过由于安装的时候,采用了一些其他的配置方法,也碰到了一些问题。不过几乎所有的问题都和操作系统版本无关,而是使用sshvolumn manager等造成的。

首先碰到的问题是User equivalence unavailable on all the nodes.错误。

这个错误产生有两个原因,都是由于SSH造成的。一个是由于cluvfy工具本身的问题,在寻找ssh命令时去/usr/local/bin目录下寻找。而另一个时由于ssh验证造成的。关于这个问题的详细描述,可以参考:RAC User Equivalence Check Failedhttp://yangtingkun.itpub.net/post/468/275147

第二个问题碰到的问题是Specified Nodes Are Not Clusterable

产生这个问题的原因也是两个。一个是上面提到的SSH验证的问题。必须启动安装程序的会话设置SSH的验证,否则就会造成上面的这个问题。

另外一个原因是我在检查系统网络情况的时候,发现一台主机的第二个网卡虽然加载了,但是没有UP。造成这个的原因居然是/etc/hostname.ce1文件中,多了一个回车。

这样,在重启系统后,会造成网卡没有UP,造成PRIVATE IP之间无法访问,从而导致上面的问题。

root@ahrac1 # vi /etc/hostname.ce1

tradedb1-priv


~
"/etc/hostname.ce1" 2 lines, 15 characters
# reboot

root@ahrac1 # ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843 mtu 1500 index 2
inet 172.25.198.42 netmask ffff0000 broadcast 172.25.255.255
ether 0:14:4f:3b:56:75
ce1: flags=1000843 mtu 1500 index 3
inet 10.0.0.3 netmask ffffff00 broadcast 10.0.0.255
ether 0:14:4f:3b:56:75

注意,由于hostname.ce1中包含了两行记录,因此,重新启动后,PRIVATE网卡没有自动UP,造成了上面的这个问题。将空行删除后,重新系统,错误消失。(当然删除空行后,直接将ce1网卡UP即可,重启是为了确认问题已经解决。)

第三个问题和裸设备有关。

首先,使用裸设备无法启用FLASH RECOVERY AREA,因此选择裸设备后,就不要在建立数据库的时候选择FLASH RECOVERY AREA。否则会报错。

其次,裸设备没有按照标准文档格式,将其大小放到最后。所以Oracle虽然根据映射文件找到表空间对应的裸设备,但是其大小设置和裸设备不一致。这里需要手工修改。

第三,裸设备需要一些额外的预留空间。因此表空间数据文件的大小至少应该比裸设备建立的空间少1M。否则会空间不足的错误。

第四个问题是一个bug

在升级数据库时碰到了ORA-600错误。这个问题已经在上一篇文章中进行了描述,这里就不再重复了。

最后一个问题和VOLUMN MANAGER有关。

在安装好数据库之后,重启了操作系统,结果发现数据库没有自动启动。而通过手工启动的方式也没有效果:

root@ahrac1 # ./etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.

重新启动系统,并检查后台进程运行情况,结果发现:

root@ahrac1 # ps –ef|grep ora
oracle 1349 1312 0 15:05:26 ? 0:00 /data/oracle/product/10.2/crs/bin/crsctl.bin check boot
root 1511 880 0 15:05:33 pts/1 0:00 grep ora
oracle 1348 1313 0 15:05:26 ? 0:00 /data/oracle/product/10.2/crs/bin/crsctl.bin check boot
oracle 1313 1234 0 15:05:25 ? 0:00 sh -c /data/oracle/product/10.2/crs/bin/crsctl check boot > /tmp/crsctl.1234
oracle 1350 1215 0 15:05:26 ? 0:00 /data/oracle/product/10.2/crs/bin/crsctl.bin check boot
oracle 1215 1178 0 15:05:25 ? 0:00 sh -c /data/oracle/product/10.2/crs/bin/crsctl check boot > /tmp/crsctl.1178
oracle 1312 1232 0 15:05:25 ? 0:00 sh -c /data/oracle/product/10.2/crs/bin/crsctl check boot > /tmp/crsctl.1232
root@ahrac1 # more /tmp/crsctl.1234
OCR initialization failed accessing OCR device: PROC-26: Error while accessing the physical storage Operating System error [Permission denied] [13]

看这个问题,似乎是共享存储的权限问题。

进入共享存储所在目录:

root@ahrac1 # cd /dev/vx/rdsk/datadg/
root@ahrac1 # ls -l
total 0
crw------- 1 root root 308, 41000 Mar 27 14:40 ocr
crw------- 1 root root 308, 41001 Mar 27 14:40 ocr2
crw-rw---- 1 oracle oinstall 308, 41018 Mar 27 14:40 tradedb_control1
crw-rw---- 1 oracle oinstall 308, 41019 Mar 27 14:40 tradedb_control2
crw-rw---- 1 oracle oinstall 308, 41020 Mar 27 14:40 tradedb_control3
crw-rw---- 1 oracle oinstall 308, 41010 Mar 27 14:40 tradedb_example_1
crw-rw---- 1 oracle oinstall 308, 41023 Mar 27 14:40 tradedb_flasharea
crw-rw---- 1 oracle oinstall 308, 41022 Mar 27 14:40 tradedb_pwdfile
crw-rw---- 1 oracle oinstall 308, 41012 Mar 27 14:40 tradedb_redo1_1
crw-rw---- 1 oracle oinstall 308, 41013 Mar 27 14:40 tradedb_redo1_2
crw-rw---- 1 oracle oinstall 308, 41014 Mar 27 14:40 tradedb_redo1_3
crw-rw---- 1 oracle oinstall 308, 41015 Mar 27 14:40 tradedb_redo2_1
crw-rw---- 1 oracle oinstall 308, 41016 Mar 27 14:40 tradedb_redo2_2
crw-rw---- 1 oracle oinstall 308, 41017 Mar 27 14:40 tradedb_redo2_3
crw-rw---- 1 oracle oinstall 308, 41021 Mar 27 14:40 tradedb_spfile
crw-rw---- 1 oracle oinstall 308, 41009 Mar 27 14:40 tradedb_sysaux_1
crw-rw---- 1 oracle oinstall 308, 41005 Mar 27 14:40 tradedb_system_1
crw-rw---- 1 oracle oinstall 308, 41008 Mar 27 14:40 tradedb_temp_1
crw-rw---- 1 oracle oinstall 308, 41006 Mar 27 14:40 tradedb_undotbs1_1
crw-rw---- 1 oracle oinstall 308, 41007 Mar 27 14:40 tradedb_undotbs2_1
crw-rw---- 1 oracle oinstall 308, 41011 Mar 27 14:40 tradedb_users_1
crw------- 1 root root 308, 41002 Mar 27 14:40 vot
crw------- 1 root root 308, 41003 Mar 27 14:40 vot2
crw------- 1 root root 308, 41004 Mar 27 14:40 vot3

记得配置完成后,都是oracle。怎么现在votocr都变成root类型的。想起刚开始不熟悉Volumn Manager的用法,因此建立vot等三个裸设备的时候没有指定用户和组信息。最后采用操作系统命名grant进行的授权。而其他的裸设备文件则是通过vxassist make tradedb_spfile 10m user=oracle group=oinstall mode=660方式建立的。

莫非是这个错误造成的crs无法启动?

尝试修改这几个文件的属性:

root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 vot
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 vot2
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 vot3
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 ocr
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 ocr2
root@ahrac1 # ls -l ocr*
crw-rw---- 1 oracle oinstall 308, 41000 Mar 27 14:40 ocr
crw-rw---- 1 oracle oinstall 308, 41001 Mar 27 14:40 ocr2
root@ahrac1 # ls -l vot*
crw-rw---- 1 oracle oinstall 308, 41002 Mar 27 14:40 vot
crw-rw---- 1 oracle oinstall 308, 41003 Mar 27 14:40 vot2
crw-rw---- 1 oracle oinstall 308, 41004 Mar 27 14:40 vot3

下面尝试重新启动crs

root@ahrac1 # /data/oracle/product/10.2/crs/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
root@ahrac1 # ps -ef|grep ora
oracle 4068 4067 0 16:06:45 ? 0:00 /bin/sh -c ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/ahrac1/css
oracle 4815 4809 0 16:07:09 ? 0:00 /data/oracle/product/10.2/crs/bin/racgmain start
oracle 4718 1 0 16:07:06 ? 0:00 /data/oracle/product/10.2/database/bin/tnslsnr LISTENER_AHRAC1 -inherit
root 3978 3917 0 16:06:43 ? 0:00 /data/oracle/product/10.2/crs/bin/oprocd run -t 1000 -m 500 -f
oracle 4940 4939 0 16:07:13 ? 0:00 /data/oracle/product/10.2/database/bin/racgmdb -s open
oracle 4321 3912 0 16:06:54 ? 0:00 /data/oracle/product/10.2/crs/bin/evmlogger.bin -o /data/oracle/product/10.2/cr
oracle 1135 1 0 15:45:27 ? 0:00 sh -c sh -c 'ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/ahrac1/e
oracle 4809 1137 0 16:07:09 ? 0:00 /bin/sh /data/oracle/product/10.2/crs/bin/racgwrap start
root 1137 1 0 15:45:27 ? 0:02 /data/oracle/product/10.2/crs/bin/crsd.bin reboot
oracle 4830 4823 0 16:07:09 ? 0:00 /data/oracle/product/10.2/database/bin/racgmain start
oracle 5559 1 0 16:07:34 ? 0:00 ora_psp0_tradedb1
oracle 4069 4068 0 16:06:45 ? 0:01 /data/oracle/product/10.2/crs/bin/ocssd.bin
oracle 4067 3918 0 16:06:45 ? 0:00 sh -c /bin/sh -c 'ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/ahr
oracle 5573 1 0 16:07:34 ? 0:00 ora_mman_tradedb1
oracle 3912 1135 0 16:06:43 ? 0:00 /data/oracle/product/10.2/crs/bin/evmd.bin
oracle 4823 1137 0 16:07:09 ? 0:00 /bin/sh /data/oracle/product/10.2/database/bin/racgwrap start
oracle 4834 1 0 16:07:09 ? 0:00 /data/oracle/product/10.2/crs/bin/racgmain ora.tradedb.db rundetach 1 crscmd c
oracle 4832 1 0 16:07:09 ? 0:00 /data/oracle/product/10.2/database/bin/racgimon startd tradedb
oracle 5031 5015 6 16:07:15 ? 0:17 oracletradedb1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 5561 1 0 16:07:34 ? 0:00 ora_lmon_tradedb1
oracle 4836 1 0 16:07:09 ? 0:00 /data/oracle/product/10.2/crs/bin/racgmain ora.tradedb.db rundetach 1 crscmd c
oracle 4906 1 0 16:07:11 ? 0:00 /data/oracle/product/10.2/crs/opmn/bin/ons -d
oracle 4939 4832 0 16:07:13 ? 0:00 /data/oracle/product/10.2/database/bin/racgeut -e _USR_ORA_DEBUG=0 -e ORACLE_SI
oracle 5555 1 0 16:07:34 ? 0:00 ora_pmon_tradedb1
oracle 5015 4940 0 16:07:15 ? 0:00 /data/oracle/product/10.2/database/bin/sqlplus
oracle 4908 4906 0 16:07:11 ? 0:00 /data/oracle/product/10.2/crs/opmn/bin/ons -d
oracle 5557 1 0 16:07:34 ? 0:00 ora_diag_tradedb1
oracle 5563 1 0 16:07:34 ? 0:00 ora_lmd0_tradedb1
oracle 5565 1 3 16:07:34 ? 0:05 ora_lms0_tradedb1
oracle 5569 1 3 16:07:34 ? 0:06 ora_lms1_tradedb1
oracle 5624 1 0 16:07:35 ? 0:00 ora_s000_tradedb1
oracle 5575 1 0 16:07:35 ? 0:00 ora_dbw0_tradedb1
oracle 5577 1 0 16:07:35 ? 0:00 ora_dbw1_tradedb1
oracle 5579 1 0 16:07:35 ? 0:00 ora_lgwr_tradedb1
oracle 5581 1 0 16:07:35 ? 0:00 ora_ckpt_tradedb1
oracle 5583 1 0 16:07:35 ? 0:00 ora_smon_tradedb1
oracle 5585 1 0 16:07:35 ? 0:00 ora_reco_tradedb1
oracle 5587 1 0 16:07:35 ? 0:00 ora_cjq0_tradedb1
oracle 5589 1 0 16:07:35 ? 0:00 ora_mmon_tradedb1
root 5741 1454 0 16:07:40 pts/1 0:00 grep ora
oracle 5607 1 0 16:07:35 ? 0:00 ora_mmnl_tradedb1
oracle 5622 1 0 16:07:35 ? 0:00 ora_d000_tradedb1

问题解决。

看来安装过程中的任何小问题都会成为后面的陷阱。

http://yangtingkun.itpub.net/post/468/276589

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-85098/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-85098/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值