11GR2单实例安装(ASM)

环境:
OS:Red Hat Linux As 5
DB:11.2.0.1
 
------------------------------------------Linux 安装11GR2软件部分---------------------------------------

1.下载安装软件

[root@hxl soft]# ls -1

linux_11gR2_database_1of2.zip

linux_11gR2_database_2of2.zip

linux_11gR2_grid.zip

 

2.解压压缩包

[root@hxl soft]unzip linux_11gR2_database_1of2.zip

[root@hxl soft]unzip linux_11gR2_database_2of2.zip

[root@hxl soft]unzip linux_11gR2_grid.zip

 

3.配置相应参数

vi /etc/security/limits.conf

添加如下内容:

# Oracle-Validated setting for nofile soft limit is 131072
oracle   soft   nofile    131072
# Oracle-Validated setting for nofile hard limit is 131072
oracle   hard   nofile    131072
# Oracle-Validated setting for nproc soft limit is 131072
oracle   soft   nproc    131072
# Oracle-Validated setting for nproc hard limit is 131072
oracle   hard   nproc    131072
# Oracle-Validated setting for core soft limit is unlimited
oracle   soft   core    unlimited
# Oracle-Validated setting for core hard limit is unlimited
oracle   hard   core    unlimited
# Oracle-Validated setting for memlock soft limit is 50000000
oracle   soft   memlock    50000000
# Oracle-Validated setting for memlock hard limit is 50000000
oracle   hard   memlock    50000000

# Oracle-Validated setting for nofile soft limit is 131072
grid   soft   nofile    131072
# Oracle-Validated setting for nofile hard limit is 131072
grid   hard   nofile    131072
# Oracle-Validated setting for nproc soft limit is 131072
grid   soft   nproc    131072
# Oracle-Validated setting for nproc hard limit is 131072
grid   hard   nproc    131072
# Oracle-Validated setting for core soft limit is unlimited
grid   soft   core    unlimited
# Oracle-Validated setting for core hard limit is unlimited
grid   hard   core    unlimited
# Oracle-Validated setting for memlock soft limit is 50000000
grid   soft   memlock    50000000
# Oracle-Validated setting for memlock hard limit is 50000000
grid   hard   memlock    50000000

 

 

vi /etc/sysctl.conf

添加如下内容

# Kernel sysctl configuration file for Oracle Enterprise Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
# See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt
net.ipv4.conf.default.rp_filter = 2

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes

# Controls the default maxmimum size of a mesage queue

# Controls the maximum shared segment size, in bytes

# Controls the maximum number of shared memory segments, in pages

# For 11g, Oracle-Validated setting for fs.file-max is 6815744
# For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
# fs.file-max = 327679
fs.file-max = 6815744

# Oracle-Validated setting for kernel.msgmni is 2878
kernel.msgmni = 2878

# Oracle-Validated setting for kernel.msgmax is 8192
kernel.msgmax = 8192

# Oracle-Validated setting for kernel.msgmnb is 65536
kernel.msgmnb = 65536

# Oracle-Validated setting for kernel.sem is '250 32000 100 142'
kernel.sem = 250 32000 100 142

# Oracle-Validated setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# Oracle-Validated setting for kernel.shmall is 1073741824
kernel.shmall = 1073741824

# Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
kernel.shmmax = 4398046511104

# Oracle-Validated setting for kernel.sysrq is 1
kernel.sysrq = 1

# Oracle-Validated setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
# For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
# net.core.rmem_max = 2097152
net.core.rmem_max = 4194304

# Oracle-Validated setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
# For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
# net.core.wmem_max = 262144
net.core.wmem_max = 1048576

# Oracle-Validated setting for fs.aio-max-nr is 3145728
fs.aio-max-nr = 3145728

# For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
# For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
# net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_local_port_range = 9000 65500

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200

 

注意64bit的系统kernel.shmmax设置建议是物理内容的一半.

参数设置完成后需要重系统,参数才能生效.

 

4.创建oracle用户和dba,oinstall组

[root@hxl soft]#groupadd oinstall

[root@hxl soft]#groupadd dba

[root@hxl soft]#mkdir -p /u01/export/home

[root@hxl soft]#useradd -d /u01/export/home/oracle -g oinstall -G dba -s /bin/bash oracle -m

[root@hxl soft]#chown oracle:dba /u01/export/home/oracle /u01

[root@hxl soft]#passwd oracle

 

5.使用oracle用户登录,设置环境变量

export PS1='['`hostname`':$LOGIN:$PWD]$'

export EDITOR=vi

export ORACLE_SID=oracl

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/bin:/sbin

export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

 

6.创建环境变量中定义的目录

