全部博文(1015)
分类:
2012-12-18 22:37:34
Oracle10gR2 在 CentOS5.3上的安装
利用软件:
Vmware,Xmanager,
CentOS5.3, Oracle10gR2
■安装前准备:
1,察看操作系统版本
[root@centos
rpm]# cat /etc/issue
CentOS
release 5.3 (Final)
Kernel
\r on an \m
2,察看内核版本
[root@centos
rpm]# uname -r
3,察看已安装和未安装的包
[root@centos
rpm]# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-
gcc-c++
compat-libstdc++ compatlibstdc+-devel control-center glibc libstdc++
libstdc++-dev
el
sysstat
gcc-
make-3.81-3.el5
binutils-
package
openmotif is not installed
setarch-2.0-1.1
package
compat-db is not installed
package
compat-gcc is not installed
package
compat-gcc-c++ is not installed
package
compat-libstdc++ is not installed
package
compatlibstdc+-devel is not installed
control-center-
glibc-2.5-34
libstdc++-
libstdc++-devel-
package
sysstat is not installed
[root@centos
rpm]#
4,从CentOS5的安装盘中找到未安装的包,上传到系统中,安装
源文件..\centos-5.3-i386-bin-dvd.iso\CentOS\
利用WinScp上传到系统上某个路径/root/uploadfile/rpm
[root@centos
rpm]# pwd
/root/uploadfile/rpm
[root@centos
rpm]# ls
compat-db-
compat-gcc-34-
compat-gcc-34-c++-
compat-gcc-34-g77-
compat-libstdc++-296-2.96-138.i386.rpm sysstat-
[root@centos
rpm]#
5,安装上传的包
[root@centos
rpm]# rpm -ivh *.rpm
warning:
compat-db-
error:
Failed dependencies:
compat-libf
libg
libXp.so.6 is needed
by openmotif22-
libXp.so.6 is needed
by openmotif-
libXext-devel is needed by
openmotif-devel-
libXft-devel is needed by
openmotif-devel-
libXmu-devel is needed by
openmotif-devel-
libXp-devel is needed by
openmotif-devel-
libXp.so.6 is needed by openmotif-devel-
libXt-devel is needed by
openmotif-devel-
libjpeg-devel is needed by
openmotif-devel-
libpng-devel is needed by
openmotif-devel-
[root@centos
rpm]#
安装包有依赖的关系,把所依赖的包再上传一起安装。
经过多次试探后安装
root@centos rpm]# rpm -ivh
*.rpm
warning: compat-gcc-34-
Preparing...
########################################### [100%]
1:libXp
########################################### [ 4%]
2:compat-gcc-34
########################################### [ 7%]
3:openmotif
########################################### [ 11%]
4:compat-libf
5:compat-gcc-34-g77
########################################### [ 19%]
6:compat-gcc-34-c++
########################################### [ 22%]
7:openmotif22
########################################### [ 26%]
8:compat-libstdc++-296 ###########################################
[ 30%]
9:libXau-devel
########################################### [ 33%]
10:freetype-devel
########################################### [ 37%]
11:fontconfig-devel ###########################################
[ 41%]
12:libXp-devel
########################################### [ 44%]
13:xorg-x11-util-macros ###########################################
[ 48%]
14:libpng-devel
########################################### [ 52%]
15:libjpeg-devel
########################################### [ 56%]
16:xorg-x11-proto-devel ###########################################
[ 59%]
17:libX11-devel
########################################### [ 63%]
18:libXext-devel
########################################### [ 67%]
19:libXrender-devel
########################################### [ 70%]
20:libXft-devel
########################################### [ 74%]
21:libICE-devel ###########################################
[ 78%]
22:libSM-devel
########################################### [ 81%]
23:mesa-libGL-devel
########################################### [ 85%]
24:libXdmcp-devel ###########################################
[ 89%]
25:libXt-devel
########################################### [ 93%]
26:libXmu-devel
########################################### [ 96%]
27:openmotif-devel ###########################################
[100%]
[root@centos rpm]#
6,察看系统内存
[root@centos rpm]# grep MemTotal /proc/meminfo
MemTotal: 1035244 kB
[root@centos rpm]# grep SwapTotal /proc/meminfo
SwapTotal: 1052248 kB
所需最小 RAM 为 512MB,而所需最小交换空间为 1GB。对于 RAM 小于或等于
2GB 的系统,交换空间应为 RAM 数量的两倍;对于 RAM
大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。Oracle
[root@centos rpm]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda1
tmpfs
7,配置 Linux
内核参数
以 root 用户身份,修改/etc/sysctl.conf追加
Linux 内核非常出色。与大多数其他 *NIX 系统不同,Linux
允许在系统启动和运行时修改大多数内核参数。完成内核参数更改后不必重新启动系统。Oracle 数据库
[root@centos tmp]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
context=root:system_r:unconfined_t:SystemLow-SystemHigh
[root@centos tmp]# vi /etc/sysctl.conf
追加
#use for oracle
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
[root@centos tmp]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@centos tmp]#
以 root 用户身份运行以下命令来验证您的设置
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep ip_local_port_range
8,为 oracle 用户设置 Shell 限制
在/etc/security/limits.conf文件中加入以下内容,以修改单个用户允许使用的进程和文件数量
①#vi
/etc/security/limits.conf 在尾端添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
②#vi /etc/pam.d/login 在其中添加下面的代码:
session required /lib/security/pam_limits.so
③#vi /etc/selinux/config 确保以下内容
SELINUX=disabled
因为oracle 10g不支持centos,所以修改CentOS 5的版本
④#vi /etc/redhat-release
redhat-4
⑤另外在安装oracle数据库的时候要注意/etc/hosts与/etc/sysconfig/network文件主机名的一致性,否则会在后面运行netca和dbca可能出现错误提示
[root@centos tmp]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1
centos localhost.localdomain localhost
::1
localhost6.localdomain6 localhost6
[root@centos tmp]# more /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=centos
GATEWAY=192.168.0.1
[root@centos tmp]#
■安装
1,
创建oracle用户帐户
[root@centos
rpm]# /usr/sbin/groupadd oinstall
[root@centos rpm]# /usr/sbin/groupadd dba
[root@centos
rpm]# useradd -m -g oinstall -G dba oracle
[root@centos rpm]# passwd oracle
Changing
password for user oracle
New
UNIX password:
BAD
PASSWORD: it is based on a dictionary word
Retype
new UNIX password: oracle
passwd:
all authentication tokens updated successfully.
[root@centos
rpm]#
2,创建目录
[root@centos rpm]# mkdir -p /u01/app/oracle
[root@centos rpm]# mkdir -p /u02/oradata
[root@centos rpm]# chown -R oracle:oinstall /u01/app/oracle
/u02/oradata
[root@centos rpm]# chown -R 775 /u01/app/oracle /u02/oradata
3,修改./.bash_profile
[root@centos rpm]# id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
追加
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/
export ORACLE_SID=gaudi
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
#用于在window端启动Xmanager显示安装图形界面
DISPLAY=192.168.0.1:0;export DISPLAY
4,检查下环境变量是否设对了
-bash-3.2$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
-bash-3.2$ env | grep ORA
ORACLE_SID=gaudi
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/
-bash-3.2$ env | grep DIS
DISPLAY=192.168.0.1:0
-bash-3.2$
5,拷贝软件
[root@centos rpm]#
mv /root/10201_database_linux32.zip /u01/
unzip /u01/10201_database_linux32.zip
总计 639M
drwxr-xr-x 3 oracle oinstall 4.0K 05-30 08:06
10201_database_linux32
drwxr-xr-x 5 oracle oinstall 4.0K 07-27 23:41 ..
-rwxrwxrwx 1 root root
drwxr-xr-x 3 oracle oinstall 4.0K 07-27 23:44 .
6,Windows中启动Xmanager
Xmanager – Passive
7,安装
-bash-3.2$ export LANG=en_US
/设置临时环境变量,解决oracle图形界面显示乱码的问题
-bash-3.2$ ./runInstaller
8,error
Oui-10033
chown
-R oracle:oinstall /u01/
参考文档:
安装文档
http://liulin888.blog.163.com/blog/static/2744218120094351458535/
Vmware
Workstation增加硬盘空间