Oracle静默安装

ORACLE Installing Prerequisites

 

交换分区大小要求:

Available RAM Swap Space Required
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 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 (i686 & x86_64)
elfutils-libelf
elfutils-libelf-devel
gcc
gcc-c++
glibc (i686 & x86_64)
glibc-common
glibc-devel
glibc-headers
ksh
libaio
libaio-devel
libgcc 
libstdc++ (i686 & x86_64)
libstdc++-devel
make
sysstat 
unixODBC (i686 & x86_64)
unixODBC-devel (i686 & x86_64)

部分单独的安装包可以从以下镜像获取:

可以将以上内容写入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
PATH=$PATH:$HOME/bin:/usr/local/rlwrap/bin
export PATH
export TMP=/tmp
export ORACLE_BASE=/DBBK/oracle
export ORACLE_HOME=/DBBK/oracle/product/11.2.0
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin
export NLS_LANG=American_America.AL32UTF8
export LD_LIBRARY_PATH=/lib64:/lib:/usr/lib:/lib:/usr/lib64:/usr/local/lib64
export CLASSPATH=/jre:/jlib:/rdbms/jlib
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
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
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dba
ORACLE_BASE=/u01/app
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
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
oracle.install.db.DBA_GROUP=oinstall
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=dbastad
oracle.install.db.config.starterdb.SID=orcl
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
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 -ignorePrereq /tmp/database/response/db_install.rsp
这里需要加一个-ignorePrereq参数,因为在RHEL6.4 X86_64中安装过程中进行安装前的检查时会要求安装一些i386 32位的包,但这类包在6里面已经改成i686的包了。即使装好i686的,仍然报错。所以忽略掉这些检查项。
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

 

你可能感兴趣的:(oracle,静默安装)