RHEL 6.2 64位安装Oracle 11g R2(一)

2014-11-24 17:30:26 · 作者: · 浏览: 2

1、安装环境:


操作系统及版本


[root@stone ~]# cat /etc/issue


内存设置


[root@stone ~]# free -m


total used free shared buffers cached


Mem: 1063 721 341 0 25 387


-/+ buffers/cache: 309 754


Swap: 1999 0 1999


#内存至少1G,swap至少为1.5倍内存


磁盘分区


[root@stone ~]# df -ah


Filesystem Size Used Avail Use% Mounted on


/dev/sda1 23G 2.9G 19G 14% /


proc 0 0 0 - /proc


sysfs 0 0 0 - /sys


devpts 0 0 0 - /dev/pts


tmpfs 532M 264K 532M 1% /dev/shm


none 0 0 0 - /proc/sys/fs/binfmt_misc


sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs


gvfs-fuse-daemon 0 0 0 - /root/.gvfs


vmware-vmblock 0 0 0 - /var/run/vmblock-fuse


.host:/ 76G 26G 50G 35% /mnt/hgfs


2、配置YUM(需要上公网或架设内网服务器)


[root@stone ~]# cd /etc/yum.repos.d/


--2014-03-09 14:35:00-- http://mirrors.163.com/.help/CentOS6-Base-163.repo


Resolving mirrors.163.com... 123.58.173.106


Connecting to mirrors.163.com|123.58.173.106|:80... connected.


HTTP request sent, awaiting response... 200 OK


Length: 2006 (2.0K) [application/octet-stream]


Saving to: “CentOS6-Base-163.repo”


100%[===========================================================================>] 2,006 --.-K/s in 0s


2014-03-09 14:35:00 (137 MB/s) - “CentOS6-Base-163.repo” saved [2006/2006]


[root@stone yum.repos.d]# ls


[root@stone ~]# vim /etc/yum.repos.d/CentOS6-Base-163.repo


:g/$releasver/s//6/g


:wq


[root@stone ~]# yum makecache


Loaded plugins: product-id, refresh-packagekit, security, subscription-manager


Updating certificate-based repositories.


base | 3.7 kB 00:00


base/group_gz | 220 kB 00:00


base/filelists_db | 5.9 MB 00:28


base/primary_db | 4.4 MB 00:20


base/other_db | 2.8 MB 00:12


extras | 3.4 kB 00:00


extras/filelists_db | 11 kB 00:00


extras/prestodelta | 907 B 00:00


extras/primary_db | 19 kB 00:00


extras/other_db | 5.8 kB 00:00


updates | 3.4 kB 00:00


updates/filelists_db | 1.3 MB 00:05


updates/prestodelta | 169 kB 00:00


updates/primary_db | 2.0 MB 00:09


updates/other_db | 16 MB 01:11


Metadata Cache Created


3、安装所需软件包


[root@stone ~]# cat ora_software1.txt


binutils*


compat-libstdc++*


elfutils-libelf*


elfutils-libelf-devel*


elfutils-libelf-devel-static*


gcc*


gcc-c++*


glibc*


glibc-common*


glibc-devel*


glibc-headers*


kernel-headers*


ksh*


libaio*


libaio*


libgcc*


libgomp*


libstdc++*


libstdc++-devel*


make*


sysstat*


unixODBC*


unixODBC-devel*


[root@stone ~]# cat ora_software1.txt | xargs yum install -y



4、建立oracle所需组和用户


[root@stone ~]# groupadd oinstall


[root@stone ~]# groupadd dba


[root@stone ~]# useradd -g oinstall -G dba oracle


[root@stone ~]# passwd oracle


Changing password for user oracle.


New password:


BAD PASSWORD: it is too simplistic/systematic


BAD PASSWORD: is too simple


Retype new password:


passwd: all authentication tokens updated successfully.


5、设置安装目录


[root@stone ~]# mkdir -p /u01/oraInventory


[root@stone ~]# chown -R oracle:oinstall /u01/


[root@stone ~]# chmod -R 775 /u01/


将第4步和第5步做成脚本:


[root@stone ~]# cat ora_user_dir.sh


#!/bin/bash


groupadd oinstall


groupadd dba


useradd -g oinstall -G dba oracle


echo "123456" | passwd --stdin oracle


mkdir -p /u01/oraInventory


chown -R oracle:oinstall /u01/


chmod -R 775 /u01/


[root@stone ~]# sh ora_user_dir.sh


Changing password for user oracle.


passwd: all authentication tokens updated successfully.


6、设置环境变量


[root@stone ~]#xhost +


[root@stone ~]# su - oracle


[oracle@stone ~]$ export ORACLE_BASE=/u01/app/oracle


7、解压安装包


[oracle@stone ~]$ unzip /mnt/hgfs/software/linux.x64_11gR2_database_1of2.zip


[oracle@stone ~]$ unzip /mnt/hgfs/software/linux.x64_11gR2_database_2of2.zip


[orac