[oracle@hxl /]$mkdir -p $ORACLE_BASE

[oracle@hxl /]$mkdir -p $ORACLE_BASE/product/11.2.0/db_1

 

7.安装oracle软件(选择只安装软件)

进入数据库软件目录

[oracle@hxl database]$ ./runInstaller

安装过程中将检查项需要安装的包都安装上,安装包在安装介质中可以找到.

 

---------------------------------------------------安装ASMlib部分------------------------------------------

1.       查看系统内核

[grid@hxl grid_soft]$ uname -r

2.6.18-8.el5

 

1.       按照如下顺序安装asmlib

[root@hxl asmlib]# rpm -ivh oracleasm-support-2.1.7-1.el5.i386.rpm

[root@hxl asmlib]# rpm -ivh oracleasm-2.6.18-8.el5-2.0.4-1.el5.i686.rpm

[root@hxl asmlib]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm

 

3. 设置ASM驱动

[root@hxl asmlib]# /etc/init.d/oracleasm configure

Configuring the Oracle ASM library driver.

 

This will configure the on-boot properties of the Oracle ASM library

driver.  The following questions will determine whether the driver is

loaded on boot and what permissions it will have.  The current values

will be shown in brackets ('[]').  Hitting <ENTER> without typing an

answer will keep that current value.  Ctrl-C will abort.

 

Default user to own the driver interface []: oracle

Default group to own the driver interface []: oinstall

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver:                     [  OK  ]

Scanning the system for Oracle ASMLib disks:               [  OK  ]

 

4. 查看当前磁盘

[root@hxl asmlib]# fdisk -l

 

Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *         201        2610    19358325   83  Linux

/dev/sda2               1         200     1606468+  82  Linux swap / Solaris

 

Partition table entries are not in disk order

 

Disk /dev/sdb: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

 

Disk /dev/sdc: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

 

5. 对sdb和sdc进行分区(具体步骤省略)

[root@hxl dev]# fdisk /dev/sdb

[root@hxl dev]# fdisk /dev/sdc

 

分区后的结果如下:

[root@hxl dev]# fdisk -l

 

Disk /dev/sda: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *         201        2610    19358325   83  Linux

/dev/sda2               1         200     1606468+  82  Linux swap / Solaris

 

Partition table entries are not in disk order

 

Disk /dev/sdb: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        1044     8385898+  83  Linux

 

Disk /dev/sdc: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1        1044     8385898+  83  Linux

 

6. 我们将分别在/dev/sdb1和/dev/sdc1上创建两个ASM磁盘

[root@hxl dev]#/etc/init.d/oracleasm createdisk VOL1 /dev/sdb1

[root@hxl dev]#/etc/init.d/oracleasm createdisk VOL2 /dev/sdc1

 

7.查看ASM磁盘

[root@hxl dev]# oracleasm listdisks

VOL1

VOL2

 

-------------------------------------------------安装GRID软件部分---------------------------------------

1.创建group

查看当前的group

[oracle@hxl 8670579]$ tail -10 /etc/group

slocate:x:21:

gdm:x:42:

distcache:x:94:

apache:x:48:

webalizer:x:67:

squid:x:23:

xfs:x:43:

sabayon:x:86:

oinstall:x:500:

dba:x:501:oracle

 

创建group

[root@hxl ~]#groupadd -g 502 asmadmin

[root@hxl ~]#groupadd -g 503 asmdba

[root@hxl ~]#groupadd -g 504 asmoper

 

2.创建grid用户

[root@hxl ~]# useradd -d /u01/export/home/grid -g oinstall -G asmadmin,asmdba,asmoper grid -m

[root@hxl ~]# passwd grid

 

3.使用grid用户登录,添加环境变量,然后重新登录

cd ~

vi .bash_profile

 

export PS1=[`hostname`/`whoami`]$

export EDITOR=vi

export ORACLE_SID=+ASM

export ORACLE_BASE=/u01/grid

export ORACLE_HOME=/u01/gridsoft

export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/bin:/sbin

export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

 

4.创建环境中定义的目录

[root@hxl ~]# mkdir -p /u01/grid

[root@hxl ~]# mkdir -p /u01/gridsoft

[root@hxl ~]# chown -R grid:oinstall /u01/grid

[root@hxl ~]# chown -R grid:oinstall /u01/gridsoft

 

6.安装grid

[grid@hxl grid]$ ./runInstaller

 

选择单机安装

 

选择语言

 

创建磁盘组

 

设置密码(密码必须包含大写字母和数字)

 

指定OS

 

安装前检查,将检查错误的每项进行修复

 

指定安装目录

 

root用户执行提示的脚本

 

点击finish进行安装

 

 

-- The End --

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值