REDHAT 6.4 X64下ORACLE 11GR2静默安装

个人博客
前言

在某些情况下,我们不具备桌面条件,只能在命令行窗口下安装oracle

第一REDHAT6.4安装

1.2虚拟机安装REDHAT

名称随便自己起

我没有外部存储就选本地存储好了

因为我直接要在外部操作,选定的网络VM NETWORK是可以直接和我的笔记本通讯的网络

节约磁盘,用多少算算多少空间

 

第一项回车开始安装

跳过测试

 

 

进入安装界面,下一步到达语言选项,选中文

键盘默认选着 美国国际式   下一步

 

 

如果不打算安装在磁盘柜或者外置存储上就选第一项基本存储设备

选着 是,忽略所有数据

主机名随便取,我取得redhat6.4

时区选择

密码自己随便填写,记得住就好

我选择第一项,使用所有的空间,然后勾选修改分区布局。下一步

修改好后选择下一步,然后点击格式化

选择下一步

由于我们是静默安装,所以就选择基本服务器,直接下一步

大概十几分钟直到系统安装完成,输入正确的用户名和密码进如系统,查看虚拟机获得的IP地址

这个时候系统的网卡默认是没有启动的

输入 ifup eth0 启用网卡  ifconfig

Redhat 初步安装完成。

 

1.2辅助工具

切换到windows 下准备号SSH工具我的是SecureCRT

输入正确的密码后,链接到服务器。

检查下内存   管方要求最小1G 推荐2G或者大于2G

Grep MemTotal /proc/meminfo

 

检查一下磁盘空间

中文乱码。解决办法

外观,字符编码改成UTF-8

已经可以正常显示中文了,我们没有单独指定的TMP挂载点,所以剩下的空间都可用做临时文件夹

 

第二检查软件环境要求

  配置IP与主机名对应关系

1、hostname

 

2、static ip address

修改后的文件,

DEVICE=eth0

HWADDR=00:0C:29:EC:D0:45

TYPE=Ethernet

UUID=fa934d66-d4f7-495b-bb04-c4fba00686a7

ONBOOT=yes         #no 改成yes 启动自动激活

NM_CONTROLLED=yes

BOOTPROTO=static        #原来的DHCP 改成static

IPADDR=192.168.8.106      #根据自己的情况修改

NETMASK=255.255.240.0    

GATEWAY=192.168.0.254   #我要连接外网所以加了网关和DNS

DNS1=218.85.157.99

DNS2=58.22.96.66

修改后不要忘记了重启网络服务

service network restart

3、/etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.8.106 redhat   #新增加

 

 

/etc/redhat-release  其实这个选项是针对ORALCE 10G的,ORACLE11G已经可以支持redhat 6.X

 

 

4、确认 SELINUX 和IPTABLES关闭  

生产环境中防火墙功能就应该交给专门的硬件防火墙去解决。系统的功能越单一越好。

#vi /etc/selinux/config

确认里面的SELINUX字段的值是disabled,如果不是则改为disabled。

#service iptables stop

 

4、软件包的需求

binutils

compat-libcap1

compat-libstdc++-33

elfutils-libelf

elfutils-libelf-devel

gcc

gcc-c++

glibc

glibc-common

glibc-devel

glibc-headers

kernel-headers

libgcc

libstdc++

libstdc++-devel

ksh

libaio

libaio-devel

libgcc

libgomp

libstdc++

libstdc++-devel

make

sysstat

unixODBC

unixODBC-devel使用vi 命令创建一个文本文件,上面的名称直接复制进去就好

 

使用上传工具把 linux,oracle的安装包上传到/MNT/ISO目录下

 

我推荐使用 XME4 企业版

上传工具使用其中的XFTP

 

5、本地YUM源

 

 

5.1挂载镜像

挂载redhat DVD 镜像文件1到/mnt/iso/dvd1  镜像文件2到/mnt/iso/dvd2

[root@redhat ~]# mkdir -p /mnt/iso/dvd1

[root@redhat ~]# mount -o loop /mnt/iso/rhel-server-6.4-x86_64-dvd.iso  /mnt/iso/dvd1/

 

5.2修改本地源

   1.备份文件

[root@redhat ~]# cd /etc/yum.repos.d/

[root@redhat yum.repos.d]# mkdir -p bak

