CentOS6.5内 Oracle 11GR2静默安装

一、修改配置文件

1.1、修改/etc/security/limits.conf文件,修改用户的SHELL的限制。

输入命令:vi /etc/security/limits.conf,将下列内容加入该文件

oracle   soft    nproc    2047
oracle   hard    nproc    16384
oracle   soft    nofile   1024
oracle   hard    nofile   65536

1.2、修改/etc/pam.d/login 文件。

输入命令:vi  /etc/pam.d/login,将下列内容加入该文件

session   required    /lib64/security/pam_limits.so
session   required    pam_limits.so  

1.3、修改linux内核,修改/etc/sysctl.conf文件。

输入命令: vi  /etc/sysctl.conf ,将下列内容加入该文件。

fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576  

并用#符号注释掉原有的配置。

# Controls the maximum shared segment size, in bytes

#kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages

#kernel.shmall = 4294967296

输入命令:sysctl  -p,使/etc/sysctl.conf配置文件立即生效。

1.4、修改/etc/profile。

输入命令:vi  /etc/profile,将下列内容加入该文件。

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
  ulimit -p 16384
  ulimit -n 65536
else
  ulimit -u 16384 -n 65536
fi
fi  

1.5、创建用户和组。

创建用户组oinstall、dba

创建oracle用户,主组为oinstall,副组dba,输入命令:

groupadd  oinstall
groupadd  dba
useradd -g oinstall -G dba -m oracle

副组的参数是大写G,别弄错,否则安装时会出现错误:

[FATAL] [INS-35341] User is not a member of the following chosen OS groups

设置用户oracle密码,输入两次密码,输入命令:

passwd  oracle

1.6、创建数据库软件目录和数据文件存放目录。

mkdir /home/oracle/app
mkdir /home/oracle/app/oracle
mkdir /home/oracle/app/oradata
mkdir /home/oracle/app/oraInventory
mkdir /home/oracle/app/fast_recovery_area
mkdir /home/oracle/app/oracle/product

修改目录权限,更改目录属主为Oracle用户所有,输入命令:

chown -R oracle:oinstall /home/oracle/app  

1.7、配置oracle用户的环境变量。

用命令su - oracle切换到oracle用户下。

su - oracle

输入命令:vi .bash_profile,将下列内容加入该文件。

umask 022
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib  

1.8、上传Oracle安装文件

上传Oracle安装文件到Linux服务器。

linux.x64_11gR2_database_1of2.zip

linux.x64_11gR2_database_2of2.zip

上传到/tmp目录下面。

1.9、解压安装文件

进入tmp目录,使用unzip命令解压文件。

[[email protected] /]# cd /tmp
[[email protected] tmp]# unzip linux.x64_11gR2_database_1of2.zip
[[email protected] tmp]# unzip linux.x64_11gR2_database_2of2.zip  

解压完成后,在tmp目录下会有一个database的文件夹。

1.10、创建/etc/oraInst.loc文件,否则安装时会报错:

SEVERE: [FATAL] [INS-32038] The operating system group specified for central inventory (oraInventory) ownership is invalid.

vi /etc/oraInst.loc
inventory_loc=/home/oracle/app/oraInventory
inst_group=oinstall

1.11、安装未安装的package

yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel

二、安装Oracle 11.2产品

Oracle支持静默安装。在我看来,它主要有两方面的好处:一、极大地提升了效率,尤其是批量安装。二、很多时候,只有终端环境可供使用。

2.0、准备responseFile文件

从Oracle软件中获取文件模板

[[email protected] tmp]# cd database/response/
[[email protected] response]# ls
dbca.rsp  db_install.rsp  netca.rsp

其中database是Oracle软件解压后生成的目录。可见在response目录下有三个模板,其中dbca.rsp是用来创建数据库的。db_install.rsp是用来安装Oracle软件的。netca.rsp是用来创建监听器的。当然也可在db_install.rsp中直接创建数据库。在这里,为求方便,我们选择db_install.rsp模板一并安装软件,创建数据库。

2.1、编辑responseFile文件

[[email protected] response]# vi db_install.rsp
[[email protected] response]# grep -Ev "^$|^#" db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=oracle
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/home/oracle/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/home/oracle/app
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
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
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=400
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=1Password
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=[email protected]
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/home/oracle/app/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/home/oracle/app/fast_recovery_area
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=

2.3 改用oracle用户登录,静默安装

cd /tmp/database
./runInstaller -silent -ignorePrereq -responseFile /tmp/database/response/db_install.rsp 

可以通过查看日志文件,来知晓安装进度。

如果是测试环境的VM可能会出现tmpfs比MEMORY_TARGET小,导致oracle没办法起来。ORA-00845: MEMORY_TARGET not supported on this system。

mount -o remount,size=4G /dev/shm

2.4、启动数据库:

