灌溉梦想,记录脚步
« »

在SUSE上安装oracle 11gR1

系统环境:SUSE 10.3 X86_64 OpenSUSE 10.3 X86_64
oracle版本:11.1.0.6.0

安装过程分以下四个步骤

一,安装准备
二,下载安装
三,相关设置
四,常见错误

一,安装准备
1,创建oracle用户

以root用户登录,并创建oracle用户以及所属的dba组

1
2
3
4
5
su -
# groupadd dba
# useradd -g dba oracle
# mkdir /home/oracle
# chown oracle:dba /home/oracle

2,配置系统参数

编辑 /etc/sysctl.conf 文件并添加下列参数:

1
2
3
4
5
6
7
8
9
10
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144

编辑后可以运行“sysctl -p” 生效,或者重启系统

编辑 /etc/pam.d/login 文件,并添加下行参数:

1
session required pam_limits.so

编辑 /etc/security/limits.conf 并添加下行参数:

1
2
3
4
oracle    soft  nproc  2047
oracle    hard  nproc  16384
oracle    soft  nofile  1024
oracle    hard  nofile  65536

3,创建oracle目录

1
2
3
# mkdir /opt/oracle
# mkdir /opt/oracle/111
# chown -R oracle:dba /opt/oracle

4,设置oracle环境变量

编辑 /home/oracle/.bash_profile 并添加下列行:

1
2
3
4
5
6
7
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/111
ORACLE_SID=ORCL
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
PATH=$PATH:$ORACLE_HOME/bin
 
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

保存后通过下面命令是配置生效

1
2
3
su - oracle
cd /home/oracle
. .bash_profile

5,对于opensuse,备份 /etc/SuSe-release 文件并修改原文件为:

1
2
3
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 1

二,下载安装

1,检查相应软件包

1
rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}\n'|egrep 'binutils|compat|glibc|gcc|libstd|cpp|make|ODBC|libaio|ksh|motif|libelf|sysstat'| egrep -v 'avahi|cdrkit|ldap|ssl'|sort

对于 SLES 10 64位,对应软件包:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
binutils-2.16.91.0.5-23.20.x86_64
compat-libstdc++-5.0.7-22.2.x86_64
cpp-4.1.2_20070115-0.11.x86_64
gcc-4.1.2_20070115-0.11.x86_64
gcc-c++-4.1.2_20070115-0.11.x86_64
glibc-2.4-31.30.x86_64
glibc-32bit-2.4-31.30.x86_64
glibc-devel-2.4-31.30.x86_64
glibc-devel-32bit-2.4-31.30.x86_64
glibc-i18ndata-2.4-31.30.x86_64
glibc-info-2.4-31.30.x86_64
glibc-locale-2.4-31.30.x86_64
glibc-locale-32bit-2.4-31.30.x86_64
ksh-93r-12.28.x86_64
libaio-0.3.104-14.2.x86_64
libaio-32bit-0.3.104-14.2.x86_64
libaio-devel-0.3.104-14.2.x86_64
libaio-devel-32bit-0.3.104-14.2.x86_64
libelf-0.8.5-47.2.x86_64
libgcc-4.1.2_20070115-0.11.x86_64
libstdc++-4.1.2_20070115-0.11.x86_64
libstdc++-devel-4.1.2_20070115-0.11.x86_64
make-3.80-202.2.x86_64
openmotif-libs-2.2.4-21.12.x86_64
sysstat-6.0.2-16.19.x86_64
unixODBC-32bit-2.2.11-21.4.x86_64

对于OpenSUSE 64位系统:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
binutils-2.17.50.20070726-14.x86_64
compat-libstdc++-5.0.7-86.x86_64
cpp-4.2-24.x86_64
cpp42-4.2.1_20070724-17.x86_64
gcc42-32bit-4.2.1_20070724-17.x86_64
gcc42-4.2.1_20070724-17.x86_64
gcc42-c++-4.2.1_20070724-17.x86_64
glibc-2.6.1-18.x86_64
glibc-32bit-2.6.1-18.x86_64
glibc-devel-2.6.1-18.x86_64
glibc-devel-32bit-2.6.1-18.x86_64
ksh-93s-48.x86_64
libaio-0.3.104-74.x86_64
libaio-32bit-0.3.104-74.x86_64
libaio-devel-0.3.104-74.x86_64
libaio-devel-32bit-0.3.104-74.x86_64
libelf0-0.8.9-17.x86_64
libgcc42-32bit-4.2.1_20070724-17.x86_64
libgcc42-4.2.1_20070724-17.x86_64
libstdc++42-32bit-4.2.1_20070724-17.x86_64
libstdc++42-4.2.1_20070724-17.x86_64
libstdc++42-devel-32bit-4.2.1_20070724-17.x86_64
libstdc++42-devel-4.2.1_20070724-17.x86_64
make-3.81-66.x86_64
openmotif-libs-2.3.0-23.x86_64
sysstat-7.1.6-16.x86_64
unixODBC-32bit-2.2.12-55.x86_64

opensuse软件包下载地址:http://download.opensuse.org/distribution/10.3/repo/oss/suse/x86_64/
这些软件包也可以在安装DVD中找到,找到后通过rpm -ivh 安装rpm软件包

对于opensuse软件包需要以root用户做下面操作

1
2
3
# cd /usr/lib
# ln -s gcc-4.2 gcc
# ln -s g++-4.2 g++

2,下载oracle 11g
下载地址:http://www.oracle.com/technology/software/products/database/index.html
解压软件包

1
2
3
4
5
6
unzip linux_11gR1_database.zip 
 
3,开始安装
 
<pre lang="bash" line="1">cd database
./runInstaller

注意:对于opensuse 10.3 在系统检查中出现:”Checking operating system package requirements 失败提示
选择 “User verified” 后跳过即可

三,相关配置

1,自动启动和关闭数据库实例和监听

编辑 /etc/oratab 修改最后参数为“Y”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ORCL:/opt/oracle/111:Y
 
以root用户在 /etc/init.d/ 目录中创建oracle文件,并添加下列内容
<pre lang="bash" line="1">#! /bin/bash
#
#
# /etc/init.d/oracle
#
#
### BEGIN INIT INFO
# Provides: oracle
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Oracle Database startup script
### END INIT INFO
 
 
ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/111"
 
case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

设置脚本权限和自启动

1
2
chmod 750 /etc/init.d/oracle
chkconfig --add oracle --level 0356

2,自动启动和关闭 EM

以root用户在 /etc/init.d 中创建oraemctl 文件,并添加下面内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/bash
#
#
# /etc/init.d/oraemctl
#
#
### BEGIN INIT INFO
# Provides: oraemctl
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Starting and stopping Oracle Enterprise Manager Database Control
### END INIT INFO
 
 
ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/111"
 
case "$1" in
start)
echo -n $"Starting Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

设置权限和自启动

1
2
chmod 750 /etc/init.d/oraemctl
chkconfig --add oraemctl --level 0356

3,对于恢复 /etc/SuSE-release的备份文件

四,常见错误

1,错误:DISPLAY not set. Please set the DISPLAY and try again.

以root用户打开终端或者ssh登录,通过下面命令均可可解决
命令一: export DISPLAY=:0.0
命令二: xhost +

2,错误:error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

安装libaio和libaio-devel软件包,如果仍重复提示错误,以root用户运行”ldconfig“命令可以解决

日志信息 »

该日志于2010-12-29 22:45由 kevin 发表在技术合集分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

发表回复