一、静默安装数据库软件
1、准备参数文件
这个参数文件是用于安装软件使用的,里边配置了需要安装的版本、语言、ORACLE_HOME等信息。
这个文件的模版在database/response目录下的db_install.rsp,文件中的各个参数作用参考#OUICG183
#修改记录如下:
oracle.install.option=INSTALL_DB_SWONLY #只安装软件
UNIX_GROUP_NAME=oinstall #安装的操作系统用户组
INVENTORY_LOCATION=/u01/app/oraInventory/ #Inventory目录路径
SELECTED_LANGUAGES=en #安装语言
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db #Oracle Home路径
ORACLE_BASE=/u01/app/oracle/ #Oracle Base路径
oracle.install.db.InstallEdition=EE #数据库版本 EE企业版
oracle.install.db.DBA_GROUP=dba #DBA组所属的操作系统用户组
oracle.install.db.OPER_GROUP=oinstall #OPER组所属的操作系统用户组
DECLINE_SECURITY_UPDATES=true #必须设置为true,否则需要修改其他信息
#创建Inventory目录
[oracle@rhel6 11.2.0.4_database]$ cd /u01/app/
[oracle@rhel6 app]$ ls
oracle
[oracle@rhel6 app]$ mkdir oraInventory
2、静默安装
[oracle@rhel6 11.2.0.4_database]$ ./runInstaller -silent -force -responseFile /opt/soft/11g/11.2.0.4_database/response/install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 34496 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-12-21_05-02-49PM. Please wait ...[oracle@rhel6 11.2.0.4_database]$ [WARNING] [INS-13014] Target environment do not meet some optional requ
irements. CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2016-12-21_05-02-49PM/installActions2016-12-21_05-02-49PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2016-12-21_05-02-49PM/installActions2016-12-21_05-02-49PM.log. Then either from the log file or from installation manual f
ind the appropriate configuration to meet the prerequisites and fix it manually.You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2016-12-21_05-02-49PM.log
#日志文件:/u01/app/oraInventory/logs/installActions2016-12-21_05-02-49PM.log
[oracle@rhel6 11.2.0.4_database]$ The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2016-12-21_05-02-49PM.log' for more details.
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/11.2.0/db/root.sh
Successfully Setup Software.
3、使用root执行脚本
[root@rhel6 response]# /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@rhel6 response]# /u01/app/oracle/product/11.2.0/db/root.sh
Check /u01/app/oracle/product/11.2.0/db/install/root_rhel6_2016-12-21_17-12-23.log for the output of root script
[root@rhel6 response]# cat /u01/app/oracle/product/11.2.0/db/install/root_rhel6_2016-12-21_17-12-23.log
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/db
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Finished product-specific root actions.
#测试sqlplus
[oracle@rhel6 11.2.0.4_database]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 21 17:16:19 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
4、手工建库
官方文档:#CIAEJDBE
4.1 配置环境变量
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db
export ORACLE_SID=mydb
export PATH=$PATH:$ORACLE_HOME/bin
#创建数据文件存储目录
[oracle@rhel6 oracle]$ cd $ORACLE_BASE
[oracle@rhel6 oracle]$ mkdir -p oradata/mydb
4.2 手工创建pfile