[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RAC On Debian求助



在 星期四 23 三月 2006 15:40,Bingfu Li 写道:
> 你好。我现在在折腾debian下安装oracle rac 以及其他应用。在cu上看到你安装成功过。
>
> 可否把你的资料分享份给我?谢谢`!我加了你的msn了。Qq密码我忘记了。现在上不了。:~(
>
> 谢谢`~~
您好,我的在debian上安装oracle rac的文档还没有整理出来,我吧一些当时的原始记录发给你,希望对你能有所帮助,如果遇到什么问题,咱们随时联系,我
的qq是21232251,我晚上8点到10点这一段时间一般都会在。msn我一般会在linux里边上,这一段时间要折腾刚买的手机需要用windows,msn
可能会上的少一些。

附件是我当时安装的原始记录,希望能对你有所帮助。写的很简单,见笑了。

我安装的是oracle 10gR2


-- 
====================
快乐着你的快乐!
幸福着你的幸福!!
====================

1 虚拟机的建立 
1 New Virtual Machine 
2 Welcome to the New Virtual Machine Wizard 	Next
3 Select the Appropriate Configuration  选择Custom(默认为Typical),Next
4 Select a Virtual Machine Format 选择New - Workstation 5 (默认) ,Next
5 Select a Guest Operating System , Guest Operating System 选择Linux , Version 选择Ubuntu, Next
6.a Name the Virtual Machine , Name 输入rac1 ,location输入/vmware/rac/rac1, Next
6.b Name the Virtual Machine , Name 输入rac2 ,location输入/vmware/rac/rac2, Next
7 Processor configuration, Number of processors 选择One(默认), Next
8 Memory for the Virtual Machine 调节Memory为520MB , Next
9 Network Type , Network Connection选择Use bridged networking(默认), Next
10 Select I/O Adapter Types , SCSI adapter 选择LSI Logic(默认), Next
11 Select a Disk ,Disk 选择Create a new virtual disk(默认), Next
12 Select a Disk ,Virtual Disk Type 选择SCSI(默认), Next
13 Specify Disk Capacity ,Disk Size 设置为 12GB(默认8GB), Allocate all disk space now 默认情况下不选中,Split disk into 2GB files 默认选中, Next
14.a Specify Disk File , Disk File 指定为rac1.vmdk(默认), Next
14.b Specify Disk File , Disk File 指定为rac2.vmdk(默认), Finish
15 虚拟机创建完成创建完成

2 对虚拟机配置进行设置
1 单击Edit virtual machines settings ,也可以使用菜单VM->Settings来启动虚拟机的配置界面
2 选择Floppy 1 点Remove 删除软盘驱动器
3 选择Sound Adapter 点Remove 删除声卡
4 选择CD-ROM 1, 在Device Status中选中Connect at power on (默认), Connection 选择Use ISO image,并在下面输入光盘镜像的位置 /bak/os/debian/debian-31r0a-i386-binary-1.iso, 也可以使用Browse浏览得到光盘镜像的位置。
5 选择Ethernet 1,取消选择Connect at power on。
6 按“确定“退出虚拟机设置

3 安装debian gnu/linux 3.1
1 启动虚拟机,在“Press F1 for help, or ENTER to boot:"提示符下按回车,进入下一步安装
2 选择语言,选择“English”默认,按回车
3 Choose a country, select "other", press "Enter"
4 "Choose country or region" 使用"Page Up","Page Down","Up" and "Down" 选择 "China",然后按 "Enter"
5 "Keymap to Use:", 选择"American English", 按"Enter"
6 由于和虚拟机器相连的网络上没有dhcp服务器,debian的安装程序提示"Network autoconfiguration failed",按”Enter"确认,
7 "Network configuration method", 我们手工配置虚拟机使用的网络,选择"configure network manually",按”Enter"
8.a “IP address”输入192.168.0.181, 按“Enter”
8.b “IP address”输入192.168.0.182, 按“Enter”
9 “Netmask:",默认值为255.255.255.0,保留默认值,按”Enter“
10 “Gateway:",默认值为192.168.0.1,于我们使用的网关相同,保留默认值,,按”Enter“
11 ”Name server addresses:“,默认值为192.168.0.1, 我们修改为我们使用的dns服务器202.106.0.20,,按”Enter“
12.a ”Hostname:“,默认值为"debian",根据需要修改为我们需要的机器名称rac1 ,按”Enter“
12.b ”Hostname:“,默认值为"debian",根据需要修改为我们需要的机器名称rac2 ,按”Enter“
13 ”Domain name:“,输入计算机所在的域,我们在这里保持空白,不输入任何域,,按”Enter“
14 ”Partitioning method:“,选择分区的方式,力求简单,我们使用”Erase entire disk: SCSI1 (0,0,0) (sda) - 12.9 GB VMware",,按”Enter“
15 "Partitioning schema",选择"All files in one partition (recommended for new users)",按”Enter“
16 系统给出几画的分区,我的机器上/分区是12.3G,swap分区是559.3 MB,接受默认的分区方式,选择"Finish partitioning and write changes to disk",按”Enter“
17 提示根分区和swap分区将被格式化,问是否确认,选择“Yes”,按”Enter“
18 开始格式化分区并进行安装
19 寻问是否将grub安装在mbr上,由于虚拟机只跑一个系统,所以将grub安装在mbr上,选择yes,按“enter”
20 安装完成,提示弹出光盘,这里我们选择"Continue",按”Enter“
21 系统重新启动进入新的debian系统
22 进入"Debian base system configuration",选择"OK",按”Enter“
23 “Time zone configuration",问是否将硬件时钟设置为GMT,选择"No",按”Enter“
24 选择时区,我们选择"Asia/Shanghai",按”Enter“
25 输入root密码,按”Enter“
26 确认root密码,输入相同的密码后,按”Enter“
27 输入一个新用户的全名,在这里我们建立一个用户debian,密码debian,输入”debian“,按”Enter“
28 输入这个用户的帐号,输入”debian“,按”Enter“
29 输入debian用户的密码debian,按”Enter“
30 确认debian用户的密码,输入后按”Enter“
31 问是否扫描另一张光盘,选择”No“,按”Enter“
32 这时apt试图访问security.debian.org,但是由于网络不通,没办法访问。
33 apt提示一些安全更新没办法访问,按”Enter“确认
34 选择将要安装的软件,我们不选择任何软件,使用tab将光标移动到ok上,按”Enter“
35 将有一些基础的软件包回被安装,安装完毕后就可以
36 配置exim,选择”local dilivery only; not on a network",按”Enter“
37 root和postmaster用户的重定向,默认为我们刚才建立的用户debian,按”Enter“接受默认设置
38 提示系统安装成功,按”Enter“出现登陆提示符
39 至此,系统安装完毕,可以使用root和debian进行登陆

4为虚拟机添加共享硬盘和用于集群间通讯的网卡
1.a 为rac1创建一块新的虚拟硬盘,单击"Edit virtual machine settings" 按"Add..."启动设备添加向导,选择设备类型为"Hard Disk",按"Next", 选择"Create a new virtual disk",按"Next","Virtual Disk Type"选择"SCSI",按"Next","Disk Capacity"中"Disk size"我们设置为12GB, 按"Next", "Disk File"中,我们设置文件名称为"/vmware/rac/sharedisk/rac1-0.vmdk",按"Finish"完成磁盘创建
1.b 为rac2添加新创建的虚拟硬盘,选中rac2, 单击"Edit virtual machine settings" 按"Add..."启动设备添加向导,选择设备类型为"Hard Disk",按"Next",选择"Use an existing virtual disk",按"Next","Existing disk File"中输入文件名为 "/vmware/rac/sharedisk/rac1-0.vmdk", 按"Finish"完成磁盘创建
2 创建新的,用于集群内部通讯的网卡, 单击"Edit virtual machine settings" 按"Add..."启动设备添加向导,选择"Ethernet Adapter", 按"Next",选择"Network connection"为"Host-only",按Finish"完成虚拟机的添加。
3 选择Ethernet 1,选择Connect at power on。
4 关闭vmware中rac1和rac2的页面,编辑虚拟机的配置文件rac1的配置文件为/vmware/rac/rac1/rac1.vmx,将
scsi0:1.present = "TRUE"
scsi0:1.fileName = "/vmware/rac/sharedisk/rac1-0.vmdk"
scsi0:1.redo = ""  <--这一行有可能没有。
修改为
scsi1:0.present = "TRUE"
scsi1:0.fileName = "/vmware/rac/sharedisk/rac1-0.vmdk"
scsi1:0.redo = ""
scsi1.sharedBus = "virtual"
disk.locking = "false"

5 
1 删除exim*和nvi 
rac1:~# apt-get remove -y --purge exim* nvi
Reading Package Lists... Done
Building Dependency Tree... Done
Note, selecting exim4-daemon-custom for regex 'exim*'
Note, selecting exim4-config for regex 'exim*'
Note, selecting exim4-daemon-light for regex 'exim*'
Note, selecting eximon4 for regex 'exim*'
Note, selecting exim4-config-2 for regex 'exim*'
Note, selecting exim4-config instead of exim4-config-2
Note, selecting exim-tls for regex 'exim*'
Note, selecting exim4-doc-info for regex 'exim*'
Note, selecting exim4-doc-html for regex 'exim*'
Note, selecting exim4-daemon-heavy for regex 'exim*'
Note, selecting exim for regex 'exim*'
Note, selecting exim4 for regex 'exim*'
Note, selecting exim4-base for regex 'exim*'
Note, selecting libexif10 for regex 'exim*'
Note, selecting texinfo for regex 'exim*'
The following packages will be REMOVED:
  at* exim4* exim4-base* exim4-config* exim4-daemon-light* mailx*
  mutt* nvi* texinfo*
0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 10.4MB disk space will be freed.
(Reading database ... 19535 files and directories currently installed.)
Removing at ...
Stopping deferred execution scheduler: atd.
Purging configuration files for at ...
Removing mutt ...
Purging configuration files for mutt ...
Removing mailx ...
Purging configuration files for mailx ...
Removing exim4 ...
Removing exim4-daemon-light ...
Stopping MTA: exim4.
Removing exim4-base ...
Purging configuration files for exim4-base ...
Removing exim4-config ...
Purging configuration files for exim4-config ...
Removing nvi ...
Purging configuration files for nvi ...
Removing texinfo ...


2 添加需要的软件 
rac1:~# apt-get install -y unzip\
>         vim lesstif2 gawk\
>
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  defoma fontconfig libexpat1 libfontconfig1 libfreetype6 libice6
  libsm6 libx11-6 libxext6 libxft2 libxp6 libxrender1 libxt6
  ttf-bitstream-vera ucf vim-common xfree86-common xlibs-data
Suggested packages:
  defoma-doc psfontmgr x-ttcidfont-conf dfontmgr libfreetype6-dev zip
  ctags vim-doc vim-scripts x-window-system-core x-window-system
Recommended packages:
  libft-perl debconf-utils
The following NEW packages will be installed:
  defoma fontconfig gawk lesstif2 libexpat1 libfontconfig1
  libfreetype6 libice6 libsm6 libx11-6 libxext6 libxft2 libxp6
  libxrender1 libxt6 ttf-bitstream-vera ucf unzip vim vim-common
  xfree86-common xlibs-data
0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/10.7MB of archives.
After unpacking 34.8MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package gawk.
(Reading database ... 19145 files and directories currently installed.)
Unpacking gawk (from .../g/gawk/gawk_3.1.4-2_i386.deb) ...
Selecting previously deselected package vim-common.
Unpacking vim-common (from .../vim-common_6.3-071+1_all.deb) ...
Selecting previously deselected package vim.
Unpacking vim (from .../v/vim/vim_6.3-071+1_i386.deb) ...
Selecting previously deselected package defoma.
Unpacking defoma (from .../defoma_0.11.8-0.1_all.deb) ...
Selecting previously deselected package libexpat1.
Unpacking libexpat1 (from .../libexpat1_1.95.8-3_i386.deb) ...
Selecting previously deselected package libfreetype6.
Unpacking libfreetype6 (from .../libfreetype6_2.1.7-2.4_i386.deb) ...
Selecting previously deselected package libfontconfig1.
Unpacking libfontconfig1 (from .../libfontconfig1_2.3.1-2_i386.deb) ...
Selecting previously deselected package ucf.
Unpacking ucf (from .../main/u/ucf/ucf_1.17_all.deb) ...
Moving old data out of the way
Selecting previously deselected package ttf-bitstream-vera.
Unpacking ttf-bitstream-vera (from .../ttf-bitstream-vera_1.10-3_all.deb) ...
Selecting previously deselected package fontconfig.
Unpacking fontconfig (from .../fontconfig_2.3.1-2_i386.deb) ...
Selecting previously deselected package xfree86-common.
Unpacking xfree86-common (from .../xfree86-common_4.3.0.dfsg.1-14_all.deb) ...
Selecting previously deselected package libice6.
Unpacking libice6 (from .../libice6_4.3.0.dfsg.1-14_i386.deb) ...
Selecting previously deselected package libsm6.
Unpacking libsm6 (from .../libsm6_4.3.0.dfsg.1-14_i386.deb) ...
Selecting previously deselected package xlibs-data.
Unpacking xlibs-data (from .../xlibs-data_4.3.0.dfsg.1-14_all.deb) ...
Selecting previously deselected package libx11-6.
Unpacking libx11-6 (from .../libx11-6_4.3.0.dfsg.1-14_i386.deb) ...
Selecting previously deselected package libxext6.
Unpacking libxext6 (from .../libxext6_4.3.0.dfsg.1-14_i386.deb) ...
Selecting previously deselected package libxrender1.
Unpacking libxrender1 (from .../libxrender1_0.8.3-7_i386.deb) ...
Selecting previously deselected package libxft2.
Unpacking libxft2 (from .../x/xft/libxft2_2.1.7-1_i386.deb) ...
Selecting previously deselected package libxp6.
Unpacking libxp6 (from .../libxp6_4.3.0.dfsg.1-14_i386.deb) ...
Selecting previously deselected package libxt6.
Unpacking libxt6 (from .../libxt6_4.3.0.dfsg.1-14_i386.deb) ...
Selecting previously deselected package lesstif2.
Unpacking lesstif2 (from .../lesstif2_0.93.94-11.4_i386.deb) ...
Selecting previously deselected package unzip.
Unpacking unzip (from .../u/unzip/unzip_5.52-1_i386.deb) ...
Setting up gawk (3.1.4-2) ...

Setting up defoma (0.11.8-0.1) ...

Setting up libexpat1 (1.95.8-3) ...

Setting up libfreetype6 (2.1.7-2.4) ...

Setting up ucf (1.17) ...

Setting up ttf-bitstream-vera (1.10-3) ...
Regenerating fonts cache... done.

Setting up xfree86-common (4.3.0.dfsg.1-14) ...
 Adding system startup for /etc/init.d/xfree86-common ...
   /etc/rcS.d/S70xfree86-common -> ../init.d/xfree86-common
Setting up X server socket directory /tmp/.X11-unix...done.
Setting up ICE socket directory /tmp/.ICE-unix...done.

Setting up libice6 (4.3.0.dfsg.1-14) ...

Setting up libsm6 (4.3.0.dfsg.1-14) ...

Setting up xlibs-data (4.3.0.dfsg.1-14) ...

Setting up libx11-6 (4.3.0.dfsg.1-14) ...

Setting up libxext6 (4.3.0.dfsg.1-14) ...

Setting up libxrender1 (0.8.3-7) ...

Setting up libxp6 (4.3.0.dfsg.1-14) ...

Setting up libxt6 (4.3.0.dfsg.1-14) ...

Setting up unzip (5.52-1) ...
Setting up vim-common (6.3-071+1) ...
Setting up libfontconfig1 (2.3.1-2) ...

Setting up libxft2 (2.1.7-1) ...

Setting up lesstif2 (0.93.94-11.4) ...

Setting up vim (6.3-071+1) ...

Setting up fontconfig (2.3.1-2) ...

Creating config file /etc/fonts/local.conf with new version
Updating font configuration of fontconfig...
Cleaning up category cid..
Cleaning up category truetype..
Cleaning up category type1..
Updating category type1..
Updating category truetype..
Updating category cid..
Regenerating fonts cache... done.

以上操作可以使用如下脚本完成
apt-get remove -y --purge exim* nvi
apt-get install -y unzip\
        vim lesstif2 gawk

3 apt-get install x-window-system-core
安装过程中将配置xserver-xfree86,"Attempt to autodetect video hardware"选择"Yes", 鼠标选择"/dev/psaux",鼠标类型选择”ImPS/2", 默认色深选择16,其他选默认值。

4 apt-get install gnome-core
安装过程中的寻问选默认值即可
5 安装iputils-arping,从如下地址下载需要的软件包
http://ftp.us.debian.org/debian/pool/main/i/iputils/iputils-arping_20020927-2_i386.deb
下载后使用dpkg -i iputils-arping_20020927-2_i386.deb安装

rac1:~# dpkg -i iputils-arping_20020927-2_i386.deb
Selecting previously deselected package iputils-arping.
(Reading database ... 34970 files and directories currently installed.)
Unpacking iputils-arping (from iputils-arping_20020927-2_i386.deb) ...
Setting up iputils-arping (20020927-2) ...


6 安装libaio,从如下地址下载需要的软件包
http://ftp.us.debian.org/debian/pool/main/liba/libaio/libaio_0.3.104-1_i386.deb
下载后使用dpkg -i libaio_0.3.104-1_i386.deb安装
rac1:~# dpkg -i libaio_0.3.104-1_i386.deb
Selecting previously deselected package libaio.
(Reading database ... 34976 files and directories currently installed.)
Unpacking libaio (from libaio_0.3.104-1_i386.deb) ...
Setting up libaio (0.3.104-1) ...

7 建立必要的符号连接

ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/sort /bin/sort
ln -s /usr/bin/basename /bin/basename
ln -s /etc /etc/rc.d
ln -s /usr/bin/wc /bin/wc
ln -s /usr/sbin/arping /sbin/arping


rpm的文体



6 设置虚拟机的网络及共享磁盘
1 通过"Home"->"Open Existing Virtual Machine"打开rac1,启动rac1.
2 在rac1上,修改/etc/network/interfaces文件添加如下内容
iface eth1 inet static
        address 10.10.10.181
        netmask 255.255.255.0
        network 10.10.10.0
        broadcast 10.10.10.255
并修改
auto eth0 
为
auto eth0 eth1
修改完成后,可以使用/etc/init.d/networking restart重新启动网络。

3  在rac1上,为硬盘进行分区

rac1:~# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1566.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1566, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1566, default 1566): +1024M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (126-1566, default 126):
Using default value 126
Last cylinder or +size or +sizeM or +sizeK (126-1566, default 1566): +1024M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (251-1566, default 251):
Using default value 251
Last cylinder or +size or +sizeM or +sizeK (251-1566, default 1566): +1024M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (376-1566, default 376):
Using default value 376
Last cylinder or +size or +sizeM or +sizeK (376-1566, default 1566):
Using default value 1566

Command (m for help): p

Disk /dev/sdb: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         125     1004031   83  Linux
/dev/sdb2             126         250     1004062+  83  Linux
/dev/sdb3             251         375     1004062+  83  Linux
/dev/sdb4             376        1566     9566707+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
rac1:~# fdisk -l /dev/sd?

Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1498    12032653+  83  Linux
/dev/sda2            1499        1566      546210    5  Extended
/dev/sda5            1499        1566      546178+  82  Linux swap / Solaris

Disk /dev/sdb: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         125     1004031   83  Linux
/dev/sdb2             126         250     1004062+  83  Linux
/dev/sdb3             251         375     1004062+  83  Linux
/dev/sdb4             376        1566     9566707+  83  Linux
rac1:~#
4 通过"Home"->"Open Existing Virtual Machine"打开rac2,启动rac2.
5 在rac1上,修改/etc/network/interfaces文件添加如下内容
iface eth1 inet static
        address 10.10.10.182
        netmask 255.255.255.0
        network 10.10.10.0
        broadcast 10.10.10.255
并修改
auto eth0 
为
auto eth0 eth1
修改完成后,使用/etc/init.d/networking restart重新启动网络。
6 在rac2上使用fdisk -l /dev/sd?查看分区情况。
rac2:~# fdisk -l /dev/sd?

Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1498    12032653+  83  Linux
/dev/sda2            1499        1566      546210    5  Extended
/dev/sda5            1499        1566      546178+  82  Linux swap / Solaris

Disk /dev/sdb: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         125     1004031   83  Linux
/dev/sdb2             126         250     1004062+  83  Linux
/dev/sdb3             251         375     1004062+  83  Linux
/dev/sdb4             376        1566     9566707+  83  Linux
rac2:~#

7 修改/etc/hosts为如下内容 
127.0.0.1       localhost.localdomain   localhost
192.168.0.181   rac1
192.168.0.182   rac2

192.168.0.191   rac1-vip
192.168.0.192   rac2-vip

10.10.10.181    rac1-priv
10.10.10.182    rac2-priv

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

7 设置用户和用户组
添加组nobody
groupadd nobody

groupadd oinstall ;groupadd dba;useradd -g oinstall -G dba,oinstall oracle;id oracle
mkdir /home/oracle;chown oracle:oinstall /home/oracle;ls -al /home
mkdir -p /u01/app/oracle;chown oracle:oinstall /u01/app/oracle;ls -al /u01/app
chsh oracle -s /bin/bash
passwd oracle

rac2:~# groupadd oinstall ;groupadd dba;useradd -g oinstall -G dba,oinstall oracle;id oracle
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)
rac2:~# mkdir /home/oracle;chown oracle:oinstall /home/oracle;ls -al /home
total 16
drwxrwsr-x   4 root   staff    4096 2005-11-20 16:22 .
drwxr-xr-x  21 root   root     4096 2005-11-19 05:55 ..
drwxr-xr-x   2 debian debian   4096 2005-11-18 22:31 debian
drwxr-sr-x   2 oracle oinstall 4096 2005-11-20 16:22 oracle
rac2:~# mkdir -p /u01/app/oracle;chown oracle:oinstall /u01/app/oracle;ls -al /u01/app
total 12
drwxr-xr-x  3 root   root     4096 2005-11-20 16:22 .
drwxr-xr-x  3 root   root     4096 2005-11-20 16:22 ..
drwxr-xr-x  2 oracle oinstall 4096 2005-11-20 16:22 oracle
rac2:~# chsh oracle -s /bin/bash
rac2:~# passwd oracle
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
设置oracle用户环境变量,编辑/home/oracle/.bash_profile,加入下面的内容
export ORACLE_BASE=/u01/app/oracle

