Linux 下Oracle 10g的安装
1.下载安装文件
这里使用10201_database_linux32.zip这个安装包,并且需要以root用户登录
2.查看系统的资源及环境是否符合安装条件
grep MemTotal /proc/meminfo 查询内存大小 10g需>512M
grep SwapTotal /proc/meminfo 查询交换空间大小 10g需 > 1G
另外10g还需要2.5GB的磁盘空间
[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal: 1035400 kB
[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal: 2031608 kB
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
37G 5.3G 30G 15% /
/dev/sda1 99M 11M 83M 12% /boot
tmpfs 506M 0 506M 0% /dev/shm
[root@localhost ~]#
#vi /etc/RedHat-relese
将其中的的内容Red Hat Enterprise Linux Server release 5 (Tikanga)
修改为
redhat-4
安装需要的软件包如下图:(在系统安装盘的Server中会有,网上下载亦可)
3.创建用户和组,及orcale安装目录及数据存放目录
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# /usr/sbin/useradd -g oinstall -G dba Oracle
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
Sorry, passwords do not match.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# mkdir /opt/oracle
[root@localhost ~]# mkdir /opt/oradata
[root@localhost ~]# chown -R oracle:oinstall /opt/oracle /opt/oradata
[root@localhost ~]# chmod -R 755 /opt/oracle /opt/oradata
4.配置环境变量
切换用户并配置用户环境变量
[root@localhost ~]# su oracle
[oracle@localhost root]$ vi /home/oracle/.bash_profile
添加如下内容
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
# Controls the maximum shared segment size, in bytes
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
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 2097152
ORACLE_BASE=/opt/oracleORACLE_SID=orclORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1LD_LIBARY_PATH=$ORACLE_HOME/libPATH=$PATH:$HOME/bin:$ORACLE_HOME/binexport ORACLE_BASE ORACLE_SID ORACLE_HOME LD_LIBARY_PATH PATH
5.设置系统参数
切换为root用户
# Controls the maximum shared segment size, in bytes
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
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 2097152