[root@redhat bak]# cp  /etc/yum.repos.d/Redhat-*  /etc/yum.repos.d/bak

[root@redhat bak]# cd /etc/yum.repos.d/

2.修改文件

[root@redhat yum.repos.d]# vi rhel-source.repo

原文件

修改后的文件

3.刷新yum缓存,<-没有缓存的情况下可能会报目录不存在的错误,无视

[root@redhat ~]#yum clean all

[root@redhat ~]#yum makecache

 

检查一下成功没有

[root@redhat mnt]# yum grouplist

6、安装支持包

[root@redhat yum.repos.d]# cd /mnt/

[root@redhat mnt]# cat pacakage.txt

[root@redhat mnt]# yum install $(cat pacakage.txt )

输入y 后开始安装。

 

7 、创建所需要的操作系统用户和组

       

具体命令

#groupadd -g 5000 oinstall

#groupadd -g 5001 dba

# useradd -m -g oinstall -G dba oracle

# passwd oracle

 

7、配置oracle 用户的环境变量

其实安装的时候有很多变量,很多是并不是必须的,以上四个是必须的。

7.1创建文件夹

创建Oracle安装文件夹以及数据存放文件夹

把 oracle安装在  /mnt/app/oracle  目录下,所以需创建该目录:

#mkdir -p /mnt/app/oracle

#chown -R oracle:oinstall /mnt/app/oracle

#chmod -R 755 /mnt/app/oracle

安装时数据放在/mnt/app/oracle/oradata 目录下,所以需创建该目录:

#mkdir -p /mnt/app/oracle/oradata

#chown -R oracle:oinstall /mnt/app/oracle/oradata

#chmod -R 755 /mnt/app/oracle/oradata

 安装时还需要设置  Inventory 目录,所以需创建该目录:

#mkdir -p /mnt/app/oraInventory

# chown -R  oracle:oinstall /mnt/app/oraInventory

#chmod -R 755 /mnt/app/oraInventory

设置ORACLE_HOME目录

#mkdir -p /mnt/app/oracle/product/11.2.0/dbhome_1

#chown -R oracle:oinstall /mnt/app/oracle/product/11.2.0/dbhome_1

#chmod -R 755 /mnt/app/oracle/product/11.2.0/dbhome_1

说明:想一次修改某个目录下所有文件的权限,包括子目录中的文件权限也要修改,要使用参数-R

7.2编辑环境变量

编辑文件  vim /home/oracle/.bash_profile,添加如下行:

ORACLE_BASE=/mnt/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1  

ORACLE_SID=orcl

LD_LIBRARY_PATH=$ORACLE_HOME/lib

PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

export NLS_LANG=American_American.ZHS16GBK

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

保存退出后执行如下命令使以上设置在当前窗口如果有配置有问题也可以提示。立即生效:

source /home/oracle/.bash_profile

8、调整OS内核参数

设置原则:
kernel.shmmax 为 4GB-1byte或一半的物理内存, 哪个值更低用哪个;
fs.file-max 为512 * PROCESSES.
# vi /etc/sysctl.conf (增加或修改以下参数, 参考值为最小需求, kernel.shmmax默认即可无需设置 )
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
# /sbin/sysctl -p (设置参数立即生效)

9、修改系统资源限制

编辑系统资源限制配置文件 vim /etc/security/limits.conf,在该文件下添加如下行: 

# vim /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

 

 

9、解压oracle 数据软件

解压ORALCE 压缩包到/mnt/oracleinstall

[root@redhat ~]# cd /mnt/

[root@redhat mnt]# unzip  iso/p13390677_112040_Linux-x86-64_1of7.zip  -d oracleinstall

[root@redhat mnt]# unzip  iso/p13390677_112040_Linux-x86-64_2of7.zip  -d oracleinstall

第三无提示文本模式下使用OUI安装数据库软件

 

要在无提示模式下使用OUI安装并配置ORALCE产品,请执行以下步骤

1、准备相应文件

1、根据Oracle软件提供的文件末班准备相应文件

2、在一台具体图形化界面并准好安装环境的计算机上执行.记录相应文件。

./runInstaller –record –destinationfile <filename>

2、在命令行窗口运行OUI

 ./runInstaller –silent responsefile <filename>

 

 

