Oracle静默安装

ORACLE Installing Prerequisites

 

交换分区大小要求:

Available RAMSwap Space Required
Between 1 GB and 2 GB1.5 times the size of the RAM
Between 2 GB and 16 GBEqual to the size of the RAM
More than 16 GB16 GB

 

临时文件目录/tmp至少需要1G大小,建议为4G。

linux下可通过以下命令查看:

free & grep SwapTotal /proc/meminfo

官方网站上提到AMM功能需要更多的共享内存和文件描述符,而每个数据库实例所需的共享内存至少大于MEMORY_MAX_TARGET和MEMORY_TARGET,最大可用共享内存取决于系统设置,通过以下命令查看:

df -h /dev/shm

RHEL 5版本下所需要的包:

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

可以将以上内容写入pks.txt中,通过简单的shell script循环查看包是否已安装:

#!/bin/bash
for paks in `cat pks.txt`
do
pakst=`rpm -qa $paks | head -1`
if [ -z $pakst ]
then
echo "$paks hasn‘t install"
yum -y install $paks
fi
done
tar zxvf rlwrap-0.37.tar.gz
./configure --prefix=/usr/local/rlwrap && make && make install
cat >>/home/oracle/.bashrc<< EOF
alias sqlplus=‘rlwrap sqlplus‘
alias lsnrctl=‘rlwrap lsnrctl ‘
alias rman=‘rlwrap rman‘
EOF
设置系统参数及环境配置
cat>>/etc/sysctl.conf<<EOF
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
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
EOF
cat>>/etc/security/limits.conf<<EOF
oracle soft memlock 524280
oracle hard memlock 524280
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
EOF
cat>>/home/oracle/.bash_profile<<EOF
export TMP=/tmp
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dba
export ORACLE_SID=orcle
xport PATH=$PATH:$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
EOF
cat>>/etc/pam.d/login<<EOF
session required pam_limits.so
EOF

 

修改静默安装模板,通常在安装包中能找到db_install.rsp等rsp结尾的文件,实在找不目录用find命令查找

####################################################################
## Copyright(c) Oracle Corporation 1998,2008. All rights reserved.##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## can help to populate the variables with the appropriate        ##
## values.                                                        ##
##                                                                ##
## IMPORTANT NOTE: This file contains plain text passwords and    ##
## should be secured to have read permission only by oracle user  ##
## or db administrator who owns this installation.                ##
##                                                                ##
####################################################################
#------------------------------------------------------------------------------
# Do not change the following system generated value.
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# 1. INSTALL_DB_SWONLY
# 2. INSTALL_DB_AND_CONFIG
# 3. UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=dbastad
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01
#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.
#
# en : English ja : Japanese
# fr : French ko : Korean
# ar : Arabic es : Latin American Spanish
# bn : Bengali lv : Latvian
# pt_BR: Brazilian Portuguese lt : Lithuanian
# bg : Bulgarian ms : Malay
# fr_CA: Canadian French es_MX: Mexican Spanish
# ca : Catalan no : Norwegian
# hr : Croatian pl : Polish
# cs : Czech pt : Portuguese
# da : Danish ro : Romanian
# nl : Dutch ru : Russian
# ar_EG: Egyptian zh_CN: Simplified Chinese
# en_GB: English (Great Britain) sk : Slovak
# et : Estonian sl : Slovenian
# fi : Finnish es_ES: Spanish
# de : German sv : Swedish
# el : Greek th : Thai
# iw : Hebrew zh_TW: Traditional Chinese
# hu : Hungarian tr : Turkish
# is : Icelandic uk : Ukrainian
# in : Indonesian vi : Vietnamese
# it : Italian
#
# Example : SELECTED_LANGUAGES=en,fr,ja
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dba
ORACLE_BASE=/u01/app
#------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# EE : Enterprise Edition
# SE : Standard Edition
# SEONE : Standard Edition One
# PE : Personal Edition (WINDOWS ONLY)
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
#------------------------------------------------------------------------------
# This variable is considered only if ‘IsCustomInstall‘ is set to true.
#
# Description: List of Enterprise Edition Options you would like to install.
#
# The following choices are available. You may specify any
# combination of these choices. The components you choose should
# be specified in the form "internal-component-name:version"
# Below is a list of components you may specify to install.
#
# oracle.rdbms.partitioning:11.2.0.1.0 - Oracle Partitioning
# oracle.rdbms.dm:11.2.0.1.0 - Oracle Data Mining
# oracle.rdbms.dv:11.2.0.1.0 - Oracle Database Vault
# oracle.rdbms.lbac:11.2.0.1.0 - Oracle Label Security
# oracle.rdbms.rat:11.2.0.1.0 - Oracle Real Application Testing
# oracle.oraolap:11.2.0.1.0 - Oracle OLAP
#------------------------------------------------------------------------------
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0
###############################################################################
#                                                                             #
# PRIVILEGED OPERATING SYSTEM GROUPS                                          #
# ------------------------------------------         #
# Provide values for the OS groups to which OSDBA and OSOPER privileges       #
# needs to be granted. If the install is being performed as a member of the   #
# group "dba", then that will be used unless specified otherwise below.       #
#                                                                             #
###############################################################################
oracle.install.db.DBA_GROUP=oinstall
oracle.install.db.OPER_GROUP=oinstall
#------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE/TRANSACTION_PROCESSING
# - DATA_WAREHOUSE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=dbastad
oracle.install.db.config.starterdb.SID=dbastad
#------------------------------------------------------------------------------
# Specify the Starter Database character set.
#
# It can be one of the following:
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=1024
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
###############################################################################
#                                                                             #
# Passwords can be supplied for the following four schemas in the             #
# starter database:                                                           #
# SYS                                                                         #
# SYSTEM                                                                      #
# SYSMAN (used by Enterprise Manager)                                         #
# DBSNMP (used by Enterprise Manager)                                         #
#                                                                             #
# Same password can be used for all accounts (not recommended)                #
# or different passwords for each account can be provided (recommended)       #
#                                                                             #
###############################################################################
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/app/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/app/oracle/flash_recovery_area
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
[oracle@dbastad ~]$ cd /tmp/database/
[oracle@dbastad database]$ ./runInstaller -silent -responseFile /tmp/database/response/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB. Actual 1391 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4094 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-05-25_02-09-32PM. Please wait ...[oracle@dbastad database]$ You can find the log of this install session at:
 /u01/oraInventory/logs/installActions2014-05-25_02-09-32PM.log
