CentOS 7按照Oracle 11G教程

2021/5/14 20:00:22

本文主要是介绍CentOS 7按照Oracle 11G教程,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

CentOS 7按照Oracle 11G教程
一、 安装环境和工具
系统环境:CentOS Linux release 7.3.1611 (Core)
Oracle版本:Oracle Database 11g R2
工具:Xshell6和Xftp6
注:系统安装时需安装桌面组件。
二、 安装前准备
1、 关闭selinux
查看selinux状态:getenforce 或者sestatus –v
临时关闭:setenforce 0
永久关闭:vim /etc/selinux/config 设置SELINUX=disabled
注:修改/etc/selinux/config 后需重启服务器才生效(reboot)
2、 关闭firewalld 安装iptables(服务器不建议执行,直接使用firewalld)
systemctl status firewalld.service
systemctl start firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service

yum -y install iptables-services
systemctl restart iptables.service
systemctl enable iptables.service
3、 创建用户及安装目录,安装依赖包
创建用户:
[root@hzjz ~]# groupadd oinstall
[root@hzjz ~]# groupadd dba
[root@hzjz ~]# useradd -g oinstall -G dba -m oracle
[root@hzjz ~]# passwd oracle
创建安装目录并解压安装文件:
[root@hzjz ~]# mkdir -p /ora

通过Xftp将
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
上传到/ora目录下
[root@hzjz ~]# unzip -d /ora/ /ora/linux.x64_11gR2_database_1of2.zip
[root@hzjz ~]# unzip -d /ora/ /ora/linux.x64_11gR2_database_2of2.zip

[root@hzjz ~]# chown -R oracle:oinstall /ora
[root@hzjz ~]# chmod 755 -R /ora

[root@hzjz ~]# mkdir -p /u01/app
[root@hzjz ~]# mkdir -p /u01/app/tmp
[root@hzjz ~]# mkdir -p /u01/app/oracle
[root@hzjz ~]# chown -R oracle:oinstall /u01
[root@hzjz ~]# chmod 755 -R /u01
4、 安装oracle所需依赖
[root@hzjz ~]# yum -y install binutils compat compat-libstdc gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc+±devel libXi libXtst make sysstat unixODBC unixODBC-devel
5、 系统内核修改
说明:
内核参数需要注意,shmall 和shmmax 的值由服务器内存决定:
kernel.shmall:
该参数控制可以使用的共享内存的总页数。Linux共享内存页大小为4KB,共享内存段的大小都是共享内存页大小的整数倍。一个共享内存段的最大大小是16G,那么需要共享内存页数是16GB/4KB=16777216KB/4KB=4194304(页),也就是64Bit系统下16GB物理内存,设置kernel.shmall = 4194304 符合要求。
kernel.shmmax:
是核心参数中最重要的参数之一,用于定义单个共享内存段的最大值。64位linux系统:可取的最大值为物理内存值-1byte,建议值为多于物理内存的一半,例如,如果为16GB物理内存,可取1010241024*1024-1=10737418239。
kernel.shmmni:
该参数是共享内存段的最大数量。shmmni缺省值4096,一般肯定是够用了。
kernel.sem = 250 32000 100 128 的意思是:
250是参数semmsl的值,表示一个信号量集合中能够包含的信号量最大数目。
32000是参数semmns的值,表示系统内可允许的信号量最大数目。
100是参数semopm的值,表示单个semopm()调用在一个信号量集合上可以执行的操作数量。
128是参数semmni的值,表示系统信号量集合总数。
4G内存左右服务器配置:
[root@hzjz ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 1048576
kernel.shmmax = 3221225471
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 = 1048576
8G内存左右服务器配置:
[root@hzjz ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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 = 1048576

16/32G内存左右服务器配置:
[root@hzjz ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 4194304
kernel.shmmax = 17179869183
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 = 1048576

[root@hzjz ~]# sysctl -p
6、 修改认证模块
[root@hzjz ~]# vim /etc/security/limits.conf
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft core unlimited
oracle hard core unlimited
oracle soft memlock 50000000
oracle hard memlock 50000000
7、 修改用户登录认证
[root@hzjz ~]# vim /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
注:
32位:/lib/security/pam_limits.so
64位:/lib64/security/pam_limits.so
8、 设置环境变量(ORACLE_HOME 设置为安装目录product下默认目录)
[root@hzjz ~]# vim /etc/profile
#oracle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

9、 修改Oracle用户环境变量
[oracle@hzjz ~]# vim /home/oracle/.bash_profile
export TMP=/u01/app/tmp
export TMPDIR=/u01/app/tmp
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
export PATH= O R A C L E H O M E / b i n : / u s r / s b i n : ORACLE_HOME/bin:/usr/sbin: ORACLEH​OME/bin:/usr/sbin:PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

[root@hzjz ~]# source /home/oracle/.bash_profile

三、 通过桌面方式安装Oracle
1、 使用oracle用户登录桌面,打开终端运行安装程序
[root@hzjz ~]# cd /ora/database
[root@hzjz database]# ./runInstaller
注意:oracle中文语言会出现乱码,所以系统最好设置为en 英文,如果系统安装的时候选择了中文,那么oracle用户登录的时候也要修改用户语言为英文才能正常安装。
2、 临时修改界面语言
在区域与语言设置语言位英文。

3、 安装过程是都有相应提示的,并且鼠标直接点就完了
1) 订阅邮件这些就直接跳过不填了。
在这里插入图片描述

2) 这里选择创建和配置数据库,稍后再配置初始化数据。
在这里插入图片描述

3) 让选择桌面版还是服务器版,如果有当然选择服务器版咯
在这里插入图片描述