1、查看并编辑oralce 的应答模板

root@redhat mnt]# cd /mnt/oracleinstall/database/response/

[root@redhat response]# ls

db_install.rsp           数据软件安装的应答文件

dbca.rsp               建库的应答文件

netca.rsp               网络配置的应答文件

 

[root@redhat response]# vi db_install.rsp

 

####################################################################

## Copyright(c) Oracle Corporation 1998,2013. All rights reserved.##

##                                                                ##

## Specify values for the variables listed below to customize     ##

## your installation.                                             ##

##                                                                ##

## Each variable is associated with a comment. The comment        ##

## can help to populate the variables with the appropriate        ##

## values.                                                        ##

##                                                                ##

## IMPORTANT NOTE: This file contains plain text passwords and    ##

## should be secured to have read permission only by oracle user  ##

## or db administrator who owns this installation.                ##

##对整个文件的说明,该文件包含参数说明,静默文件中密码信息的保密##

####################################################################

 

#------------------------------------------------------------------------------

# Do not change the following system generated value.          标注响应文件版本,这个版本必须和要#安装的数据库版本相同,安装检验无法通过,不能更改不要改变这一项

#------------------------------------------------------------------------------

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

 

#------------------------------------------------------------------------------

# Specify the installation option.

# It can be one of the following:

#   - INSTALL_DB_SWONLY   仅安装DB数据库软件

#   - INSTALL_DB_AND_CONFIG  装DB数据库软件和配置库

#   - UPGRADE_DB         升级DB数据库软件

#-------------------------------------------------------------------------------

oracle.install.option= INSTALL_DB_SWONLY

 

#-------------------------------------------------------------------------------

# Specify the hostname of the system as set during the install. It can be used

# to force the installation to use an alternative hostname rather than using the

# first hostname found on the system. (e.g., for systems with multiple hostnames

# and network interfaces)

#-------------------------------------------------------------------------------

ORACLE_HOSTNAME=redhat  #可以用hostname 命令查看

 

#-------------------------------------------------------------------------------

# Specify the Unix group to be set for the inventory directory.

#-------------------------------------------------------------------------------

UNIX_GROUP_NAME=oinstall   #指定oracle inventory目录的所有者,通常会是oinstall或者dba根据前面的配置文件来,一般都是这个值

 

#-------------------------------------------------------------------------------

# Specify the location which holds the inventory files.

# This is an optional parameter if installing on

# Windows based Operating System.

#-------------------------------------------------------------------------------

INVENTORY_LOCATION=/mnt/app/oraInventory   #指定产品清单oracle inventory目录的路径,如果是Win平台下可以省略根据前面的配置文件来配置,根据需要修改

 

#-------------------------------------------------------------------------------

# Specify the languages in which the components will be installed.

#

# en   : English                  ja   : Japanese

# fr   : French                   ko   : Korean

# ar   : Arabic                   es   : Latin American Spanish

# bn   : Bengali                  lv   : Latvian

# pt_BR: Brazilian Portuguese     lt   : Lithuanian

# bg   : Bulgarian                ms   : Malay

# fr_CA: Canadian French          es_MX: Mexican Spanish

# ca   : Catalan                  no   : Norwegian

# hr   : Croatian                 pl   : Polish

# cs   : Czech                    pt   : Portuguese

# da   : Danish                   ro   : Romanian

# nl   : Dutch                    ru   : Russian

# ar_EG: Egyptian                 zh_CN: Simplified Chinese

# en_GB: English (Great Britain)  sk   : Slovak

# et   : Estonian                 sl   : Slovenian

# fi   : Finnish                  es_ES: Spanish

# de   : German                   sv   : Swedish

# el   : Greek                    th   : Thai

# iw   : Hebrew                   zh_TW: Traditional Chinese

# hu   : Hungarian                tr   : Turkish

# is   : Icelandic                uk   : Ukrainian

# in   : Indonesian               vi   : Vietnamese

# it   : Italian

#

# all_langs   : All languages

#

# Specify value as the following to select any of the languages.

# Example : SELECTED_LANGUAGES=en,fr,ja

#

# Specify value as the following to select all the languages.

# Example : SELECTED_LANGUAGES=all_langs

#------------------------------------------------------------------------------

