您好,登錄后才能下訂單哦!
1. 準(zhǔn)備工作
(1) 操作系統(tǒng)版本
[root@AS5 ~]# uname -a
Linux AS5 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux
(2) Yum倉庫創(chuàng)建
[root@AS5 ~]# mount -o remount /dev/hdc /mnt
[root@AS5 ~]# cat /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
[root@AS5 ~]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@AS5 ~]# yum grouplist
(3) 硬盤、內(nèi)存等信息
[root@AS5 ~]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 17G 2.7G 14G 17% /
/dev/sda1 104M 12M 87M 12% /boot
tmpfs 1.1G 0 1.1G 0% /dev/shm
/dev/hdc 3.1G 3.1G 0 100% /mnt
[root@AS5 ~]# free -m
total used free shared buffers cached
Mem: 1010 239 771 0 15 184
-/+ buffers/cache: 39 971
Swap: 2000 0 2000
(4) 網(wǎng)絡(luò)配置
[root@AS5 ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:C7:70:76
inet addr:172.24.0.200 Bcast:172.24.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec7:7076/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1343052 errors:31 dropped:31 overruns:0 frame.:0
TX packets:113486 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2019886062 (1.8 GiB) TX bytes:11644712 (11.1 MiB)
Interrupt:75 Base address:0x2000
[root@AS5 ~]# hostname
AS5
[root@AS5 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=AS5
GATEWAY=172.24.0.1
[root@AS5 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost AS5
::1 localhost6.localdomain6 localhost6
172.24.0.200 AS5
(5) 安裝必要的軟件包
oracle要求的必要軟件包如下:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11
安裝方法:(安裝時(shí)我添加了這兩個(gè)包:libXp pdksh)
[root@AS5 ~]# yum –y install binutils compat-* elfutils-libelf* gcc gcc-c++ glibc* kernel-headers ksh libaio* libgcc libgomp libstdc++* make sysstat unixODBC* libXp pdksh
(6) 建立用戶及組
[root@AS5 ~]# groupadd oinstall
[root@AS5 ~]# groupadd dba
[root@AS5 ~]# groupadd asmadmin
[root@AS5 ~]# groupadd asmdba
[root@AS5 ~]# useradd -g oinstall -G asmdba,asmadmin,dba grid
[root@AS5 ~]# useradd -g oinstall -G dba,asmdba oracle
[root@AS5 ~]# passwd grid
[root@AS5 ~]# passwd oracle
[root@AS5 ~]# id grid
uid=500(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(asmadmin),503(asmdba)
[root@AS5 ~]# id oracle
uid=501(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),503(asmdba)
(7) 配置內(nèi)核參數(shù)及其他配置選項(xiàng)
在/etc/sysctl.conf配置文件中添加如下:
#===================oracle11gr2=====================
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
然后執(zhí)行:
[root@AS5 ~]# sysctl -p
再在/etc/security/limits.conf配置文件中添加:
#====================oracle11gr2======================
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
在/etc/pam.d/login配置文件中添加:
#=================oracle11gr2=====================
session required pam_limits.so
在/etc/profile配置文件中添加:
#===================oracle11gr2=====================
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
(8) 建立相應(yīng)目錄
[root@AS5 ~]# mkdir -p /u01/app/oracle
[root@AS5 ~]# chown -R oracle:oinstall /u01
[root@AS5 ~]# chmod -R 775 /u01
(9) 配置grid、oracle用戶的環(huán)境變量
在~grid/.bash_profile配置文件中添加:
#========================oracle11gr2—grid ============================
umask 022
TMP=/tmp
TMPDIR=/tmp
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ORACLE_BASE=/u02/app/grid
ORACLE_HOME=$ORACLE_BASE/11.2.0
ORACLE_SID=+ASM
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH TMP TMPDIR
#stty erase ^h
在~oracle/.bash_profile配置文件中添加:
#======================oracle11gr2=========================
umask 022
TMP=/tmp
TMPDIR=/tmp
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
ORACLE_SID=ora10
LD_LIBRARY_PATH=$ORACLE_HOME/jdk/jre/lib/i386:$ORACLE_HOME/jdk/jre/lib/i386/server:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH
NLS_LANG=American_America.ZHS16GBK
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH NLS_LANG TMP TMPDIR
stty erase ^h
至此,整個(gè)環(huán)境搭建完畢。如果可以,建議重啟系統(tǒng)。
2.安裝ASM存儲(chǔ)(grid)
說明:如果數(shù)據(jù)庫文件直接存儲(chǔ)在文件系統(tǒng)中,這一步可以略過。
(1) 系統(tǒng)現(xiàn)在有空閑的分區(qū)
[root@AS5 install]# fdisk -l /dev/sdb
Disk /dev/sdb: 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/sdb1 1 2610 20964793+ 5 Extended
/dev/sdb5 1 366 2939832 83 Linux
/dev/sdb6 367 732 2939863+ 83 Linux
/dev/sdb7 733 1098 2939863+ 83 Linux
/dev/sdb8 1099 1342 1959898+ 83 Linux
[root@AS5 u02]# chown grid:asmadmin /dev/sdb?
[root@AS5 u02]# ls -l /dev/sdb?
brw-r----- 1 grid asmadmin 8, 17 Jul 15 18:25 /dev/sdb1
brw-r----- 1 grid asmadmin 8, 21 Jul 15 18:24 /dev/sdb5
brw-r----- 1 grid asmadmin 8, 22 Jul 15 18:25 /dev/sdb6
brw-r----- 1 grid asmadmin 8, 23 Jul 15 18:24 /dev/sdb7
brw-r----- 1 grid asmadmin 8, 24 Jul 15 18:25 /dev/sdb8
(2) 安裝AMBlib包
[root@AS5 u02]# rpm -ivh oracleasm-support-2.1.3-1.el5.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@AS5 u02]# rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
warning: ora005_oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-2.6.18-164.el########################################### [100%]
[root@AS5 u02]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
(3) 配置ASM
[root@AS5 u02]# /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 []: grid
Default group to own the driver interface []: asmadmin
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 ]
[root@AS5 u02]# /usr/sbin/oracleasm init
(4) 創(chuàng)建ASM磁盤
[root@AS5 u02]# service oracleasm createdisk VOL01 /dev/sdb5
Marking disk "VOL01" as an ASM disk: [ OK ]
[root@AS5 u02]# service oracleasm createdisk VOL02 /dev/sdb6
Marking disk "VOL02" as an ASM disk: [ OK ]
[root@AS5 u02]# service oracleasm createdisk VOL03 /dev/sdb7
Marking disk "VOL03" as an ASM disk: [ OK ]
[root@AS5 u02]# service oracleasm createdisk VOL04 /dev/sdb8
Marking disk "VOL04" as an ASM disk: [ OK ]
[root@AS5 u02]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@AS5 u02]# oracleasm listdisks
VOL01
VOL02
VOL03
VOL04
(5) 關(guān)閉時(shí)間服務(wù)
[root@AS5 u02]# service ntpd stop
Shutting down ntpd: [FAILED]
[root@AS5 u02]# chkconfig ntpd off
[root@AS5 u02]# mv /etc/ntp.conf /etc/ntp.conf_bak
續(xù)下篇《Oracle11gR2+ASM安裝詳細(xì)操作(二)》http://space.itpub.net/25881373/viewspace-702462
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。