4) 选择单实例安装
在这里插入图片描述

5) 安装类型,选择“高级安装”
在这里插入图片描述

6) 产品语言,直接默认即可(简体中文、英语)。
在这里插入图片描述

7) 数据库版本,选择“企业版”
在这里插入图片描述

8) 这里就出现最开始创建的相应目录信息了,会自动读取
在这里插入图片描述

9) 下一步
在这里插入图片描述

10) 配置类型,选择“一般用途/事务处理”
在这里插入图片描述

11) 数据库标识符,自动读取填入全局数据库名和SID
在这里插入图片描述

12) 配置选项,切换到“字符集”选项卡,根据自己需要选择。
在这里插入图片描述

13) 下一步
在这里插入图片描述

14) 自动读取填入,下一步
在这里插入图片描述

15) 下一步
在这里插入图片描述

16) 方案口令,对话框可能无法正常弹出,向左移一步
在这里插入图片描述

17) 自动读取填入,下一步
在这里插入图片描述

18) centos7上yum安装的依赖包要比oracle 11g 所需的包更新,版本更高,所以可以直接忽略这些提示(勾选 ignore all),下一步
在这里插入图片描述

19) 点击完成,下一步
在这里插入图片描述

20) 等待安装。。。中间会出现弹窗,回车回车就行(反正看不了)。
在这里插入图片描述
在这里插入图片描述

21) 设置数据库用户和密码。
在这里插入图片描述

22) 出现弹窗直接回车,然后安装完成。
在这里插入图片描述

4、 修改界面语言
在区域与语言设置语言位中文。
5、 开机启动Oralce(如果没有这个文件就新增,添加内容)
[root@hzjz ~]# vi /etc/oratab
“orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N“,改为“orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y”。
修改完成后,保存退出vi。
修改vi /etc/rc.d/rc.local文件
在vi编辑器中,添加:
su oracle -lc “/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start”
su oracle -lc /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
保存退出后,下次重启机器时会自动启动oracle相应的实例。
[root@hzjz ~]# chmod 755 -R /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
[root@hzjz ~]# chown oracle:oinstall -R /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
[root@hzjz ~]# chmod +x /etc/rc.d/rc.local

四、 通过命令行方式安装Oracle
1、 定义安装响应文件
[root@hzjz ~]# su - oracle
[oracle@hzjz ~]# cd /ora
[oracle@hzjz ora]# cp /ora/database/response/db_install.rsp .
[oracle@hzjz ora]# vim db_install.rsp

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

Copyright© Oracle Corporation 1998,2008. 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.

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

Copyright© Oracle Corporation 1998,2008. 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:

1. INSTALL_DB_SWONLY

2. INSTALL_DB_AND_CONFIG

3. UPGRADE_DB

选择安装类型:1.只装数据库软件 2.安装数据库软件并建库 3.升级数据库

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