SELECTED_LANGUAGES=en,zh_CN   #指定数据库语言,可以选择多个,用逗号隔开。选择en, zh_CN(英文和简体中文)注意标点符号,英文下的半角

 

#------------------------------------------------------------------------------

# Specify the complete path of the Oracle Home. 设置ORALCE_HOME的路径

#------------------------------------------------------------------------------

ORACLE_HOME=/mnt/app/oracle/product/11.2.0/dbhome_1 # 根据前面的配置文件来配置,根据需要修改

 

#------------------------------------------------------------------------------

# Specify the complete path of the Oracle Base. 设置ORALCE_BASE的路径

#------------------------------------------------------------------------------

ORACLE_BASE=/mnt/app/oracle # 根据前面的配置文件来配置,根据需要修改

 

#------------------------------------------------------------------------------

# Specify the installation edition of the component.

#

# The value should contain only one of these choices.

#   - EE     : Enterprise Edition 企业版

#   - SE     : Standard Edition 标准版它可以在最高容量为四个处理器的单台服务器上、或者在一个支持最多四个处理器的服务器的集群上使用。

#   - SEONE  : Standard Edition One 标着版ONE仅许可在最高容量为两个处理器的服务器上使用,不支持集群

#   - PE     : Personal Edition (WINDOWS ONLY) 个人版

#------------------------------------------------------------------------------

oracle.install.db.InstallEdition=EE

 

#------------------------------------------------------------------------------

# This variable is used to enable or disable custom install and is considered 启用自定义安装

# only if InstallEdition is EE.    仅用于企业版

#这里是是否自定义Oracle的组件,如果选择false,则会使用默认的组件,否则需要自己在下面一条

#参数将要安装的组件一一列出。通常来说只要客户购买了相应版权,我们会安装所有的组件,

#因为后期如果缺乏某个组件,要再次安装会非常的麻烦。

# true  : Components mentioned as part of 'optionalComponents' property  

#         are considered for install.

# false : Value for 'optionalComponents' is not considered.

#------------------------------------------------------------------------------

oracle.install.db.EEOptionsSelection=false #默认即可

 

#------------------------------------------------------------------------------

# This variable is considered only if 'EEOptionsSelection' is set to true.

#

# Description: List of Enterprise Edition Options you would like to enable.  选择你想用的组件列表

#

#              The following choices are available. You may specify any

#              combination of these choices.  The components you choose should

#              be specified in the form "internal-component-name:version"

#              Below is a list of components you may specify to enable.

#

#              oracle.oraolap:11.2.0.4.0 - Oracle OLAP

#              oracle.rdbms.dm:11.2.0.4.0 - Oracle Data Mining

#              oracle.rdbms.dv:11.2.0.4.0 - Oracle Database Vault

#              oracle.rdbms.lbac:11.2.0.4.0 - Oracle Label Security

#              oracle.rdbms.partitioning:11.2.0.4.0 - Oracle Partitioning

#              oracle.rdbms.rat:11.2.0.4.0 - Oracle Real Application Testing

#oracle.install.db.isCustomInstall=true的话必须手工选择需要安装组件的话,我们默认就好,组件全部都选了

#------------------------------------------------------------------------------

oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0

 

###############################################################################

#                                                                             #

# PRIVILEGED OPERATING SYSTEM GROUPS                                          #

# ------------------------------------------                                  #

# Provide values for the OS groups to which OSDBA and OSOPER privileges       #

# needs to be granted. If the install is being performed as a member of the   # 

# group "dba", then that will be used unless specified otherwise below.       #

#                                                                             #

# The value to be specified for OSDBA and OSOPER group is only for UNIX based #

# Operating System.                                                           #

#指定拥有OSDBA、OSOPER权限的用户组,通常会是dba组        #

###############################################################################

 

#------------------------------------------------------------------------------

# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.

#------------------------------------------------------------------------------

oracle.install.db.DBA_GROUP=dba

 

#------------------------------------------------------------------------------

# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.

# The value to be specified for OSOPER group is optional.

#------------------------------------------------------------------------------

oracle.install.db.OPER_GROUP=oinstall    #指定OPER组,通常是oinstall

 

#------------------------------------------------------------------------------

# Specify the cluster node names selected during the installation.

# Example : oracle.install.db.CLUSTER_NODES=node1,node2

#------------------------------------------------------------------------------

oracle.install.db.CLUSTER_NODES=  #如果是RAC的安装,在这里指定所有的节点

 

#------------------------------------------------------------------------------

# This variable is used to enable or disable RAC One Node install. 

#  启用或者关闭RAC ONE NODE数据库的安装,用于集群对应与

# 集群数据库 RAC database  单实例数据库 single instance database

#   - true  : Value of RAC One Node service name is used.

#   - false : Value of RAC One Node service name is not used.

#

# If left blank, it will be assumed to be false

 

#------------------------------------------------------------------------------

oracle.install.db.isRACOneInstall=

 

#------------------------------------------------------------------------------

# Specify the name for RAC One Node Service.  指定RAC ONE NODE的服务名词

#------------------------------------------------------------------------------

oracle.install.db.racOneServiceName=

 

#------------------------------------------------------------------------------

# Specify the type of database to create.  这里选择数据库的用途,一般用途/事物处理,数据仓库

# It can be one of the following:

#   - GENERAL_PURPOSE/TRANSACTION_PROCESSING

#   - DATA_WAREHOUSE

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.type= GENERAL_PURPOSE

 

#------------------------------------------------------------------------------

# Specify the Starter Database Global Database Name. 指定Global Name

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.globalDBName=

 

#------------------------------------------------------------------------------

# Specify the Starter Database SID. 指定SID

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.SID=orcl

#------------------------------------------------------------------------------

# Specify the Starter Database character set.

#非常关键的一步,选择字符集。错误的字符集会给后期带来无尽的麻烦,所以一定要确认好字符集。通常我们选择的是ZHS16GBK, 所谓的国标16位简体中文库

# It can be one of the following:

# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,

# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,

# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,

# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,

# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,

# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,

# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.characterSet= ZHS16GBK

 

#------------------------------------------------------------------------------

# This variable should be set to true if Automatic Memory Management

# in Database is desired.

# If Automatic Memory Management is not desired, and memory allocation

# is to be done manually, then set it to false.

#11g的新特性自动内存管理,也就是SGA_TARGET和PAG_AGGREGATE_TARGET都不用设置了,Oracle会自动调配两部分大小

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.memoryOption=true

 

#------------------------------------------------------------------------------

# Specify the total memory allocation for the database. Value(in MB) should be

# at least 256 MB, and should not exceed the total physical memory available

# on the system. 指定Oracle自动管理内存的大小,最小是256MB

# Example: oracle.install.db.config.starterdb.memoryLimit=512

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.memoryLimit=

 

#------------------------------------------------------------------------------

# This variable controls whether to load Example Schemas onto

# the starter database or not. 是否载入模板示例

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.installExampleSchemas=false

 

#------------------------------------------------------------------------------

# This variable includes enabling audit settings, configuring password profiles

# and revoking some grants to public. These settings are provided by default.

# These settings may also be disabled. 是否启用安全设置

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.enableSecuritySettings=true

 

###############################################################################

#                                                                             #

# Passwords can be supplied for the following four schemas in the             #

# starter database:                                      #

#   SYS                                                                       #

#   SYSTEM                                                                    #

#   SYSMAN (used by Enterprise Manager)                                       #

#   DBSNMP (used by Enterprise Manager)                                       #

#                                                                             #

# Same password can be used for all accounts (not recommended)                #

# or different passwords for each account can be provided (recommended)       #

#    设置数据库用户密码                                                                         #

###############################################################################

 

#------------------------------------------------------------------------------

# This variable holds the password that is to be used for all schemas in the

# starter database. 设定所有数据库用户使用同一个密码,其它数据库用户就不用单独设置了。

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.password.ALL=oracle

 

#-------------------------------------------------------------------------------

# Specify the SYS password for the starter database.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.password.SYS=

 

#-------------------------------------------------------------------------------

# Specify the SYSTEM password for the starter database.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.password.SYSTEM=

 

#-------------------------------------------------------------------------------

# Specify the SYSMAN password for the starter database.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.password.SYSMAN=

 

#-------------------------------------------------------------------------------

# Specify the DBSNMP password for the starter database.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.password.DBSNMP=

 

#-------------------------------------------------------------------------------

# Specify the management option to be selected for the starter database.

# It can be one of the following:

#   - GRID_CONTROL

#   - DB_CONTROL

#数据库本地管理工具DB_CONTROL,远程集中管理工具GRID_CONTROL

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.control=DB_CONTROL

 

#-------------------------------------------------------------------------------

# Specify the Management Service to use if Grid Control is selected to manage

# the database. GRID_CONTROL需要设定grid control的远程路径URL

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

 

###############################################################################

#                                                                             #

# SPECIFY BACKUP AND RECOVERY OPTIONS                                         #

# ------------------------------------                                        #

# Out-of-box backup and recovery options for the database can be mentioned    #

# using the entries below.                                                    #

#                                                                             #

###############################################################################

 

#------------------------------------------------------------------------------

# This variable is to be set to false if automated backup is not required. Else

# this can be set to true.  设置自动备份,和OUI里的自动备份一样。

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.automatedBackup.enable=false

 

#------------------------------------------------------------------------------

# Regardless of the type of storage that is chosen for backup and recovery, if

# automated backups are enabled, a job will be scheduled to run daily to backup

# the database. This job will run as the operating system user that is

# specified in this variable. .自动备份会启动一个job,指定启动JOB的系统用户ID

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.automatedBackup.osuid=

 

#-------------------------------------------------------------------------------

# Regardless of the type of storage that is chosen for backup and recovery, if

# automated backups are enabled, a job will be scheduled to run daily to backup

# the database. This job will run as the operating system user specified by the

# above entry. The following entry stores the password for the above operating

# system user. .自动备份会开启一个job,需要指定OSUser的密码

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.automatedBackup.ospwd=

 

#-------------------------------------------------------------------------------

# Specify the type of storage to use for the database.

# It can be one of the following:

#   - FILE_SYSTEM_STORAGE

#   - ASM_STORAGE

#自动备份,要求指定使用的文件系统存放数据库文件还是ASM

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.storageType=

 

#-------------------------------------------------------------------------------

# Specify the database file location which is a directory for datafiles, control

# files, redo logs.

#

# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE

#使用文件系统存放数据库文件才需要指定数据文件、控制文件、Redo log的存放目录

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=

 

#-------------------------------------------------------------------------------

# Specify the backup and recovery location.

#使用文件系统存放数据库文件才需要指定备份恢复目录

# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

 

#-------------------------------------------------------------------------------

# Specify the existing ASM disk groups to be used for storage.

##使用ASM存放数据库文件才需要指定存放的磁盘组

# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE

#-------------------------------------------------------------------------------

oracle.install.db.config.asm.diskGroup=

 

#-------------------------------------------------------------------------------

# Specify the password for ASMSNMP user of the ASM instance.

#使用ASM存放数据库文件才需要指定ASM实例密码

# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE

#-------------------------------------------------------------------------------

oracle.install.db.config.asm.ASMSNMPPassword=

 

#------------------------------------------------------------------------------

# Specify the My Oracle Support Account Username.

#指定metalink账户用户名

#  Example   : MYORACLESUPPORT_USERNAME=abc@oracle.com

#------------------------------------------------------------------------------

MYORACLESUPPORT_USERNAME=

 

#------------------------------------------------------------------------------

# Specify the My Oracle Support Account Username password.

#指定metalink账户密码

# Example    : MYORACLESUPPORT_PASSWORD=password

#------------------------------------------------------------------------------

MYORACLESUPPORT_PASSWORD=

 

#------------------------------------------------------------------------------

# 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.

#用户是否可以设置metalink密码

# Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true

#------------------------------------------------------------------------------

SECURITY_UPDATES_VIA_MYORACLESUPPORT=

 

#------------------------------------------------------------------------------

# Specify whether user doesn't want to configure Security Updates.

# The value for this variable should be true if you don't want to configure

# Security Updates, false otherwise.

#

# The value can be either true or false. If left blank it will be assumed

# to be false.

#False表示不需要设置安全更新,注意,在11.2的静默安装中疑似有一个BUG

Response File中必须指定为true,否则会提示错误,不管是否正确填写了邮件地址

# Example    : DECLINE_SECURITY_UPDATES=false

#------------------------------------------------------------------------------

DECLINE_SECURITY_UPDATES=true

 

#------------------------------------------------------------------------------

# Specify the Proxy server name. Length should be greater than zero.

#代理服务器名

