1.配置本地YUM源
1.1 vim /etc/yum.repos.d/iso.repo
[Server]
name=Server
baseurl=file:///media/iso/Server
enabled=1
gpgcheck=0
[HighAvailability]
name=HighAvailability
baseurl=file:///media/iso/HighAvailability
enabled=1
gpgcheck=0
[LoadBalancer]
name=LoadBalancer
baseurl=file:///media/iso/LoadBalancer
enabled=1
gpgcheck=0
[ResilientStorage]
name=LoadBalancer
baseurl=file:///media/iso/ResilientStorage
enabled=1
gpgcheck=0
[ScalableFileSystem]
name=LoadBalancer
baseurl=file:///media/iso/ScalableFileSystem
enabled=1
gpgchecK=0
1.2 清空原有yum信息
yum clean all
2.安装依赖软件包
2.1 cd /media/iso/Packages/
2.2 yum installbinutils-2.* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-*gcc-4.* gcc-c++-4.* glibc-2.* glibc-common-2.* glibc-devel-2.*glibc-headers-2.* ksh-2* libaio-0.* libaio-devel-0.* libgcc-4.* libstdc++-4.*libstdc++-devel-4.* make-3.* sysstat-7.* unixODBC-2.* unixODBC-devel-2.* pdksh*
这些依赖包必须要安装,因为版本不同,在oracle安装时会提示缺少依赖包,忽略后可以正常安装使用Oracle
3.修改内核参数
3.1 vim /etc/sysctl.conf
kernel.shmmni= 4096
kernel.sem= 250 32000 100 128
fs.file-max= 6815744
net.ipv4.ip_local_port_range= 9000 65500
net.core.rmem_default= 4194304
net.core.wmem_default= 262144
net.core.rmem_max= 4194304
net.core.wmem_max= 1048576
fs.aio-max-nr= 1048576
3.2.使内核参数实时生效
sysctl -p
4.新建用户和组
[root@oracle ~]# groupadd oinstall
[root@oracle~]# groupadd dba
[root@oracle~]# useradd -g oinstall -G dba -m oracle
[root@oracle~]# passwd oracle
5.为oracle用户设置Shell限制
5.1.修改/etc/security/limits.conf,加入
[root@oracle~]# vim /etc/security/limits.conf
oraclesoft nproc 2047
oraclehard nproc 16384
oraclesoft nofile 1024
oraclehard nofile 65536
5.2.修改/etc/pam.d/login,加入
[root@oracle~]# vim /etc/pam.d/login
session requiredpam_limits.so
5.3.修改/etc/profile,加入
[root@oracle~]# vim /etc/profile
if[ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit-p 16384
ulimit-n 65536
else
ulimit-u 16384 -n 65536
fi
umask022
fi
6.新建安装目录
6.1.新建目录
[root@oracle~]# mkdir -p /u01/app/oracle
6.2.设置目录所有权
[root@oracle~]# chown oracle:oinstall /u01/app
6.3.设置目录权限
[root@oracle~]# chmod -R 775 /u01/app
7.准备oracle安装文件
7.1修改/etc/hosts文件
[root@oracle~]#vim /etc/hosts
127.0.0.1 localhost.localdomain localhost::1 localhost6.localdomain6 localhost6
192.168.137.112 oracle.domain.com oracle
注意将主机名对应到真实ip地址,否则oracle有可能将监听程序仅仅建立在127.0.0.1上
7.2解压oracle安装文件包
[root@oracleu01]# unzip /media/linux.x64_11gR2_/linux.x64_11gR2_database_1of2.zip&& unzip /media/linux.x64_11gR2_/linux.x64_11gR2_database_2of2.zip
7.3切换到oracle用户,图形界面登录,执行oracle安装文件
Vi .bash_profile 添加
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
THREADS_FLAG=native
ORACLE_OEM_JAVARUNTIME=/opt/jre1.3.1_15
PATH=$PATH:$ORACLE_HOME/bin
NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
export ORACLE_BASE ORACLE_HOME ORACLE_SIDLD_LIBRARY_PATH THREADS_FLAG ORACLE_OEM_JAVARUNTIME PATH NLS_LANG
[oracle@oracledatabase]$ ./runInstaller
oracle11g安装关于swap空间不足问题解决
linux添加虚拟内存解决swap空间不足问题
增加一个SWAP文件:
1. 查看当前虚拟内存
[root@ora11gr2 ~]#free -m
total used free sharedbuffers cached
Mem: 2026 217 1809 0 11 126
-/+ buffers/cache: 78 1947
Swap: 2047 0 2047
[root@ora11gr2 ~]#
[root@ora11gr2 ~]#
[root@ora11gr2 mapper]#ll
total 0
crw------- 1 root root 10, 63 Mar 19 00:11control
brw-rw---- 1 root disk 253, 0 Mar 19 00:11VolGroup00-LogVol00
brw-rw---- 1 root disk 253, 1 Mar 19 00:11VolGroup00-LogVol01
[root@ora11gr2 mapper]#
[root@ora11gr2mapper]#
2. 将当前swap空间由2047mb增加到3047mb 新增一个1024mb的swap 文件
[root@ora11gr2 mapper]#dd if=/dev/zero of=/home/swap bs=1024 count=1024000
1024000+0 records in
1024000+0 records out
1048576000 bytes(1.0 GB) copied, 29.5369 seconds, 35.5 MB/s
3.执行以下命令增加并启用虚拟内存
[root@ora11gr2mapper]# mkswap /home/swap
Setting up swapspace version 1, size = 1048571 kB
[root@ora11gr2 mapper]# swapon /home/swap
[root@ora11gr2 mapper]# cd /home/
[root@ora11gr2 home]# ll
total 1025008
drwx------ 3 oracle oinstall 4096 Mar 18 23:49oracle
-rw-r--r-- 1 root root 1048576000 Mar 19 00:14swap
[root@ora11gr2 home]# free -m
total used free shared buffers cached
Mem: 2026 1232 793 0 13 1127
-/+ buffers/cache: 92 1934
Swap: 3047 0 3047