#指定操作系统主机名,通过hostname命令获得
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=localhost

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

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

#指定oracleinventory目录的所有者,通常会是oinstall或者dba
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

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

Specify the location which holds the inventory files.

#指定产品清单oracle inventory目录的路径,如果是Win平台下可以省略
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/u01/app/oraInventory

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

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

in : Indonesian vi : Vietnamese

it : Italian

Example : SELECTED_LANGUAGES=en,fr,ja

#指定数据库语言,可以选择多个,用逗号隔开。选择en, zh_CN(英文和简体中文)
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en,zh_CN

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

Specify the complete path of the Oracle Home.

#设置ORALCE_HOME的路径
#------------------------------------------------------------------------------
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

#------------------------------------------------------------------------------
#设置ORALCE_BASE的路径

Specify the complete path of the Oracle Base.

#------------------------------------------------------------------------------
ORACLE_BASE=/u01/app/oracle

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

Specify the installation edition of the component.

The value should contain only one of these choices.

EE : Enterprise Edition #企业版(Enterprise Edition)

SE : Standard Edition #标准版(Standard Edition)

SEONE : Standard Edition One #标准版第二版(Standard Edition One)

PE : Personal Edition (WINDOWS ONLY) #个人版(Personal Edition)仅windows系统有

#选择Oracle安装数据库软件的版本
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE

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

This variable is used to enable or disable custom install.

true : Components mentioned as part of ‘customComponents’ property

are considered for install.

false : Value for ‘customComponents’ is not considered.

oracle.install.db.isCustomInstall= true的话必须手工选择需要安装组件的话

#------------------------------------------------------------------------------
oracle.install.db.isCustomInstall=true

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

This variable is considered only if ‘IsCustomInstall’ is set to true.

Description: List of Enterprise Edition Options you would like to install.

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-naome:version”

Below is a list of components you may specify to install.

oracle.rdbms.partitioning:11.2.0.1.0 - Oracle Partitioning

oracle.rdbms.dm:11.2.0.1.0 - Oracle Data Mining

oracle.rdbms.dv:11.2.0.1.0 - Oracle Database Vault

oracle.rdbms.lbac:11.2.0.1.0 - Oracle Label Security

oracle.rdbms.rat:11.2.0.1.0 - Oracle Real Application Testing

oracle.oraolap:11.2.0.1.0 - Oracle OLAP

#------------------------------------------------------------------------------
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.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.

# 指定拥有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.

#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=oinstall

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

Specify the cluster node names selected during the installation.

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

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

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.

指定GlobalName

#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=orcl

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

Specify the Starter Database SID.

#指定SID
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=orcl

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

Specify the Starter Database character set.

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

#选择字符集。不正确的字符集会给数据显示和存储带来麻烦无数。
#通常中文选择的有ZHS16GBK简体中文库,建议选择unicode的AL32UTF8国际字符集

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

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

#指定Oracle自动管理内存的大小,最小是256MB
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=8192

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

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=

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

Specify the SYS password for the starter database.

#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=sys

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

Specify the SYSTEM password for the starter database.

#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=system

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

Specify the SYSMAN password for the starter database.

#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSMAN=system

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

Specify the DBSNMP password for the starter database.

#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=system

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

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

It can be one of the following:

1. GRID_CONTROL

2. 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=

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

This variable indicates whether to receive email notification for critical

alerts when using DB control.

#是否启用Email通知, 启用后会将告警等信息发送到指定邮箱
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false

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

Specify the email address to which the notifications are to be sent.

#设置通知EMAIL地址
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.emailAddress=

#-------------------------------------------------------------------------------
#设置EMAIL邮件服务器

Specify the SMTP server used for email notifications.

#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=

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

SPECIFY BACKUP AND RECOVERY OPTIONS

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

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

using the entries below.

#安全及恢复设置(默认值即可)out-of-box(out-of-box experience)缩写为OOBE
#产品给用产品给用户良好第一印象和使用感受

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

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

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 at

2:00 AM 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 at

2:00 AM 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

#使用文件系统存放数据库文件才需要指定数据文件、控制文件、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

#使用文件系统存放数据库文件才需要指定备份恢复目录
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

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

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

Applicable only when oracle.install.db.config.starterdb.storage=ASM

#使用ASM存放数据库文件才需要指定存放的磁盘组
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=

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