8 如下内容添加到/etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
然后运行sysctl -p
ssh drac1 "sysctl -p"

9 配置裸设备
建立文件/etc/rawconfig,内容如下
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
/dev/raw/raw3 /dev/sdb3
/dev/raw/raw4 /dev/sdb4

建立文件/etc/init.d/rawdevices,内容如下:
#!/bin/bash
#
# rawdevices       This shell script assignes rawdevices to block devices
#
# chkconfig: 345 56 44
# description: This scripts assignes raw devices to block devices \
#              (such as hard drive partitions). This is for the use \
#              of applications such as Oracle. You can set up the \
#              raw device to block device mapping by editing \
#              the file /etc/sysconfig/rawdevices. Note that the use \
#              of raw devices is deprecated, and applications should \
#              open regular block devices with O_DIRECT instead.
#
# config: /etc/sysconfig/rawdevices

[ -f /sbin/raw ] || exit 0
[ -f /etc/rawconfig ] || exit 0
# Exit if the file just has the default comments.
LC_ALL=C /bin/egrep -q -v "^ *#" /etc/rawconfig 2>/dev/null || exit 0



function assign_raw()
{
   LC_ALL=C egrep -v '^ *#' /etc/rawconfig |
   while read RAW BLOCK; do
     if [ -n "$RAW" -a -n "$BLOCK" ]; then
         rawdirname=${RAW%/*}
         if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then
           echo $"  Please correct your /etc/rawconfig:"
           echo $"     rawdevices are now located in the directory /dev/raw/ "
           echo $"  If the command 'raw' still refers to /dev/raw as a file."
           echo $"   you'll have to upgrade your util-linux package"
           exit 0
         fi
         if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then
           echo $"  Please correct your /etc/rawconfig:"
           echo $"     rawdevices are now located in the directory /dev/raw/ "
           echo $"  If the command 'raw' still refers to /dev/raw as a file."
           echo $"   you'll have to upgrade your util-linux package"
           exit 0
         fi

       echo "           $RAW  -->   $BLOCK";
       raw $RAW $BLOCK
     fi
   done
}

# See how we were called.
case "$1" in
  start)
        # Assign devices
        echo $"Assigning devices: "
        assign_raw
        echo $"done"
        ;;
  stop)
        # No action to be taken here
        ;;

  status)
        ID=`id -u`
        if [ $ID -eq 0 ]; then
          raw -qa
        else
          echo $"You need to be root to use this command ! "
        fi
        ;;

  restart|reload)
        $0 start
        ;;

  *)
        echo $"Usage: $0 {start|stop|status|restart}"
        exit 1
esac

exit 0

chmod a+x /etc/init.d/rawdevices
ln -s /etc/init.d/rawdevices /etc/rc2.d/S20rawdevices
cd /dev;./MAKEDEV raw
/etc/init.d/rawdevices restart
可以使用raw -qa查询raw绑定的情况

设置裸设备的权限
chown oracle:oinstall /dev/raw/raw*;ls -al /dev/raw

设置用户信任关系
1以oracle用户身份登入系统,或使用root登陆,然后使用su -将身份切换到oracle
2 在rac1,rac2上分别运行ssh-keygen -t rsa 
oracle@rac2:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Created directory '/home/oracle/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
71:c9:1c:d3:0a:35:41:41:81:64:e9:7a:0b:50:aa:aa oracle@rac2
oracle@rac2:~$

3 将rac1上oracle用户的公钥添加到rac1的.ssh/authorized_keys中
cat /home/oracle/.ssh/id_rsa.pub >>/home/oracle/.ssh/id_rsa.pub

4 复制rac2上oracle用户的公钥
oracle@rac1:~/.ssh$ ssh rac2 "cat .ssh/id_rsa.pub">>/home/oracle/.ssh/authorized_keys
Password:
oracle@rac1:~/.ssh$

5 将rac1的authorized_keys文件复制到rac2上
scp /home/oracle/.ssh/authorized_keys rac2:.ssh/

6 在rac1上运行如下命令
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
运行过程中将提示输入yes
在运行的过程中将会吧每个主机的公钥添加到known_hosts中

7 将rac1的known_hosts文件复制到rac2上
scp known_hosts rac2:.ssh/

8 在rac2上运行如下命令
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
在运行过程中将不会提示任何输入


重新启动机器

安装oracle crs
1 以oracle登陆rac1,然后使用startx启动图形界面
2 打开一个终端,运行/mnt/oracle/10201/clusterware/runInstaller -IgnoreSysPreReqs启动安装界面
3 Welcome, 按"Next"
4 Specify Inventory Directory and credentials "Enter the full path of the inventory directory" 中输入"/u01/app/oracle/oraInventory"(默认), "Specify Operating System group name:"中输入"oinstall"(默认),按"Next"
5  Specify Home Details中指定目录Name 中输入"OraCrs10g_home(默认),Path中输入"/u01/app/oacle/product/10.2.0/crs"( 默认值为"/u01/app/oacle/oracle/product/10.2.0/crs",最好修改), 按"Next"
6 指定集群配置,按"add",Public Node Name: 中输入 "rac2", Private Node Name:中输入"rac2-priv",virtual host name中输入"rac2-vip" 按"Ok"添加节点。按"next"进入下一步配置。
7  "Specify Network Interface Usage" 指定网络设置选择eth0,点"Edit",将"Interface Type"设置为"Public", 然后点"OK"确认,按"Next"
8  "Specify Oracle cluster Registry(OCR) Location", 将"OCR Configuration"设置为"External Redundancy","Specify OCR Location" 为/dev/raw/raw1,按"Next".
9 "Specify voting Disk Location" "Voting Disk configuration"设置为"External Redundancy", Voting Disk Location设置为"/dev/raw/raw2",按"Next".
10  "Summary" 按"Install"开始安装
11 安装结束后oui提示以root身份执行两个配置脚本/u01/app/oracle/oraInventory/orainstRoot.sh和 /u01/app/oracle/product/10.2.0/crs/root.sh
在rac1,rac2上分别运行/u01/app/oracle/oraInventory/orainstRoot.sh
rac1:~# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete

修改$ORACLE_CRS_HOME/crs/admin/init.crsd,将第79行
  $SU -l $ORACLE_USER -c "$ECHO \$TZ > /tmp/oratz.$$ " > /dev/null 2>&1
修改为
  $SU - $ORACLE_USER -c "$ECHO \$TZ > /tmp/oratz.$$ " > /dev/null 2>&1

修改$ORACLE_CRS_HOME/crs/admin/inittab,将
h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null
修改为
h1:23:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
h2:23:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
h3:23:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null

修改$ORACLE_CRS_HOME/css/admin/init.cssd,将第 181行
      SU="/bin/su -l"
修改为
       SU="/bin/su -"

修改$ORACLE_CRS_HOME/css/admin/inittab_local,将
h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null
修改为
h1:23:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null

修改$ORACLE_CRS_HOME/evm/admin/init.evmd,将第65行
      SU="/bin/su -l"
修改为
       SU="/bin/su -"
将$ORACLE_CRS_HOME/install/rootconfig 第344,345行
       RCSDIR="/etc/rc.d/rc3.d /etc/rc.d/rc5.d"
       RCKDIR="/etc/rc.d/rc0.d /etc/rc.d/rc1.d /etc/rc.d/rc2.d /etc/rc.d/rc4.d /etc/rc.d/rc6.d"
修改为 
       RCSDIR="/etc/rc.d/rc3.d /etc/rc.d/rc2.d"
       RCKDIR="/etc/rc.d/rc0.d /etc/rc.d/rc1.d /etc/rc.d/rc5.d /etc/rc.d/rc4.d /etc/rc.d/rc6.d"

运行/u01/app/oracle/product/10.2.0/crs/root.sh
rac1:/u01/app/oracle/product/10.2.0/crs# /u01/app/oracle/product/10.2.0/crs/root.sh
WARNING: directory '/u01/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        rac1
CSS is inactive on these nodes.
        rac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.
rac1:/u01/app/oracle/product/10.2.0/crs#


rac2:/u01/app/oracle/product/10.2.0/crs# ./root.sh
WARNING: directory '/u01/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u01/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
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 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        rac1
        rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
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), "eth0" is not public. Public interfaces should be used to configure virtual IPs.

以root的身份运行$ORACLE_CRS_HOME/bin/vipca,需要图形界面
 Welcome,按"Next",network interface 选择eth0,按"next", rac1 的 ip alias name 设置为rac1-vip ip address设置为192.168.0.191
rac2的ip alias name 设置为rac2-vip,ip address 设置为192.168.0.192,按"Next", 出现summary按"Finish" 万成设定。等待配制万成后点”OK“却认,弹出"configuration Results",按"Exit"退出
反回安装界面,点"Ok"却认完成root脚本的运行
点"Exit"完成crs的安装。
  

安装oracle 数据库
1 /mnt/oracle/10201/database/runInstaller -IgnoreSysPreReqs
2 Welcome  按Next
3 Select Installation Type 选择"Enterprise Edition"(默认),按"Product Languages",从Available Languages"中选择"Simplified Chinese“按">"将"Simplified Chinese"添加到"Selected Languages"中,按"Ok"确认,按"Next"进入下一步安装
4 Specify Home Details,指定Name为"OraDb10g_home1"(默认),Path为/u01/app/oracle/product/10.2.0/db_1( 默认为/u01/app/oracle/oracle/product/10.2.0/db_1) 按"Next"进入下一步安装
5 "Specify hardware cluster Installation Mode"点"Select All"选择所有节点,按"Next"
6 "Select configuration Option"选择"Install database Software only",按"Next"
7 出现Summary,按Install开始安装
安装结束后oui提示以root身份执行两个配置脚本/u01/app/oracle/oraInventory/orainstRoot.sh和 /u01/app/oracle/product/10.2.0/db_1/root.sh

rac1:~# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
rac1:/u01/app/oracle/product/10.2.0/db_1# ./root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_1

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 /etc/oratab file...
Entries will be added to the /etc/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.

rac1:/u01/app/oracle/product/10.2.0/db_1#


配置监听器
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
运行 /u01/app/oracle/product/10.2.0/db_1/bin/netca 启动Oracle Net configuration Assistant
Select the type of Oracle Net services configuration:,选择"Cluster configuration",按Next
Select the nodes to configure 默认选择所有所有节点,按"Next"
Welcome 选择"Listener Configuration"(默认),按"Next"
Listener configuration, Listener,Select what you want to do:选择"Add"(默认),按"Next"
Listener name 默认值为LISTENER,按"Next"
Select Protocols,Selected Protocols中,可选的协议有TCPS,TCP,IPC,默认选择"TCP" ,按Next
TCP/IP Protocol 选择"Use the standard port number of 1521"(默认),按"Next"
More Listener,Would you like to configure another listener, 选择No(默认),按Next
Listener Configuration Compelete.按"Next"
按Finish结束监听器的配置

建立数据库
/u01/app/oracle/product/10.2.0/db_1/bin/dbca启动Database Configuration Assistant
Welcome选择Oracle Real Application Cluster database(默认),按"Next"
Oprations选择Configure Automatic Storage Management(默认为Create a Database ),按"Next"
Node Selection按"Select All",选择所有节点(默认只选择当前节点),按"Next"
Create ASM Instance,在SYS password和Confirm SYS password后输入sys的密码,选择Create server parameter file SPFILE指定Server Parameter Filename为/dev/raw/raw3,按"Next"
提示DBCA将创建和启动ASM实例,按"OK"确认
ASM Disk Groups,按"Create New"创建新的磁盘组,弹出Create Disk Group,Disk Group name中输入DATA,Redundancy选择External(默认为Normal), Select Member Disks选择/dev/raw/raw4,按"OK"确定。
按Finish完成磁盘组创建,寻问是否进行其他操作,由于我们希望创建数据库,所以选择Yes
选择Create a Database 按Next
Node Selection按"Select All",选择所有节点(默认只选择当前节点),按"Next"
Database Templates选择General Purpose(默认),按"Next"
Database Identification, Global Database Name输入orcl,SID Prefix中输入orcl,按"Next"
Management Options,选择Configure the Database with Enterprise manager(默认),按Next
Database Credentials,选择Use the Same Password for All Accounts(默认), 在Password和Confirm Password中输入sys/system/dbsnmp/sysman的密码,按"Next"
Storage Options选择Automatic Storage Management(ASM)(默认为Cluster File System), 按"Next"
ASM Disk Groups 选择DATA作为我们存放数据的磁盘组(默认),按Next
Database File Locations 选择Use Oracle-Managed files(默认),Database Area中输入"+DATA"(默认),按Next
Recovery configuration  选择Specify Flash Recovery Area(默认),Flash Recovery Area输入"+DATA"(默认),Flash Recovery Area Size 输入2048(默认),按Next
Database content 取消选择 Sample Schemas(默认处于取消选择状态),按"Next"
Database Services 按Next
提示没有足够的内存,按OK确认
Initialization Parameters,选择Character Sets页面 Database Character Set选择Choose from the list of character sets并从下拉列表中选择ZHS16GBK, National Character Set 选择AL16UTF16默认,按"Next"
Database Storage ,按"Next"
Create Option,按"Finish"
出现Summary页面,按"OK"开始数据库创建过程。
创建完毕后会给出一些提示信息,按Exit退出
至此debian下的oracle rac安装完毕
 

1 网络设定

mei1/eth0  192.168.0.181/24 gateway 192.168.0.1		eth1 10.10.10.181/24	gateway none
mei2/eth1  192.168.0.182/24 gateway 192.168.0.1		eth1 10.10.10.182/24	gateway none

lan1/eth0  192.168.0.191/24 gateway 192.168.0.1		eth1 10.10.10.191/24	gateway none
lan1/eth1  192.168.0.192/24 gateway 192.168.0.1		eth1 10.10.10.192/24	gateway none

Attachment: pgp958bSLE5iI.pgp
Description: PGP signature


Reply to: