Oracle11g for linux 安装
一 系统篇
1系统定制安装选择包
X Window System
GNOME Desktop Environment
Editors
Graphical Internet
Text-based Internet
Server Configuration Tools
Development Tools
Administration Tools
System Tools
2 oracle安装所必须软件
binutils-
compat-libstdc++-33-
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
glibc-2.5-24
glibc-common-2.5-12
glibc-devel-2.5-12
gcc-
gcc-c++-
libaio-0.3.106
libaio-devel-0.3.106
libgcc-
libstdc++-
libstdc++-devel-
make-3.81-1.1
libgomp-
sysstat-
unixODBC-
unixODBC-devel-
查找系统是否缺少改软件
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common \
glibc-devel gcc gcc-c++ libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat \
unixODBC unixODBC-devel libgomp
注意以上软件包都可在光盘中找到挂在光盘的命令
mount /dev/cdrom /mnt
cd /mnt/Server/
如果安装完后依然不行则配置yum,更新rpm包具体配置如下
1 到目录/etc/yum.repos.d下创建文件touch CentOS-Base.repo
2 vi CentOS-Base.repo增加如下内容
[base]
name=Red Hat Linux $releasever - $basearch - Base
baseurl= http://centos.ustc.edu.cn/centos/5/os/i386/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
3 启动yum服务
/etc/rc.d/init.d/yum-updatesd start
除此之外需要主机连网并配置dns
4 如果安装提示确实libXp.so.6 则安装rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm 便可以再lib目录下找到find / -name libXp.so.6
/usr/lib/libXp.so.6
3 系统参数修改
a 修改系统核心参数
kernel.shmall = 2097152
kernel.shmmax = 536870912 (当前内存*1024*1024*1024/2)
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default=8388608
net.core.rmem_max=8388608
net.core.wmem_default=262144
net.core.wmem_max=1048576
fs.aio-max-nr=1048576
b 修改limits资源限制
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
c 更改/etc/pam.d/login文件
session required /lib/security/pam_limits.so
session required pam_limits.so
注意如果是64位的linux 此处应该是/lib64/security/pam_limits.so 如果弄错。Linux所有用户都不能本地登录终端。
d 更改/etc/profile文件
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
e 查看swap交换分区是否满足16G
[oracle@linux ~]$ free -m
total used free shared buffers cached
Mem: 1213 1151 62 0 4 908
-/+ buffers/cache: 238 975
Swap: 16288 0 16288
4 创建用户和组
a 创建组
groupadd dba
groupadd oper
groupadd oinstall
b 创建用户
useradd -m -g oinstall -G dba -d /oracle oracle
c 更改用户密码
passwd oracle
5 设置oracle目录的属主和权限
chown - R oracle.oinstall /oracle
chmod 755 /oracle/
6 上传oracle安装软件并加压缩并更改database权限和属组
a 开始上传
# rz
rz waiting to receive.
正在开始 zmodem 传输。 按 Ctrl+C 取消。
正在传输 linux_11gR1_database_1013.zip...
上传完后更改权限
chown -R oracle:oinstall /install/database
chmod -R 755 /install/database/
ls -ld /install/database/
二 安装篇
1仅安装数据库软件
2在oracle用户主目录下更改.bash_profile文件添加环境变量
3运行dbca
4 运行netca
三 把oracle启动脚本添加成服务
1 在/etc/rc.d/init.d/ 目录下面建db文件并更改其权限为755文件内容如下
# description: Oracle auto start-stop script.
# chkconfig: - 20 80
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORACLE_HOME.
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - oracle <<!
export ORACLE_SID=TEST
lsnrctl start TEST
sqlplus / as sysdba
startup
exit
!
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - oracle <<!
export ORACLE_SID=TEST
lsnrctl start TEST
sqlplus / as sysdba
shutdown immediate
exit
!
;;
'restart')
$0 stop
$0 start
;;
esac
2 把该文件添加成linux系统服务
chkconfig ---add db
3 更改35级别该服务自动启动
chkconfig --level 35 db on