Specify the password for ASMSNMP user of the ASM instance.

Applicable only when oracle.install.db.config.starterdb.storage=ASM_SYSTEM

#使用ASM存放数据库文件才需要指定ASM实例密码
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=

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

Specify the My Oracle Support Account Username.

Example : MYORACLESUPPORT_USERNAME=metalink

#指定metalink账户用户名
#------------------------------------------------------------------------------
MYORACLESUPPORT_USERNAME=

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

Specify the My Oracle Support Account Username password.

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.

Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true

用户是否可以设置metalink密码

#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=

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

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

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

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

#------------------------------------------------------------------------------
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 atleast 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=

2、 安装数据库,执行安装命令
[root@hzjz ~]# su - oracle
[oracle@hzjz ~]# cd /ora/database
[oracle@hzjz database]# ./runInstaller -silent -force -noconfig -ignorePrereq -responseFile /ora/db_install.rsp

待出现下面的情况,就说明已经安装好了

以下配置脚本需要以 “root” 用户的身份执行。
#!/bin/sh
#要运行的 Root 脚本

/ora/oracle/oraInventory/orainstRoot.sh
/ora/oracle/product/11.2.0/dbhome_1/root.sh
要执行配置脚本, 请执行以下操作:
1. 打开一个终端窗口
2. 以 “root” 身份登录
3. 运行脚本
4. 返回此窗口并按 “Enter” 键继续

Successfully Setup Software.

3、 打开终端,以 root 身份登录,执行脚本
[root@hzjz ~]# sh /u01/app/oraInventory/orainstRoot.sh
[root@hzjz ~]# sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

4、 以静默方式配置监听
[root@hzjz ~]# su – oracle
[oracle@hzjz ~]# cd /ora/database/response/
[oracle@hzjz response]# /u01/app/oracle/product/11.2.0/dbhome_1/bin/netca /silent /responsefile /ora/database/response/netca.rsp
[oracle@hzjz response]# ll /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/*.ora
[oracle@hzjz response]# /u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl status

[oracle@hzjz response]# vi /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart

ORACLE_HOME_LISTNER=$1  如果是11g ,则把
1   改 为   O R A C L E H O M E L I S T N E R = 1 改为 ORACLE_HOME_LISTNER= 1 改为 ORACLEH​OMEL​ISTNER=ORACLE_HOME

[oracle@hzjz response]# vi /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbshut

ORACLE_HOME_LISTNER=$1  如果是11g ,则把
1   改 为   O R A C L E H O M E L I S T N E R = 1 改为 ORACLE_HOME_LISTNER= 1 改为 ORACLEH​OMEL​ISTNER=ORACLE_HOME

5、 安装数据库实例

以root用户登录系统并运行如下命令:  
编辑Oracle安装目录里response子目录下的应答文件 dbca.rsp,修改以下项目。 
[root@hzjz ~]# vi /ora/database/response/dbca.rsp

GDBNAME  “orcl” 数据库全局名称 
SID  "orcl " 数据库的SID 
SYSPASSWORD  “sys” SYS用户的初始密码 
SYSTEMPASSWORD  “system” SYSTEM用户的初始密码 
CHARACTERSET  ZHS16GBK 数据库字符集(中文为 ZHS16GBK) 
TEMPLATENAME General_Purpose.dbc 数据库模板名称,存在多个变量 NATIONALCHARACTERSET  UTF8 数据库国家字符集

[root@hzjz ~]# su – oracle
[oracle@hzjz ~]# dbca -silent -responseFile /ora/database/response/dbca.rsp

6、 开机启动Oralce
[root@hzjz ~]# vi /etc/oratab
“orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N“,改为“orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y”。
修改完成后,保存退出vi。
修改vi /etc/rc.d/rc.local文件
在vi编辑器中,添加:
su oracle -lc “/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start”
su oracle -lc /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
保存退出后,下次重启机器时会自动启动oracle相应的实例。
[root@hzjz ~]# chmod 755 -R /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
[root@hzjz ~]# chown oracle:oinstall -R /u01/app/oracle/product/11.2.0/dbhome_1/startup.log
[root@hzjz ~]# chmod +x /etc/rc.d/rc.local



这篇关于CentOS 7按照Oracle 11G教程的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程