静默安装DB软件:
设置responseFile文件。
[oracle@stream ~]$ cd database/response [oracle@stream database]$ vi db_install.rsp
修改db_install.rsp文件的以下内容。
oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oracle/oraInventory 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=false oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=dba DECLINE_SECURITY_UPDATES=true
执行安装命令。
[oracle@stream database]$ ./runInstaller -silent - responseFile /home/oracle/database/response/db_install.rsp Starting Oracle Universal Installer... Checking Temp space:must be greater than 80 MB.Actual 10766 MB Passed Checking swap space:must be greater than 150 MB.Actual 2020 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-03-01_10-06-14AM. Please wait ... You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2012-03-01_10-06-14AM.log
此时,会在后台进行数据库软件的安装,可能需要挺长的时间,可以在开一个SHELL,去监控安装数据库时产生的日志文件。
[oracle@stream database]$ tail –f /u01/app/oraInventory/logs/ installActions2012-03-01_10-06-14AM.log
直到提示用root用户执行/u01/app/oracle/product/11.2.0/dbhome_1/root.sh脚本。
The following configuration scripts need to be executed as the "root" user. #!/bin/sh #Root scripts to run /u01/app/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
新打开一个SHELL,切换到root用户执行上述2个脚本。
[root@stream ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script. is complete.
用root用户执行完这两个脚本后,在执行静默安装的SHELL窗口按下回车键,结束安装过程。
DBCA静默建库:
1、修改responseFile文件的以下内容:
[oracle@stream ~]$ vi database/response/dbca.rsp RESPONSEFILE_VERSION = "11.2.0" OPERATION_TYPE = "createDatabase" GDBNAME = "STREAM" SID = "stream" TEMPLATENAME = "New_Database.dbt" SYSPASSWORD = "oracle" SYSTEMPASSWORD = "oracle" SYSMANPASSWORD = "oracle" DBSNMPPASSWORD = "oracle" DATAFILEDESTINATION ="/u01/app/oracle/oradata/stream" STORAGETYPE=FS CHARACTERSET = "ZHS16GBK" NATIONALCHARACTERSET= "AL16UTF16" DATABASETYPE = "MULTIPURPOSE" AUTOMATICMEMORYMANAGEMENT = "FALSE"
以上参数的含义如下:
RESPONSEFILE_VERSION:数据库版本信息。 OPERATION_TYPE:执行操作类型:创建数据库、根据DB创建模板、 创建克隆模板、删除数据库、配置数据库、添加实例(RAC环境下)、 删除实例(RAC环境下) GDBNAME:指定Global Name SID:指定SID TEMPLATENAME:模板名称 SYSPASSWORD:SYS用户密码 SYSTEMPASSWORD:SYSTEM用户密码 SYSMANPASSWORD:SYSMAN用户的密码,当EM管理类型选择local的时候需要 DBSNMPPASSWORD:DBS的密码,当EM设置了之后需要 DATAFILEDESTINATION:数据库文件的存放目录 STORAGETYPE:数据库要创建在何种文件类型FS、ASM等 CHARACTERSET:数据库字符集 NATIONALCHARACTERSET:国家字符集 DATABASETYPE:指定数据库的类型,有OLTP或者warehouse AUTOMATICMEMORYMANAGEMENT:是否开启AMM内存自动管理
2.配置好responseFile文件以后,就可以开始静默安装了。
[oracle@stream database]$ dbca -silent -responseFile /home/oracle/database/response/dbca.rsp Copying database files 1% complete 3% complete 37% complete Creating and starting Oracle instance 40% complete 45% complete 50% complete 55% complete 56% complete 60% complete 62% complete Completing Database Creation 66% complete 70% complete 73% complete 85% complete 96% complete 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/STREAM/ STREAM.log" for further details. 数据库创建完成后,登录数据库,验证是否成功创建。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24966341/viewspace-753008/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24966341/viewspace-753008/