database's docs

1.1.0 silent模式安装oracle 11G R2 之 oracle程序安装


1. 安装oracle

1) 编辑db_install.rsp

# database/response中有silent模式安装需要的rsp文件
ls /home/oracle/database/response/
dbca.rsp  db_install.rsp  netca.rsp
# db_install.rsp – used to install oracle binaries, install/upgrade a  database in silent mode
# dbca.rsp – used to install/configure/delete a database in silent mode
# netca.rsp – used to configure simple network for oracle database in silent mode

# 编辑db_install.rsp
cd /home/oracle/database/response/
cp db_install.rsp db_install.rsp.bak
vim db_install.rsp
*****************************
# --force to install only database software
oracle.install.option=INSTALL_DB_SWONLY

# --set your hostname
ORACLE_HOSTNAME=oel6.dbaora.com

# --set unix group for oracle inventory
UNIX_GROUP_NAME=oinstall

# --set directory for oracle inventory
INVENTORY_LOCATION=/u01/app/oraInventory

# --set oracle home for binaries
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

# --set oracle home for binaries
ORACLE_BASE=/u01/app/oracle

# --set version of binaries to install
# -- EE - enterprise edition
oracle.install.db.InstallEdition=EE

# --specify extra groups for database management
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper

# 数据库类型
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

#------------------------------------------------------------------------------
# Specify whether to enable the user to set the password for
# My Oracle Support credentials. The value can be either true or false.
# If left blank it will be assumed to be false.
#
# Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#------------------------------------------------------------------------------
# Specify whether user wants to give any proxy details for connection.
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example    : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true
*****************************

2) 安装oracle

# 使用root身份,修改目录权限
su -
chown -R oracle:oinstall /u01/

## 切换回oracle,并启动安装程序
su - oracle
./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp -ignorePrereq
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 35584 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3132 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-12-20_07-35-46PM. Please wait ...[oracle@oel6 database]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2016-12-20_07-35-46PM.log
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

Successfully Setup Software.

## 以root身份登陆新的ssh会话,然后执行以下命令
sh /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.

sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_oel6.dbaora.com_2016-12-20_19-40-29.log for the output of root script

## 以root身份执行完以上两个脚本后,回到oracle用户的ssh会话,然后按下enter键

3) 检查oracle状态

## 检测安装成果
sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 20 19:47:02 2016

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

Connected to an idle instance.

SQL> exit
Disconnected