The following configuration scripts need to be executed as the "root" user.
 #!/bin/sh
 #Root scripts to run
/u01/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dba/root.sh
To execute the configuration scripts:
         1. Open a terminal window
         2. Log in as "root"
         3. Run the scripts
         4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.

安装持续大约17~20分钟

 

 

监听静默安装

netca /silent /responsefile /tmp/database/response/netca.rsp

 

 

数据实例静默安装

[oracle@dbastad response]$ dbca -silent -responsefile /tmp/database/response/dbca.rsp

Copying database files

DBCA_PROGRESS : 1%

DBCA_PROGRESS : 3%

DBCA_PROGRESS : 11%

DBCA_PROGRESS : 18%

DBCA_PROGRESS : 26%

DBCA_PROGRESS : 37%

Creating and starting Oracle instance

DBCA_PROGRESS : 40%

DBCA_PROGRESS : 45%

DBCA_PROGRESS : 50%

DBCA_PROGRESS : 55%

DBCA_PROGRESS : 56%

DBCA_PROGRESS : 60%

DBCA_PROGRESS : 62%

Completing Database Creation

DBCA_PROGRESS : 66%

DBCA_PROGRESS : 70%

DBCA_PROGRESS : 73%

DBCA_PROGRESS : 85%

DBCA_PROGRESS : 96%

DBCA_PROGRESS : 100%

Database creation complete. For details check the logfiles at:

 /u01/app/cfgtoollogs/dbca/dbastad.

 

 

如果碰到以下问题:

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener

TNS-01106: Message 1106 not found; No message file for product=network, facility=TNS [LISTENER]

 

because of  command su - -c "$ORACLE_HOME/bin/dbstart" can not read the oracle enviroment variable so give the errors  output above mentions (http://www.cnblogs.com/interboy/archive/2008/07/24/1250077.html)

 

 

 

参考链接

http://docs.oracle.com/cd/E24269_01/doc.11120/e23960/silent_install.htm

http://docs.oracle.com/html/B14399_01/app_nonint.htm#BABJFJID

http://docs.oracle.com/cd/E23943_01/install.1111/b32474/silent_install.htm#CBHFFEJD

 

本文出自 “LinuxOracle” 博客,请务必保留此出处http://onlinekof2001.blog.51cto.com/3106724/1587587

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。