Redhat/CentOS下安装Oracle11gR2记录
1、安装jdk centos7安装jdk1.7:http://jisonami.iteye.com/blog/2219327
2、创建oracle的安装用户和用户组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
id oracle
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
passwd oracle
Changing password for user oracle. New password: BAD PASSWORD: it is based on a dictionary word BAD PASSWORD: is too simple Retype new password: passwd: all authentication tokens updated successfully.
3、创建oracle的安装目录
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 755 /u01
4、修改oracle环境变量
su - oracle
$ vi .bash_profile 在最末尾加上 #my oracle set export TMP=/tmp export TMPDIR=$TMP export EDITOR=vim export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1(安装11gR2) export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db1(安装12C) export ORACLE_SID=secooler export NLS_LANG=american_america.zhs16gbk export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$PATH export DISPLAY=192.168.1.7:0.0 (本机对应的ip地址) umask 022 $ source .bash_profile 查看配置好的oracle环境变量 $ echo $ORACLE_BASE /u01/app/oracle $ echo $ORACLE_HOME /u01/app/oracle/product/11.2/db_1 $ echo $ORACLE_SID secooler
5、关闭selinux和防火墙
vi /etc/selinux/config
SELINUX=disabled 1)Redhat6/CentOS6关闭防火墙方法 关闭命令: service iptables stop 永久关闭防火墙:chkconfig iptables off 运行完成后查看防火墙关闭状态 service iptables status 2)Redhat7/CentOS7关闭防火墙方法 永久关闭防火墙:systemctl disable firewalld 关闭命令: systemctl stop firewalld 运行完成后查看防火墙关闭状态 systemctl status firewalld
6、通过sftp上传oracle安装包到/oraapp目录 解压和更改oracle安装包目录权限
mkdir /oraapp
cd /oraapp
unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
chmod -R 755 /oraapp/database
chown -R oracle:oinstall /oraapp/database
7、修改内核参数 (可选,不改则为默认)
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 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
sysctl -p
8、上传oracle软件并解压 #mkdir /oraapp 使用filezilla等ftp软件上传oracle11gR2的包到oraapp目录
unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
chown -R oracle:oinstall /oraapp/database/
rm -rf /oraapp/linux.x64_11gR2_database_*
du -sm database/ 查看解压oracle软件包后的大小
2367 database/
9、修改Shell Limits 以便提高Oracle 的执行效率(可选)
vi /etc/security/limits.conf
oracle soft nofile 131072 oracle hard nofile 131072 oracle soft nproc 131072 oracle hard nproc 131072 oracle soft core unlimited oracle hard core unlimited oracle soft memlock 50000000 oracle hard memlock 50000000
10、copy一下命令到命令行安装oracle所需要的依赖包
yum -y install
binutils
compat-libcap1
compat-libstdc++-33
compat-libstdc++-33*.i686
elfutils-libelf-devel
gcc
gcc-c++
glibc*.i686
glibc
glibc-devel
glibc-devel*.i686
ksh
libgcc*.i686
libgcc
libstdc++
libstdc++.i686
libstdc++-devel
libstdc++-devel.i686
libaio
libaio*.i686
libaio-devel
libaio-devel*.i686
make
sysstat
unixODBC
unixODBC*.i686
unixODBC-devel
unixODBC-devel*.i686
libXp
最后,进行oracle11gR2图形界面安装
- .以root用运行命令xhost +
xhost +
access control disabled, clients can connect from any host
su - oracle
$ cd /oraapp/database/ $ ./runInstaller 如果不想让oracle检查先决条件的话, ./runInstall -ignoresysprereqs
xhost+的作用 xhost 是用来控制X server访问权限的。
通常当你从hostA登陆到hostB上运行hostB上的应用程序时,
做为应用程序来说,hostA是client,但是作为图形来说,
是在hostA上显示的,需要使用hostA的Xserver,所以hostA是
server.因此在登陆到hostB前,需要在hostA上运行xhost +
来使其它用户能够访问hostA的Xserver.
xhost + 是使所有用户都能访问Xserver.
xhost + ip使ip上的用户能够访问Xserver.
xhost + nis:user@domain使domain上的nis用户user能够访问
xhost + inet:user@domain使domain上的inet用户能够访问。
使用vnc远程访问centos7桌面:http://jisonami.iteye.com/blog/2217972