1、上传oracle安装包,(先配置网络,通过SecureCRT等工具上传)
说明,先建立一个目录(mkdir -p /usr/software/oracle),比如/usr/software/oracle,并切换到此目录(用cd /usr/software/oracle)
2、安装之前的检查
2.1 检查内核版本,具体命令 uname -r 或者 uname -a
2.2 其他所需程序包的版本(或更高版本),具体命令rpm -q gcc make binutils openmotif setarch compat-db compat-gcc-32 compat-gcc-32-c++ compat-libstdc++-33 compat-libstdc++-296
2.3 安装libaio-devel (I/O同步) rpm -ivh libaio-0.3.105-2.i386.rpm libaio-devel-0.3.102-1.i386.rpm
3、验证系统要求
3.1 要查看可用 RAM 和交换空间大小,运行以下命令:
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
或者 top 和 free 也可。,,,
///
3.2 查看磁盘空间是否足够,可以使用 df -m
4、前期安装准备
4.1 创建 Oracle 组和用户帐户
groupadd oinstall (说明,为了安装而建立的组)
groupadd dba
useradd -g oinstall -g dba oracle
id oracle
passwd oracle
4.2 创建目录,用来存放oracle10g软件和数据库文件
mkdir /opt/oracle
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /opt/oracle
4.3 配置 Linux 内核参数
cat >> /etc/sysctl.conf <<EOF
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.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
EOF
查看 /sbin/sysctl -p,下面是可选
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep ip_local_port_range
/sbin/sysctl -a | grep mem
4.4 为oracle用户设置 Shell 限制
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
cat >> /etc/pam.d/login <<EOF
session required /lib/security/pam_limits.so
EOF
cat >> /etc/profile <<EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF
4.5设置oracle用户环境变量
切换oracle用户,使用su - oracle ,修改配置文件(先备份)
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/10.2.0
export ORACLE_SID=testdb
PATH=$PATH:$ORACLE_HOME/bin:/opt/bin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11/bin:.
让配置文件生效 source /home/oracle/.bash_profile 或 . ~/.bash_profile
检查:echo $ORACLE_HOME
5. 具体安装
5.1解压安装包
unzip 10201_database_linux32.zip
5.2用虚拟机里面的终端来执行
export DISPLAY=:0.0
xhost local:oracle