# Example    : PROXY_HOST=proxy.domain.com

#------------------------------------------------------------------------------

PROXY_HOST=

 

#------------------------------------------------------------------------------

# Specify the proxy port number. Should be Numeric and at least 2 chars.

#代理服务器端口

# Example    : PROXY_PORT=25

#------------------------------------------------------------------------------

PROXY_PORT=

 

#------------------------------------------------------------------------------

# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD

# blank if your proxy server requires no authentication.

#代理服务器用户名

# Example    : PROXY_USER=username

#------------------------------------------------------------------------------

PROXY_USER=

 

#------------------------------------------------------------------------------

# Specify the proxy password. Leave PROXY_USER and PROXY_PWD

# blank if your proxy server requires no authentication.

#代理服务器密码

# Example    : PROXY_PWD=password

#------------------------------------------------------------------------------

PROXY_PWD=

 

#------------------------------------------------------------------------------

# Specify the proxy realm. This value is used if auto-updates option is selected.

#

# Example    : PROXY_REALM=metalink

#------------------------------------------------------------------------------

PROXY_REALM=

 

#------------------------------------------------------------------------------

# Specify the Oracle Support Hub URL.

#

# Example    : COLLECTOR_SUPPORTHUB_URL=https://orasupporthub.company.com:8080/

#------------------------------------------------------------------------------

COLLECTOR_SUPPORTHUB_URL=

 

#------------------------------------------------------------------------------

# Specify the auto-updates option. It can be one of the following:

#   - MYORACLESUPPORT_DOWNLOAD

#   - OFFLINE_UPDATES

#   - SKIP_UPDATES

#------------------------------------------------------------------------------

oracle.installer.autoupdates.option=

#------------------------------------------------------------------------------

# In case MYORACLESUPPORT_DOWNLOAD option is chosen, specify the location where

# the updates are to be downloaded.

# In case OFFLINE_UPDATES option is chosen, specify the location where the updates

# are present.

#------------------------------------------------------------------------------

oracle.installer.autoupdates.downloadUpdatesLoc=

#------------------------------------------------------------------------------

# Specify the My Oracle Support Account Username which has the patches download privileges

# to be used for software updates.

#  Example   : AUTOUPDATES_MYORACLESUPPORT_USERNAME=abc@oracle.com

#------------------------------------------------------------------------------

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

 

#------------------------------------------------------------------------------

# Specify the My Oracle Support Account Username password which has the patches download privileges

# to be used for software updates.

#

# Example    : AUTOUPDATES_MYORACLESUPPORT_PASSWORD=password

#------------------------------------------------------------------------------

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

 

 

2、创建自己的应答文件

[root@redhat oracleinstall]#cp /mnt/oracleinstall/database/response/db_install.rsp /mnt/oracleinstall/database/response/db_install.bak

[root@redhat oracleinstall]# cd /mnt/ oracleinstall

root@redhat oracleinstall]# vi db_install.rsp 

 

根据上面的介绍修改成自己需要的

 

 

3、创建oraInst.loc文件

 


    这个文件用来存储oracle软件安装的目录相关信息,在安装和升级软件的时候都需要用到该文件。
    静默方式下第1个步骤就是需要手工创建并编辑这个文件。
    使用root登陆操作(操作之前先创建好oracle用户和组):

  cd /etc
vi
m oraInst.loc
inventory_loc=/mnt/app/oraInventory
inst_group=
onistall

cat oraInst.loc
chown oracle:oinstall oraInst.loc
chmod 664 oraInst.loc

 

3、开始静默安装

[oracle@redhat database]# cd /mnt/oracleinstall/database/

[oracle@redhat database]#DISPLAY=:0.0;export DISPLAY

[oracle@redhat database]# ./runInstaller -ignoreSysPrereqs -silent -noconfig -responseFile /mnt/oracleinstall/database/response/db_install.rsp

 

 

安装遇到问题

 

 

另开一个窗口

vim  /mnt/app/oraInventory/logs/installActions2014-07-29_08-36-44AM.log

 

 

内核参数错误,改成推荐的值

[root@redhat ~]# vim /etc/sysctl.conf

[root@redhat mnt]# sysctl –p 使之生效

从互联网上找到这个包,然后上传到/MNT/目录

