Redhat6.3 静默安装 Oracle 11gR2 Linux

1.安装环境:

[root@qht131 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)

数据库版本:11.2.0.3

官网下载地址:

http://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/index.html

https://pan.baidu.com/s/1miryl9A#list/path=%2Fp10404530_112030_Linux-x86-64&parentPath=%2F

2.安装依赖包

[root@qht131 yum.repos.d]# rpm -q binutils elfutils-libelf gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libgcc  libstdc++  libstdc++-devel make sysstat elfutils-libelf-devel  pdksh unixODBC unixODBC-devel libaio-devel compat-libstdc++-33
binutils-2.20.51.0.2-5.34.el6.x86_64
elfutils-libelf-0.152-1.el6.x86_64
package gcc is not installed
package gcc-c++ is not installed
glibc-2.12-1.80.el6.x86_64
glibc-2.12-1.80.el6.i686
glibc-common-2.12-1.80.el6.x86_64
package glibc-devel is not installed
package glibc-headers is not installed
libaio-0.3.107-10.el6.x86_64
libgcc-4.4.6-4.el6.x86_64
libgcc-4.4.6-4.el6.i686
libstdc++-4.4.6-4.el6.x86_64
package libstdc++-devel is not installed
make-3.81-20.el6.x86_64
sysstat-9.0.4-20.el6.x86_64
package elfutils-libelf-devel is not installed
package pdksh is not installed
package unixODBC is not installed
package unixODBC-devel is not installed
package libaio-devel is not installed
compat-libstdc++-33-3.2.3-69.el6.x86_64

通过yum安装没有的包

[root@qht131 u01]# yum install elfutils-libelf-devel gcc-c++  libstdc++-devel pdksh unixODBC  unixODBC-devel libaio-devel
[root@qht131 u01]# rpm -q binutils elfutils-libelf gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libgcc  libstdc++  libstdc++-devel make sysstat elfutils-libelf-devel  pdksh unixODBC unixODBC-devel libaio-devel compat-libstdc++-33
binutils-2.20.51.0.2-5.34.el6.x86_64
elfutils-libelf-0.164-2.el6.x86_64
gcc-4.4.7-23.el6.x86_64
gcc-c++-4.4.7-23.el6.x86_64
glibc-2.12-1.212.el6.x86_64
glibc-2.12-1.212.el6.i686
glibc-common-2.12-1.212.el6.x86_64
glibc-devel-2.12-1.212.el6.x86_64
glibc-headers-2.12-1.212.el6.x86_64
libaio-0.3.107-10.el6.x86_64
libgcc-4.4.7-23.el6.x86_64
libgcc-4.4.7-23.el6.i686
libstdc++-4.4.7-23.el6.x86_64
libstdc++-devel-4.4.7-23.el6.x86_64
make-3.81-20.el6.x86_64
sysstat-9.0.4-20.el6.x86_64
elfutils-libelf-devel-0.164-2.el6.x86_64
package pdksh is not installed
unixODBC-2.2.14-14.el6.x86_64
unixODBC-devel-2.2.14-14.el6.x86_64
libaio-devel-0.3.107-10.el6.x86_64
compat-libstdc++-33-3.2.3-69.el6.x86_64

pdksh无法通过yum安装,得从http://www.rpm-find.net下载一个rpm包手动安装:

[root@qht131 resource]# rpm -ivh pdksh-5.2.14-30.x86_64.rpm
warning: pdksh-5.2.14-30.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 73307de6: NOKEY
Preparing...                ########################################### [100%]
   1:pdksh                  ########################################### [100%]

3.安装之前的准备工作

3.1关闭selinux以及防火墙

[root@qht131 resource]# 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
[root@qht131 resource]# service iptables status
iptables: Firewall is not running.
[root@qht131 resource]# chkconfig iptables off

3.2创立oracle用户及组

