一聚教程网:一个值得你收藏的教程网站

热门教程

Redhat 6.2 64位系统安装Oracle 11g R2数据库

时间:2022-11-14 23:36:53 编辑:袖梨 来源:一聚教程网


操作系统:Red Hat Enterprise Linux Server release 6.2 x86_64
Oracle版本:Oracle Database 11g Release 2

Oracle官方下载地址:
File1:http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip
File2:http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

Oracle11gR2官方文档地址:http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#CEGHFFGG

使用到的工具:
SecureCRT
VNC-Viewer-5.1.1-Windows-64bit.exe(http://www.realvnc.com/download/viewer/)

服务器IP:192.168.109.129


硬件要求:官方要求内存至少1GB,推荐2GB或更多。

官方给的物理内存和Swap交换空间的关系表:

Available RAM Swap Space Required
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB

检查本机内存:


[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal: 1164632 kB
[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal: 2097144 kB
[root@localhost ~]# free -m
total used free shared buffers cached
Mem: 1137 1026 111 0 18 430
-/+ buffers/cache: 576 560
Swap: 2047 190 1857

查看本机系统架构:

[root@localhost ~]# uname -m
x86_64

磁盘空间要求:

官方要求/tmp空间至少要1GB


[root@localhost ~]# df -h /tmp/
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 38G 14G 22G 39% /

检查软件环境:
支持的系统(只选取redhat):
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 6 (with the Oracle Unbreakable Enterprise Kernel for Linux)

内核要求:
· On Red Hat Enterprise Linux 6
2.6.32-71.el6.x86_64 or later
· On Red Hat Enterprise Linux 6with Unbreakable Enterprise Kernel
2.6.32-100.28.5.el6.x86_64 or later

查看本机内核版本:


[root@localhost ~]# uname -r
2.6.32-220.el6.x86_64

官方要求需要安装的软件包:

The following or later version of packages for Oracle Linux 6, and Red Hat Enterprise Linux 6 must be installed:


binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)

Oracle ODBC Driver:


On Oracle Linux 6 and Red Hat Enterprise Linux 6:
unixODBC-2.2.14-11.el6 (x86_64) or later
unixODBC-2.2.14-11.el6.i686 or later
unixODBC-devel-2.2.14-11.el6 (x86_64) or later
unixODBC-devel-2.2.14-11.el6.i686 or later

检查并安装所要求的软件包:
由于所需安装的包既有32位,又有64位,所以就一个个检查安装。
检查使用rpm -q packgename (不看版本号)
安装使用rpm -ivh packge_full_name
我这里已经使用系统盘做好了本地yum源,由于使用rpm -ivh packge_full_name安装时可能会存在依赖包,所以直接使用yum安装的方式来安装,如下:

系统挂在在/iso目录下:


[root@localhost ~]# cd /iso/Packages/
[root@localhost Packages]# yum -y install binutils-2.20.51.0.2-5.28.el6.x86_64.rpm
这样有依赖包便会自动安装,已经装了的话,直接跳过就ok,注意,务必一个个安装,避免遗失包,后米安装时报错。

创建所需的用户和组:


[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -Gdba oracle
[root@localhost ~]# id oracle
uid=500(oracle) gid=500(oinstall)groups=500(oinstall),501(dba)
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is toosimplistic/systematic
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updatedsuccessfully.

配置内核参数:
官方要求的:
查看方法:
在/etc/sysctl.conf文件中添加以下:


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 = 1048576

生效:


[root@localhost ~]# /sbin/sysctl -p

确认值被正确设置:
1
[root@localhost ~]# /sbin/sysctl -a

在oracle用户下检查设置Resource Limits
k3.png
To create the Oracle base directory:
Enter the following command to display information about all mounted file systems:
# df -k
This command displays information about all the file systems mounted on the system, including:
The physical device name
The total amount, used amount, and available amount of disk space
The mount point directory for that file system
From the display, identify either one or two file systems that meet the disk space requirements mentioned earlier in this section.
Note the name of the mount point directory for each file system that you identified.
Enter commands similar to the following to create the recommended subdirectories in the mount point directory that you identified and set the appropriate owner, group, and permissions on them:
# mkdir -p /mount_point/app/
# chown -R oracle:oinstall /mount_point/app/
# chmod -R 775 /mount_point/app/
For example:
# mkdir -p /u01/app/
# chown -R oracle:oinstall /u01/app/
# chmod -R 775 /u01/app/

[root@localhost ~]# vim /etc/security/limits.conf

添加以下:


oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

创建所需目录:


[root@localhost ~]# mkdir -p /oracle/app
[root@localhost ~]# chown -Roracle:oinstall /oracle/app/
[root@localhost ~]# chmod -R 775/oracle/app/

配置oracle用户的环境变量:


[root@localhost ~]# su - oracle
[oracle@localhost ~]$ vim .bash_profile
添加以下:(红色部分):
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startupprograms

PATH=$PATH:$HOME/bina
ORACLE_BASE=/oracle/app/oracle
ORACLE_SID=orcl

export PATH ORACLE_BASEORACLE_SID

开始安装:

上传安装文件linux.x64_11gR2_database_1of2.zip和linux.x64_11gR2_database_2of2.zip至/目录
使用root用户解压:

[root@localhost/]# unzip linux.x64_11gR2_database_1of2.zip
[root@localhost/]# unzip linux.x64_11gR2_database_2of2.zip
ok,安装前工作完成,为确保所有设置都神效,最好重启一下机器。
# reboot

重启后,进入图形界面,终端下执行:

[root@test~]# xhost +
[root@test~]# su - oracle
[oracle@test~]$ cd /database/
[oracle@testdatabase]$ ./runInstaller

热门栏目