注意:为避免与 pdksh 冲突,ksh-2*包可以不安装或在安装完 pdksh 以后再安装。

将pdksh 程序包下载到本地。 Pdksh安装包需要在网上下载光盘里没有

# rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm

 

注意:如果提示该程序包与 ksh冲突,如果已经安装 ksh,建议使用命令  rpm -e ksh-* 卸载

[root@redhat ~]# cd /mnt/

[root@redhat mnt]#  rpm -e ksh-*

[root@redhat mnt]#  rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm

 

再次安装又遇到问题,要删除原来的目录下所有的文件

 

[root@redhat mnt]# rm  -rf /mnt/app/oracle/product/11.2.0/dbhome_1

[root@redhat mnt]# mkdir -p /mnt/app/oracle/product/11.2.0/dbhome_1

[root@redhat mnt]# chown -R oracle:oinstall /mnt/app/oracle/product/11.2.0/dbhome_1

[root@redhat mnt]# chmod -R 755 /mnt/app/oracle/product/11.2.0/dbhome_1

[root@redhat mnt]# rm  -rf /mnt/app/oracle/diag/

[root@redhat mnt]# rm  -rf /mnt/app/oracle/checkpoints/

第三次安装

 

 

再开一个窗口

tail -f /mnt/app/oraInventory/logs/installActions2014-07-29_09-04-00AM.log

省略N多提示信息

 

当安装终端出现下面提示,安装基本结束,只需要按照提示运行脚本后回到这个窗口按回车就完成安装了

 

 

另外一个终端

 

第四无提示建库

1、建库的两种方式

1、调用DBCA指令图像化界面建库

2、直接以命令模式运行dbCA建库 (静默模式)

 

   装之前使用

dbca help 查看一下帮助信息

 

安装示例

dbac  silent createDatabase

-templateName      <新的模板名>  Geneeral_Purpose.dbc 一般模板,对应的还有事务处理,书库仓库挖掘

-gdbName  <全局数据库名> redhat  -sid <数据库系统标识符>  orcl      baidu.com=全局  feitianyul=SID  feitianyul.baidu.com 全局表示

-responseFile <应答文件绝对路径 >   NO_VALUE  不用应答文件

-characterSet <数据库的字符集>

-memoryPercentage <用于 Oracle 的物理内存百分比>

-emConfiguration <CENTRAL|LOCAL|ALL|NONE>  企业管理器 LOCAL

 

2、运行DBCA创建数据库

[oracle@redhat database]$ which dbca

/mnt/app/oracle/product/11.2.0/dbhome_1/bin/dbca

[oracle@redhat database]$ dbca -silent -createDatabase  -templateName General_Purpose.dbc -gdbname redhat -sid orcl -responseFile NO_VALUE   -characterSet ZHS16GBK –memoryPercentag 40 -emConfiguration LOCAL

输入四个用户的口令。输入的时候没有任何提示

另开一个窗口,看见进度

 

100%完成后,验证一下

 

[oracle@redhat dbhome_1]$ sqlplus sys/oracle as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jul 29 10:01:43 2014

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> select status from v$instance;

 

STATUS

------------

OPEN

 

SQL>

 

查看数据库字符集

SQL> select userenv('language') from dual;

SQL> select * from props$ where name='NLS_CHARACTERSET';

SQL> select * from nls_database_parameters;

启动数据库企业管理器

[oracle@redhat ~]$  emctl start dbconsole

 

在浏览器中输入下列地址

https://192.168.8.106:1158/em/console/logon/logon

 

使用用户名system密码oracle登陆

 

 

总结

库的创建我偷懒了。dbca.rsp 这个文件我没有研究透,直接使用命令创建了比较简单默认数据库。很多选项都没有选,用不上的表也直接装上了。不影响使用,多少影响点性能

静默模式安装觉得有点不靠谱,稍微出点问题,安装停止,文件拷贝了一半,又得回去删除目录,重建。提示需要在一大堆的LOG文件中一行一行的看,眼睛都花了,只能作为一种补充手段。这还是单机,如果是RAC模式,我觉得出的问题更多。有条件还是尽量用图形化安装吧。

REDHAT ORACLE 11G R2 静默安装

分享到:
评论加载中,请稍后...
创APP如搭积木 - 创意无限,梦想即时!
回到顶部