靜默安裝ORACLE 軟體

djb1008發表於2011-12-15
1.環境描述
LINUX 5.4 X86
安裝ORACLE 10.2.0.1[@more@]

2.安裝前的準備工作
參看oracle官方的安裝文件(linux86的文件為B15660-0.pdf),完成安裝前的系統準備,這裡簡單列舉一下:
A. 打需要的包,進入linux的作業系統的安裝目錄,按順序打下面的包:
rpm -Uvh compat-db-4*
rpm -Uvh libaio-0*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh kernel-headers-2.6.18-164.el5.i386.rpm
rpm -Uvh glibc-headers-2.5-42.i386.rpm
rpm -Uvh glibc-devel-2.5-42.i386.rpm
rpm -Uvh compat-gcc-34-3.4.6-4.i386.rpm
rpm -Uvh compat-gcc-34-c++-3.4.6-4.i386.rpm
rpm -Uvh libXp-1*
rpm -Uvh openmotif-2*
rpm -Uvh libgomp-4.4.0-6.el5.i386.rpm
rpm -Uvh gcc-4*

rpm -Uvh glibc-2.5-42.i686.rpm
rpm -Uvh libgomp-4.4.0-6.el5.i386.rpm
rpm -Uvh gcc-4.1.1-52.el5.i386.rpm

B. vi /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 101365
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=1048576
net.core.rmem_max=10485756
net.core.wmem_default=1048576
net.core.wmem_max=1048576

執行下面命令使設定生效/sbin/sysctl -p

C. vi /etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

D. vi /etc/pam.d/login

session required /lib/security/pam_limits.so

E. vi /etc/selinux/config

#SELINUXTYPE=targeted
SELINUXTYPE=disabled

F.新增oracle使用者和組
groupadd oinstall
groupadd dba
groupadd oper
useradd -m -g oinstall -G dba oracle
passwd oracle
useradd nobody

G. 建立安裝目錄並賦予oracle相應許可權
mkdir -p /oracle/product/10.2.0/db_1
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle

H.編輯oracle的profile
vi /home/oracle/.bash_profile

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
ORACLE_SID=orcl
export ORACLE_SID
ORACLE_TERM=xterm
export ORACLE_TERM
PATH=/usr/sbin:$PATH
PATH=$ORACLE_HOME/bin:$PATH
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH
#LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

export LANG=en_US.utf8
export LANGUAGE=en_US.utf8
export NLS_LANG="Simplified Chinese_China.UTF8"
export LC_ALL=en_US.utf8

2. 編輯responsefile檔案
將軟體解壓縮(本例為/setup/database),進入子目錄response,編輯enterprise.rsp,檔案中有各個引數的詳細說明
本例只是安裝軟體,不建立資料庫,可以透過命令看到除去解釋的語句
$cat enterprise.rsp|grep -v ^#|grep -v ^$>silent.rsp
$more silent.rsp

RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME=oinstall
FROM_LOCATION="../stage/products.xml"
ORACLE_HOME="/oracle/product/10.2.0/db_1"
ORACLE_HOME_NAME="OraDbHome1"
TOPLEVEL_COMPONENT={"oracle.server","10.2.0.1.0"}
DEINSTALL_LIST={"oracle.server","10.2.0.1.0"}
SHOW_SPLASH_SCREEN=false
SHOW_WELCOME_PAGE=false
SHOW_NODE_SELECTION_PAGE=false
SHOW_SUMMARY_PAGE=false
SHOW_INSTALL_PROGRESS_PAGE=false
SHOW_CONFIG_TOOL_PAGE=false
SHOW_XML_PREREQ_PAGE=false
SHOW_ROOTSH_CONFIRMATION=true
SHOW_END_SESSION_PAGE=false
SHOW_EXIT_CONFIRMATION=false
NEXT_SESSION=false
NEXT_SESSION_ON_FAIL=false
SHOW_DEINSTALL_CONFIRMATION=false
SHOW_DEINSTALL_PROGRESS=false
RESTART_SYSTEM=false
RESTART_REMOTE_SYSTEM=false
REMOVE_HOMES="/oracle/product/10.2.0/db_2"
ORACLE_HOSTNAME="ocmdb"
SHOW_END_OF_INSTALL_MSGS=false
CLUSTER_NODES=
COMPONENT_LANGUAGES={"en"}
INSTALL_TYPE="EE"
s_nameForDBAGrp="dba"
s_nameForOPERGrp="oper"
n_configurationOption=3
s_ASMSYSPassword=""
s_ASMSYSPasswordAgain=""
n_dbType=2
oracle.assistants.server:s_responseFileName=
s_globalDBName=
s_dbSid="orcl"
s_dbRetChar="WE8ISO8859P1"
b_loadExampleSchemas=false
b_useDBControl=true
b_receiveEmailNotification=false
s_dlgEMSMTPServer=
s_dlgEMEmailAddress=
s_dlgEMCentralAgentSelected=
n_dbStorageType=
s_mountPoint=
s_rawDeviceMapFileLocation=
b_enableAutoBackup=false
b_useFileSystemForRecovery=true
s_dlgRBORecoveryLocation=
s_dlgRBOUsername=
s_dlgRBOPassword=
s_dlgASMCfgDiskGroupName="DATA"
s_dlgASMCfgDiskDiscoveryString=
n_dlgASMCfgRedundancySelected=
sl_dlgASMCfgSelectableDisks=
sl_dlgASMCfgDiskSelections=
sl_dlgASMDskGrpSelectedGroup={" "," "," "," "}
b_centrallyManageASMInstance=true
b_useSamePassword=true
s_superAdminSamePasswd=
s_superAdminSamePasswdAgain=
sl_superAdminPasswds=
sl_superAdminPasswdsAgain=
n_performUpgrade=0
n_upgradeDB=0
s_dbOHSelectedForUpgrade=""
s_dbSIDSelectedForUpgrade=""
n_upgradeASM=0
s_dbSelectedUsesASM="no"
sl_upgradableSIDBInstances={}
sl_upgradableRACDBInstances={}
n_dbSelection=0
b_stateOfUpgradeASMCheckbox=false
b_stateOfUpgradeDBCheckbox=false
b_oneClick=false
s_dlgASMCfgRedundancyValue=""
s_dlgASMCfgExistingFreeSpace="0"
s_dlgASMCfgNewDisksSize=""
s_dlgASMCfgAdditionalSpaceNeeded="0 MB"


3. 使用靜默方式進行安裝
$cd /setup/database/
$./runInstaller -silent -noconfig -responseFile /setup/database/response/enterprise.rsp

4. 執行root.sh檔案,完成安裝
/oracle/product/10.2.0/db_1/root.sh

靜默安裝的速度明顯比圖形安裝來得快,而且穩定,是沒有圖形化工具支援的情況下的最好選擇.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/32980/viewspace-1056843/,如需轉載,請註明出處,否則將追究法律責任。

相關文章