CentOS下远程静默安装Oracle10g笔记
CentOS下远程静默安装Oracle10g笔记
#CentOS 4.7 oracle 10.2.0.1

#scp user@host 10201_database_linux_x86_64.cpio /local
解压到/home/oracle/database
#cpio -ivmd < 10201_database_linux_x86_64.cpio
#######################
## 系统环境设置
#######################
1)查看kernel版本
#cat /proc/version
#uname -a
#uname -r
2)查看LINUX版本
#lsb_release -a
cat /etc/issue
以下两种方法只对Redhat Linux有效
cat /etc/redhat-release
rpm -q redhat-release
3)检查swap分区大小
#free
swapon
cat /proc/swaps
符合要求跳过,缺少的话要增加swap分区
查看可以在那里创建这个文件。
# df -ah
例如:
在/tmp下创建一个1000M的空间
(mkswap swapon 命令均在/sbin目录下 执行./mkswap)
#cd /tmp
#mkdir swaptmp
#cd swaptmp
#dd if=/dev/zero of=/tmp/swaptmp/newswap bs=1024 count=1000000
#./mkswap /tmp/swaptmp/newswap
#./swapon /tmp/swaptmp/newswap
查看是否成功启用了
#swapon -s
最后加在/etc/fstab,每次开机都会自动启用swap
4)安装Oracle所必须的软件包
运行如下命令检查所需包是否都已安装。
# rpm -q binutils compat-db compat-libstdc++-33 control-center \
gcc gcc-c++ glibc glibc-common libgnome libstdc++ \
libstdc++-devel make ksh sysstat gnome-screensaver setarch libXp
输出
binutils-2.17.50.0.6-6.el5
compat-db-4.2.52-5.1
compat-libstdc++-33-3.2.3-61
control-center-2.16.0-16.el5
gcc-4.1.2-42.el5
gcc-c++-4.1.2-42.el5
glibc-2.5-24
glibc-common-2.5-24
libgnome-2.16.0-6.el5
libstdc++-4.1.2-42.el5
libstdc++-devel-4.1.2-42.el5
make-3.81-3.el5
ksh-20060214-1.7
sysstat-7.0.2-1.el5
gnome-screensaver-2.16.1-8.el5
setarch-2.0-1.1
libXp-1.0.0-8.1.el5
如果没有出现“not found”字样则表示已安装。
缺少相应的软件包可以在http://rpm.pbone.net/下载
安装出错的解决办法
NOKEY, key ID 详解
# rpm -ivh make-3.81-3.el5.x86_64.rpm –force –nodeps
#########################
## 修改参数
#########################
1)修改系统内核参数/etc/sysctl.conf文件,增加如下内容
# vi /etc/sysctl.conf
… …
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 26214
# sysctl –p
不重启修改就生
(sysctl命令是为设置这两个目录中的文件而定制的,它被默认安装在/sbin目录中)
2)修改/etc/security/limits.conf,增加如下内容。
# vi /etc/security/limits.conf
… …
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
3)修改/etc/pam.d/login文件,增加如下内容。
# vi /etc/pam.d/login
… …
session required /lib/security/pam_limits.so
session required pam_limits.so
4)修改vi /etc/profile文件,增加如下内容。
# vi /etc/profile
… …
if [ $USER = "oracle" ];then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
#######################
## 创建用户和组
#######################
1)添加oinstall和dba用户组
# groupadd -g 501 oinstall
# groupadd -g 502 dba
2)添加oracle用户
# useradd -g oinstall -G dba -u 501 -d /oracle oracle
3)修改/oracle权限
# chown -R oracle:oinstall /home/oracle
4)使用oracle用户登录,修改.profile文件。
# su – oracle
$ pwd
/oracle
$ vi ./.profile
# !/usr/bin/bash
umask 022
ORACLE_BASE=/home/oracle/app
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
export PATH
$ source .bash_profile
使环境变量生效
5)创建相应的目录
$ pwd
/home/oracle
$ mkdir app
#######################
## 安装oracle
#######################
1)建立静默安装的应答文件
#vi /home/oracle/database/response/standard.rsp
RESPONSEFILE_VERSION=2.2.1.0.0
FROM_LOCATION=”../stage/products.xml”
ORACLE_HOME=”/u01/app/oracle/product/10.2.0/db_1/”
ORACLE_HOME_NAME=”OraDb10g_home1″
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_COMPONENT_LOCATIONS_PAGE=false
SHOW_CUSTOM_TREE_PAGE=false
SHOW_SUMMARY_PAGE=false
SHOW_INSTALL_PROGRESS_PAGE=false
SHOW_REQUIRED_CONFIG_TOOL_PAGE=false
SHOW_CONFIG_TOOL_PAGE=false
SHOW_RELEASE_NOTES=false
SHOW_ROOTSH_CONFIRMATION=false
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
ACCEPT_LICENSE_AGREEMENT=true
COMPONENT_LANGUAGES={“en”}
CLUSTER_NODES=
INSTALL_TYPE=”EE”
s_nameForDBAGrp=dba
s_nameForOPERGrp=dba
b_oneClick=false
SHOW_DATABASE_CONFIGURATION_PAGE=false
b_createStarterDB=false
相关属性的值的意义,请参考Oracle提供的standard.rsp文档中的说明 。
2)开始安装
# su – oracle
$cd /home/oracle/database
$./runInstaller -silent -responseFile /home/oracle/database/response/standard.rsp
执行过程如下:
—————————————————————————–
Installation in progress (Mon Jun 15 15:27:26 CST 2009)
……………………………………………………… 14% Done.
……………………………………………………… 28% Done.
……………………………………………………… 42% Done.
……………………………………………………… 56% Done.
……………………………………………………… 71% Done.
………….. 74% Done.
Install successful
Linking in progress (Mon Jun 15 15:28:43 CST 2009)
. 74% Done.
Link successful
Setup in progress (Mon Jun 15 15:28:44 CST 2009)
……………… 100% Done.
Setup successful
End of install phases.(Mon Jun 15 15:28:47 CST 2009)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script ‘/home/oracle/app/oraInventory/orainstRoot.sh’ with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts
/home/oracle/app/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the configuration will not be complete and the product wont function properly. In order to get the product to function properly, you will be required to execute the scripts and the configuration tools after exiting the OUI.
The installation of Oracle Database 10g was successful.
Please check ‘/home/oracle/app/oraInventory/logs/silentInstall2009-06-15_03-27-16PM.log’ for more details.
3)运行安装所需脚本
cat /home/oracle/app/oraInventory/logs/silentInstall2009-06-15_03-27-16PM.log查看日志,提示我们用root用户运行如下两个脚本
/home/oracle/app/oraInventory/orainstRoot.sh
/home/oracle/app/oracle/product/10.2.0/db_1/root.sh
至此Oracle的产品已经安装完成,还没有建立数据库。










