静默安装Oracle

查考文档
《Installing and Configuring Oracle Database Using Response Files》
    静默安装有2种类型:完全非交互、部分交互,区别在于完全非交互的情况下需要你在响应文件中准备好全部的应答参数;后者则提供部分。对于前者在整个安装过程中不会有任何的gui显示出来,后者则在必要的时候显示出gui界面让你输入安装参数。
    如果你需要在整个安装过程中安装software并创建数据库,而且需要使用Automatic Storage Management来做数据存储话,那么必须在安装完成software运行root.sh之后重新运行后续的安装过程。但是对于普通文件系统和裸设备则不存在这个问题。
    废话少说,步入正题。
0. 环境准备
这个步骤和常规的安装一样,包括了创建oracle用户和组、创建相关安装目录、修改配置系统参数等等,不多描述了。
1. 创建oraInst.loc文件
    这个文件用来存储oracle软件安装的目录相关信息,在安装和升级软件的时候都需要用到该文件。
    静默方式下第1个步骤就是需要手工创建并编辑这个文件。
    使用root登陆操作(操作之前先创建好oracle用户和组):
cd /etc
vi oraInst.loc
cat oraInst.loc
inventory_loc=/opt/oracle/10g
inst_group=
chown oracle:oinstall oraInst.loc
chmod 664 oraInst.loc
2. 准备和编辑响应文件
oracle已经为我们提供了各种操作类型的响应文件模板了,模板位于安装介质的/response下,一共6个模板文件:
[oracle@gtlions ~]$ cd /disk/software/database/response/
[oracle@gtlions response]$ ll
总用量 244
-rwxr-xr-x  1 oracle oinstall 25278 2005-07-03  custom.rsp
-rwxr-xr-x  1 oracle oinstall 44600 2005-07-03  dbca.rsp
-rwxr-xr-x  1 oracle oinstall  8476 2005-07-03  emca.rsp
-rwxr-xr-x  1 oracle oinstall 71113 2005-07-03  enterprise.rsp
-rwxr-xr-x  1 oracle oinstall  5742 2005-07-03  netca.rsp
-rwxr-xr-x  1 oracle oinstall 71113 2005-07-03  standard.rsp
拷贝到一个新建目录下然后编辑这个文件:
[oracle@gtlions response]$ cd ../
[oracle@gtlions database]$ mkdir myresp
[oracle@gtlions database]$ cp response/*.* myresp/
[oracle@gtlions database]$ ll myresp/
总用量 244
-rwxr-xr-x  1 oracle oinstall 25278  2月 22 16:19 custom.rsp
-rwxr-xr-x  1 oracle oinstall 44600  2月 22 16:19 dbca.rsp
-rwxr-xr-x  1 oracle oinstall  8476  2月 22 16:19 emca.rsp
-rwxr-xr-x  1 oracle oinstall 71113  2月 22 16:19 enterprise.rsp
-rwxr-xr-x  1 oracle oinstall  5742  2月 22 16:19 netca.rsp
-rwxr-xr-x  1 oracle oinstall 71113  2月 22 16:19 standard.rsp
我将使用自定义的相应文件来编辑并在后面使用它来安装database software。
[oracle@gtlions database]$ vi myresp/custom.rsp
。。。。
大量编辑信息
。。。。
[oracle@gtlions database]$ chmod 700 myresp/custom.rsp
另外,你也可以使用安装程序来录制响应文件,整个过程就是普通的使用GUI的安装过程,最后可以选择是否执行安装操作等等。
./runInstaller -record -destinationFile <you_response_filename>
3. 安装database software
可以查看下安装程序的帮助信息:
[oracle@gtlions database]$ ./runInstaller -help
执行安装:
[oracle@gtlions database]$ ./runInstaller -silent -noconfig -responseFile /disk/software/database/myresp/custom.rsp
安装过程很快不到5分钟时间,到了最后提示用root执行下脚本/opt/oracle/10g/product/10.2.0/db_1/root.sh。
4. 配置netca
这个步骤基本上没有什么参数需要定制的,我采用的是默认的响应文件。
netca /silent /responsefile /disk/software/database/myresp/netca.rsp
5. 创建数据库dbca
查看帮助dbca -help
同样编辑响应文件dbca.rsp,注意的是有个参数需注意下,模板文件需要指定,这里我使用了绝对路径,编辑成如下:
TEMPLATENAME = "/opt/oracle/10g/product/10.2.0/db_1/assistants/dbca/templates/General_Purpose.dbc"
可以查找下模板位置:
[oracle@gtlions db_1]$ find -name *.dbc | more
./assistants/dbca/templates/Transaction_Processing.dbc
./assistants/dbca/templates/Data_Warehouse.dbc
./assistants/dbca/templates/General_Purpose.dbc
然后执行安装
dbca -silent -responseFile  /disk/software/database/myresp/dbca.rsp
安装过程中显示安装进度的百分比,暴快啊!!有木有!!不到5分钟的事情!
好了,验证下:
[oracle@gtlions db_1]$ sqlplus sys/000000@gtlions as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 22 17:55:53 2012

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0    Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
吼吼,静默安装的优点是速度快、低资源要求,适用于没有gui或者远程操作的情况下,不过就我自己来说还是习惯用gui界面安装方式,毕竟界面操作感觉好点,这个也就是闲的的时候折腾下即可,不必深入。
-The End-
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值