概述:学习oracle首先需要将oracle安装在操作系统后,您才可以继续其他方面的学习;本文就oracle11g在redhat6.4上使用本地卷管理的方式进行简单安装说明;官方文档请查看:https://docs.oracle.com/cd/E11882_01/install.112/e47689/toc.htm
实验步骤:
1、操作系统准备
1.1、相关包安装
1.2、相关系统参数修改
1.3、关闭防火墙
2、新建相关用户:oracle
3、新建相关目录并修改权限
4、配置oracle用户环境变量
5、安装oracle软件和使用dbca建库
实验:
解压安装介质:11.2.0.4oracle安装包
[[email protected] ~]# cd /tmp/
[[email protected] tmp]# ls
keyring-bzLfgY p13390677_112040_LINUX_1of7.zip pulse-l84Sn5PAruWy virtual-root.O43zXP
orbit-gdm p13390677_112040_LINUX_2of7.zip rhel-server-6.4-x86_64-dvd.iso virtual-root.qyE84j
orbit-root pulse-dPtARQbfzMNp ssh-afkKAU1848 yum.log
[[email protected] tmp]# unzip p13390677_112040_LINUX_1of7.zip
[[email protected] tmp]# unzip p13390677_112040_LINUX_2of7.zip
操作系统参数修改:
[[email protected] tmp]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.66 cube
[[email protected] tmp]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[[email protected] tmp]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[[email protected] tmp]# chkconfig iptables off
[[email protected] tmp]# vi /etc/sysctl.conf --- 添加
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
[[email protected] tmp]# sysctl -p --生效参数
[[email protected] tmp]# vi /etc/security/limits.conf ---添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[[email protected] tmp]# vi /etc/pam.d/login ---添加
session required /lib64/security/pam_limits.so
session required pam_limits.so
[[email protected] tmp]# vi /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
oracle需求的包安装
[[email protected] tmp]# mount /dev/cdrom /media/
mount: block device /dev/sr0 is write-protected, mounting read-only
[[email protected] tmp]# yum install -y 相关包 后续提示缺少包 就相应的补上就行
新建用户oracle:
[[email protected] tmp]# groupadd -g 2000 oinstall
[[email protected] tmp]# groupadd -g 2001 dba
[[email protected] tmp]# useradd -u 1000 -g oinstall -G dba oracle
[[email protected] tmp]# passwd oracle
新建相关目录及修改权限
[[email protected] tmp]# mkdir -p /u01/app/oracle
[[email protected] tmp]# chown -R oracle:oinstall /u01/
[[email protected] tmp]# chmod -R 755 /u01/
修改oracle用户参数文件:
[[email protected] tmp]# vi /home/oracle/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_SID=CUBE
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
至此安装准备阶段已经完成,开图形安装吧。
安装:
[[email protected] database]# xhost +
su - oracle
[[email protected] database]# pwd
/tmp/database
[[email protected] database]# ./runInstaller
总结:至此单机安装完成让我们开启oracle的使用旅程吧。