[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 6 09:14:24 2017

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

Connected to an idle instance.

SQL> start
SP2-1506: START, @ or @@ command has no arguments
SQL> startup

查看监听器状态:

lsnrctl status

2.5、修改Oracle启动配置文件:

[[email protected] admin]# vi /etc/oratab

#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ‘:‘, is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, ‘#‘, are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:Y

为了让oracle在系统启动时服务自动启动,修改/etc/rc/loacl文件:

[[email protected] admin]# vi /etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don‘t
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
su - oracle -c "/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"

2.6、打开防火墙端口:

输入命令:vi /etc/sysconfig/iptables编辑防火墙配置:

2.7、创建表空间:

创建临时表空间:

create temporary tablespace user_temp tempfile ‘/home/oracle/app/oradata/orcl/user_temp.dbf‘ size 50m autoextend on next 50m maxsize 20480m extent management local;

创建数据表空间:

create tablespace user_data logging datafile ‘/home/oracle/app/oradata/orcl/user_data.dbf‘ size 50m autoextend on next 50m maxsize 20480m extent management local;

创建用户并指定表空间:


1

2

3

4

5

6

7

SQL> create user mydbuser identified by myDbuser1 default tablespace user_data temporary tablespace user_temp;

User created.

SQL> grant connect,resource to mydbuser;

Grant succeeded.

原文地址:https://www.cnblogs.com/hftian/p/9395350.html

时间: 2024-08-02 02:25:46

CentOS6.5内 Oracle 11GR2静默安装的相关文章

CentOS X64上64位Oracle 11gR2 静默安装

CentOS 6.2 X64上64位Oracle 11gR2 静默安装 www.linuxidc.com/Linux/2012-03/56606p4.htm HP-UX静默安装oracle11g过程 http://blog.csdn.net/yangyinbo/article/details/6221220 docker下oracle11g安装 http://blog.sina.com.cn/s/blog_d840ff330102v4j0.html 解决oracle 11g startup 问题

Oracle 11gR2静默安装

经常搭建Oracle测试环境,有时候觉得OUI(即图形界面)方式甚是繁琐,你得一步一步进行确认,所幸,Oracle支持静默安装.在我看来,它主要有两方面的好处:一.极大地提升了效率,尤其是批量安装.二.很多时候,只有终端环境可供使用. 一.准备responseFile文件 从Oracle软件中获取文件模板 [[email protected] ~]$ cd database/response/ dbca.rsp db_install.rsp netca.rsp 其中database是Oracle

[转]--Oracle 11gR2静默安装 &amp; 命令行安装

静默安装 经常搭建Oracle测试环境,有时候觉得OUI(即图形界面)方式甚是繁琐,你得一步一步进行确认,所幸,Oracle支持静默安装.在我看来,它主要有两方面的好处:一.极大地提升了效率,尤其是批量安装.二.很多时候,只有终端环境可供使用. 一.准备responseFile文件 从Oracle软件中获取文件模板 [[email protected] ~]$ cd database/response/ dbca.rsp db_install.rsp netca.rsp 其中database是O

Oracle database 11gR2静默安装

环境为OL 6.5和CentOS 6.5; Oracle database版本: linux.x64_11gR2 Oracle数据库静默安装,1)不用安装桌面: 2)安装速度快,且不用人一直守着: 需要做四件事,不过在做这些之前,你需要正确的添加oracle相关的用户及组,并且分配相应的权限,以及检查安装的前提条件. 1) 解压: unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip 2)复

Oracle 11gR2 RAC 安装Grid Infrastructure错误

Oracle 11gR2 RAC 安装Grid Infrastructure错误 系统环境: 操作系统:RedHat EL5 Cluster: Oracle GI(Grid Infrastructure) Oracle:  Oracle 11.2.0.1.0 如图所示:RAC 系统架构   对于Oracle 11G构建RAC首先需要构建GI(Grid Infrastructure)的架构 错误现象: 报:node2 检测用户信任关系错误,node2安装目录不可访问! 手工检测,node2与nod

Redhat 5.8 ORACLE 11gR2 RAC安装文档2-grid安装

3.安装Grid 3.1.安装rpm包 两个节点都要安装,以节点1为例 [[email protected] yum.repos.d]# yum install compat-libstdc++-33 ksh gcc gcc-c++ libgomp elfutils-libelf-devel glibc-devel glibc-headers libaio-devel libstdc++-devel sysstat unixODBC unixODBC-devel –y -----.. Compl

oracle 10g 静默安装(无图形化)

Oracle 10g无图形界面安装 此文档是在oracle环境变量已经配置完成,不缺少依赖包的情况下进行安装: 解压oracle的安装包, 首先vi database/response/enterprise.rsp 修改文件中的ORACLE_HOME和ORACLE_HOME_NAME两个参数为实际参数 ORACLE_HOME=实际的路径 ORACLE_HOME_NAME只是一个名称,修改就可以了. 然后执行命令: ./runInstaller -silent -responseFile data

Centos-6.7下_Oracle 11gR2&quot;静默&quot;详细安装过程及排错

系统要求:内存:1G(官方最低要求1G)硬盘:40G(企业版安装所需4.29G和1.7G数据文件) 检查的命令内存# grep MemTotal /proc/meminfo交换空间# grep SwapTotal /proc/meminfo磁盘空间# df -ah 安装前系统准备:1.修改主机名# sed -i "s/HOSTNAME=localhost.localdomain/HOSTNAME=DB_2/g" /etc/sysconfig/network# hostname DB_2

Oracle 11g静默安装

1.检查安装包 安装依赖包 yum -y install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static elfutils-libelf-devel ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel 2.创建用户组和用户 groupadd o