[root@qht131 ~]# groupadd dba
[root@qht131 ~]# groupadd oinstall
[root@qht131 ~]# useradd -g oinstall -G dba oracle
[root@qht131 ~]# id oracle
uid=500(oracle) gid=502(oinstall) groups=502(oinstall),501(dba)
[root@qht131 ~]# passwd oracle

3.3修改系统参数文件:

[root@qht131 ~]# cat  /etc/sysctl.conf
#for oracle 11g  #增加以下参数 
fs.file-max=6815744
fs.aio-max-nr = 1048576
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 = 1048586
[root@qht131 ~]# sysctl -p  --应用新的参数 
[root@qht131 ~]# cat  /etc/security/limits.conf
#for oracle 11g  #增加以下参数 
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240
[root@qht131 ~]# cat /etc/pam.d/login
#for orace 11g #增加以下参数 
session    required     pam_limits.so

3.4修改oracle安装目录的权限,切换到oracle用户,修改oracle环境变量

[root@qht131 ~]# mkdir -p /u01/app/oracle/product/11203
[root@qht131 ~]# chown -R oracle:oinstall /u01
[root@qht131 ~]# chmod -R 775 /u01
[root@qht131 ~]# su - oracle
[oracle@qht131 ~]$ cat .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
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11203
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
[oracle@qht131 ~]$ source .bash_profile

4.开始静默安装:

root@qht131 resource]# unzip p10404530_112030_Linux-x86-64_1of7.zip
root@qht131 resource]# unzip p10404530_112030_Linux-x86-64_2of7.zip
[oracle@qht131 database]$/u01/resource/
[oracle@qht131 database]$ ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq  -showProgress oracle.install.option=INSTALL_DB_SWONLY   DECLINE_SECURITY_UPDATES=true UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory SELECTED_LANGUAGES=en ORACLE_HOME=/u01/app/oracle/product/11203 ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=dba  oracle.install.db.isRACOneInstall=false oracle.install.db.config.starterdb.type=GENERAL_PURPOSE SECURITY_UPDATES_VIA_MYORACLESUPPORT=false oracle.installer.autoupdates.option=SKIP_UPDATES
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 7102 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 496 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-07-13_05-06-52PM. Please wait ...[oracle@qht131 database]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2018-07-13_05-06-52PM.log

Prepare in progress.
..................................................   9% Done.

Prepare successful.

Copy files in progress.
..................................................   14% Done.
..................................................   94% Done.

Setup files successful.
The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2018-07-13_05-06-52PM.log' for more details.

Execute Root Scripts in progress.

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/11203/root.sh


..................................................   100% Done.

Execute Root Scripts successful.
Successfully Setup Software.

最后根据要求用root执行一下两个脚本:

[root@qht131 ~]# sh /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@qht131 ~]# sh /u01/app/oracle/product/11203/root.sh
Check /u01/app/oracle/product/11203/install/root_qht131_2018-07-13_17-16-07.log for the output of root script

检查一下:

[oracle@qht131 ~]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 13 17:18:11 2018

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

5.软件安装完毕,接着就是新建一个数据库

[oracle@qht131 ~]$ mkdir -p /u01/oradata
[oracle@qht131 ~]$ cat createdb.rsp 

[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl"
SID = "orcl"
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "sys"
SYSTEMPASSWORD = "sys"
SYSMANPASSWORD = "sys"
DBSNMPPASSWORD = "sys"
DATAFILEDESTINATION ="/u01/oradata"
STORAGETYPE=FS
CHARACTERSET = "WE8MSWIN1252"
DATABASETYPE = "MULTIPURPOSE"
AUTOMATICMEMORYMANAGEMENT = "FALSE"
[oracle@qht131 ~]$ dbca -silent -responseFile /home/oracle/createdb.rsp

最后如果有需要的话重建密码文件:

[oracle@qht131 dbs]$ rm orapworcl
[oracle@qht131 dbs]$ orapwd file=$ORACLE_HOME/dbs/orapworcl entries=30

Enter password for SYS:

猜你喜欢

转载自blog.csdn.net/jolly10/article/details/81018415