Home > Database > Mysql Tutorial > body text

Linux下静默安装Oracle

WBOY
Release: 2016-06-07 15:10:05
Original
1204 people have browsed it

Web服务器上面的Linux一般是不会有图形界面的,所有通过图形界面来安装Linux的方式在没有图形界面的Linux上面是行不通的,我们要

Web服务器上面的Linux一般是不会有图形界面的,所有通过图形界面来安装Linux的方式在没有图形界面的Linux上面是行不通的,我们要使用的安装方式叫做Linux的静默安装。即在没有图形界面的Linux上面安装。

1. 下载地址

下载.tar.gz文件即可,oracle在Window上面是有分位数的,但在linux上面没有分,只需要下载 x-86-64 版本的即可。

以·tar.gz为扩展名的是一种压缩文件,在Linux和OSX下常见,Linux和OSX都可以直接解压使用这种压缩文件。

--------------------------------------------------------------------------------

注意:root用户不能用是使用安装,root用户无法用来安装,需要用root用户创建一个新的用户要安装oracle。

2.硬件检测:

物理内存不少于1G

硬盘可以空间不少于5G

swap分区空间不少于2G

支持256色以上显卡

cpu主频不小于550mHZ

cat /etc/issue
uname -r (版本)
grep MemTotal /proc/meminfo (内存大小)
grep SwapTotal /proc/meminfo (交换区大小)
grep "model name" /proc/cpuinfo (CPU信息)
free (可用内存)

3.检查安装依赖系统包

操作系统依赖的具体包,请参考官方安装文档。

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11 (32-bit) or later
unixODBC-devel-2.2.11 (64-bit) or later
unixODBC-2.2.11 (64-bit) or later

检查依赖包

rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc-2.5 glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel

如果包有显示is not installed(没安装),就用yum install 命令安装,如:

 
yum install compat-libstdc++-33

4.创建所需的操作系统组和用户

    groupadd oinstall
    groupadd dba
    useradd -g oinstall -G dba oracle

设置oracle用户密码

passwd oracle

5.修改内核参数

在/sbin/sysctl.conf 文件中,使用文本编辑器或vi命令增加或修改以下参数 (vi /sbin/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

修改后,使设置生效

/sbin/sysctl -p

6.修改用户限制

在/etc/security/limits.conf 文件中,使用文本编辑器或vi命令

vi /etc/security/limits.conf

 
增加以下参数

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

在/etc/pam.d/login 文件中,使用文本编辑器或vi命令增加或修改以下内容

session required /lib/security/pam_limits.so
session required pam_limits.so

在/etc/profile 文件中,使用文本编辑器或vi命令增加或修改以下内容

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

使设置生效

source /etc/profile

7.创建安装目录(可根据情况,选择比较多空间的目录创建)

mkdir -p /usr/oracle
chown -R oracle:oinstall /usr/oracle
chmod -R 775 /usr/oracle

8.创建/etc/oraInst.loc文件,内容如下

nventory_loc=/usr/oracle/oraInventory
inst_group=oinstall

更改文件的权限

chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc

9.设置oracle环境变量

su - oracle    //切换用户到oracle
 
vi ~/.bash_profile  //访问或者创建 home/oracle目录下面的.bash_profile文件

在最后加上以下内容

export ORACLE_BASE=/usr/oracle
export ORACLE_SID=orcl

   注意,除了ORACLE_BASE和ORACLE_SID,( /etc/profile和.bash_profile中)不设置任何oracle相关环境变量(ORACLE_HOME, PATH, LD_LIBRARY_PATH等)。其他环境变量将在安装完成后再配置。

使设置生效

source /home/oracle/.bash_profile

检查环境变量:

env

同时,在使用静默安装的时候会检查DISPLAY的设置,如果经常说检查DISPLAY不行的话,到root用户下执行“xhost + 你的ip:0.0“

 10.解压oracle安装文件

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

11.复制响应文件模板

mkdir etc
cp /home/oracle/database/response/* /home/oracle/etc/

设置响应文件权限

su - root
chmod 700 /home/oracle/etc/*.rsp(注意所有者,oinstall)

 12.静默安装Oracle软件

切换用户

su - oracle

修改安装Oracle软件的响应文件/home/oracle/etc/db_install.rsp

vi /home/oracle/etc/db_install.rsp

添加一下内容

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!