以前总以为安装oracle时必须使用图形界面,看来落伍了。现在可以用oracle的slient模式,全部命令行的形式安装oracle.
原理是将图型界面需要手工输入的参数,全部写到配置文件里面。然后在最开始的时候指定这个配置文件就可以了。
1:首先建立一个配置文件:
$ vi $DISTRIB/db_swonly.rsp
#--------------------------------------------------------------------
#以下参数不要更改
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
DECLINE_SECURITY_UPDATES=true
#以下参数根据实际情况更改,一般也无需更改
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN,zh_TW
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
oracle.install.db.customComponents=oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
2:然后开始安装:$ ./runInstaller -silent -force -noconfig -responseFile $DISTRIB/db_swonly.rsp
主要是silent和responseFile两个参数force允许安装oracle到一个非空的目录。
3:控制台直到出现以下提示则表示安装完成:
#-------------------------------------------------------------------
...
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dbhome_1/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.
参考:http://space.itpub.net/16574996/viewspace-616509
http://yangtingkun.itpub.net/post/468/407375