更多博文请关注:(www.xuchanggang.cn)

1.手工删除oracle软件:

删除/etc/ora*
删除软件安装目录下的所有文件,我这里是:/u01/app/oracle/*
删除/usr/local/bin/*
2.命令行下安装oracle软件:
(1).编写应答文件,一般下载的数据库解压包中,有应答文件的模板,我们这里修改一下即可

[oracle@stu135 database]$ pwd     # 我的数据库解压后在/tmp/database目录下/tmp/database[oracle@stu135 database]$ ls     #  response目录为应答文件所在目录,进入doc  install  response  runInstaller  stage  welcome.html[oracle@stu135 database]$ cd response/[oracle@stu135 response]$ lscustom.rsp  dbca.rsp  emca.rsp  enterprise.rsp  netca.rsp  standard.rsp[oracle@stu135 response]$ cp enterprise.rsp /tmp/database/ent.rsp   # 复制应答文件,并改名[oracle@stu135 response]$ vim /tmp/database/ent.rsp   # 编辑应答文件#  主要修改如下参数,其他参数暂时默认【我们这里的安装,是大家了解有这种方法】UNIX_GROUP_NAME= "oinstall"   # 组名,这个组时我们自己建的FROM_LOCATION="/tmp/database/stage/products.xml"    # 指定products.xml路径,绝对路径ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_2"    # 指定oracle产品的安装目录ORACLE_HOME_NAME= "oracle_home2"     # 指定这个数据库产品的名字,即软件的名字,方便以后删除ORACLE_HOSTNAME= "xcg.xuchanggang.cn"   # 指定自己机器的主机名COMPONENT_LANGUAGES={"en"}            # 指定语言INSTALL_TYPE="EE"                # 指定安装版本,这里是企业版s_nameForDBAGrp= "dba"           # 指定DBA组s_nameForOPERGrp= "dba"          # 指定操作组n_configurationOption=3        # 指定配置说明,文件中数字代表的含义,都有注释说明,这里仅安装软件

(2).运行脚本(自带),就在数据库解压目录下

[oracle@stu135 database]$ lsdoc  ent.rsp  install  response  runInstaller  stage  welcome.html[oracle@stu135 database]$ ./runInstaller -help   # 如果不知道跟那些参数,可以用help查询# 使用静默安装【无交互的】,指定应答文件,忽略系统检查,此步可省略[oracle@stu135 database]$ ./runInstaller -responseFile /tmp/database/ent.rsp -ignoreSysPrereqs -silentStarting Oracle Universal Installer...Checking installer requirements...................................................(详细的安装过程省略)Installation in progress (Mon Jun 17 15:32:29 CST 2013)...............................................................  18% Done................................................................  36% Done................................................................  54% Done................................................................  73% Done.............                                                     76% Done.Install successful

(3).安装完成后,会提示安装脚本[两个脚本:orainstRoot.sh / root.sh ],两个脚本以root用户身份运行

[root@stu135 db_1]# cd /u01/app/oracle/oraInventory/[root@stu135 oraInventory]# bash orainstRoot.shChanging permissions of /u01/app/oracle/oraInventory to 770.Changing groupname of /u01/app/oracle/oraInventory to oinstall.The execution of the script is complete[root@stu135 oraInventory]# cd /u01/app/oracle/product/10.2.0/db_2/[root@stu135 db_2]# bash root.shRunning Oracle10 root.sh script...The following environment variables are set as:    ORACLE_OWNER= oracle    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_2Enter the full pathname of the local bin directory: [/usr/local/bin]:   # 这里直接回车   Copying coraenv to /usr/local/bin ...Creating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdyFinished running generic part of root.sh script.Now product-specific root actions will be performed.

(4).到此,oracle软件算是安装成功了,下面就是手动安装数据库