专业编程教程与实战项目分享平台

网站首页 > 技术文章 正文

Oracle 11gR2 RAC 安装流程 - 3 oracle11gr2client安装

ins518 2024-11-11 13:27:58 技术文章 10 ℃ 0 评论

【三】建立本地盘和共享盘

3.1 添加本地磁盘(动态)

Node1:

添加20G本地盘(/u01),添加磁盘虚拟机需要处于关闭状态。

[root@tim1 ~]# shutdown -h now

添加SCSI盘,注意规范,磁盘叫node1-disk2.vdi,放在/RAC/node1的目录下。

Node2:同上

3.2 添加共享盘(固定)

1)建立共享磁盘

Node1:

注意规范,磁盘叫sharedisk.vdi,放在/RAC/sharedisk的目录下。

设置为可共享。

2)识别共享盘

Node2:

3)验证共享盘,启动两节点,node1先启动,node2随后再启动。

检查两节点都能看到同一块共享盘

[root@tim1 ~]# ls -al /dev/sd*
[root@tim2 ~]# ls -al /dev/sd*

sda表示第一块磁盘

sda1表示第一块磁盘的第一个分区

sda2表示第一块磁盘的第二个分区

sdb表示第二块磁盘

sdc 表示第三块磁盘

3.3分区并格式化本地盘(这就是/u01)

Node1:

整个一个区都给它:

[root@tim1 ~]# 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 2610.
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-2610, default 1): enter
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Node2:同上

3.4分配共享盘

共10个分区(1+1+1)+(5+5)+(4+4)+(3+3+3)=30G

Node1:

[root@tim1 ~]# fdisk /dev/sdc
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 3916.
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-3916, default 1): enter
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916): +1G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (124-3916, default 124):enter
Using default value 124
Last cylinder or +size or +sizeM or +sizeK (124-3916, default 3916): +1G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (247-3916, default 247):enter
Using default value 247
Last cylinder or +size or +sizeM or +sizeK (247-3916, default 3916): +1G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e 开始扩展分区
Selected partition 4
First cylinder (370-3916, default 370):enter
Using default value 370
Last cylinder or +size or +sizeM or +sizeK (370-3916, default 3916): enter
Using default value 3916
Command (m for help): n
First cylinder (370-3916, default 370):enter
Using default value 370
Last cylinder or +size or +sizeM or +sizeK (370-3916, default 3916): +5G
Command (m for help): n
First cylinder (979-3916, default 979):enter
Using default value 979
Last cylinder or +size or +sizeM or +sizeK (979-3916, default 3916): +5G
Command (m for help): n
First cylinder (1588-3916, default 1588):enter
Using default value 1588
Last cylinder or +size or +sizeM or +sizeK (1588-3916, default 3916): +4G
Command (m for help): n
First cylinder (2075-3916, default 2075):enter
Using default value 2075 enter
Last cylinder or +size or +sizeM or +sizeK (2075-3916, default 3916): +4G
Command (m for help): n
First cylinder (2562-3916, default 2562):enter
Using default value 2562
Last cylinder or +size or +sizeM or +sizeK (2562-3916, default 3916): +3G
Command (m for help): n
First cylinder (2928-3916, default 2928):enter
Using default value 2928
Last cylinder or +size or +sizeM or +sizeK (2928-3916, default 3916): +3G
Command (m for help): n
First cylinder (3294-3916, default 3294): enter
Using default value 3294
Last cylinder or +size or +sizeM or +sizeK (3294-3916, default 3916): +3G
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Node2: 不需做共享分区,能看到共享盘就行了。

两个节点看到磁盘分区是一模一样的,如果Node2看不到盘,可能需要查探一下。

[root@tim2 dev]# partprobe /dev/sdc

3.5将本地盘/dev/sdb1分别格式化,然后自动挂载:

Node1:

[root@tim1 ~]# mkfs.ext3 /dev/sdb1
[root@tim1 ~]# mount /dev/sdb1 /u01
[root@tim3 ~]# df
[root@tim1 ~]# vi /etc/fstab

最后一行添加,下次启动有效:

/dev/sdb1 /u01 ext3 defaults 0 0

Node2:同上

【注】:/etc/fstab描述一定要正确,否则启动无法完成。

3.6添加swap分区

Node1:

swap分区大小的设置:一般要求为内存的2倍。

[root@tim1 ~]# free –m 查看内存空间分配
[root@tim1 ~]# df –h 查看磁盘空间分配
[root@tim1 ~]# ls –al /u01 查看/u01下文件信息

1)先用dd命令生成一个空文件,把它放在/u01下,单位1024m,设置2G。

【注】:新添swap不要放到根目录消耗根空间,另外bs的单位M要大写,名字随便。

[root@tim1 ~]# dd if=/dev/zero of=/u01/swap1 bs=1M count=2048

2)创建一个swap类型文件。

[root@tim1 ~]# mkswap /u01/swap1

3)将swpf1生成swap文件。

[root@tim1 ~]# swapon /u01/swap1

查看一下,swap1起作用了。

[root@tim1 ~]# free –m

4)实现开机后自动使用新添的swap1分区。

[root@tim1 ~]# vi /etc/fstab

添加swap行

/u01/swap1 swap swap defaults 0 0

5)修改tmpfs行。

tmpfs /dev/shm tmpfs defaults,size=2G 0 0

6)tmpfs重置一下,使其当下有效。

[root@tim1 ~]# mount -o remount /dev/shm

tmpfs一般设为交换区大小的一半。

Node2:同上

3.7检测配置状态。



the end !!!

@jackman 共筑美好!

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表