[root@oracle ~]# cat /etc/hosts
127.0.0.1 oracle.osp.cloud localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 oracle.osp.cloud localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.220 oracle

关闭selinux
#vi /etc/selinux/config
设置
SELINUX=disabled
#setenforce 0

关闭防火墙(或开放端口)
#serviceiptables stop
#systemctl stop firewalld
#systemctl disable firewalld

安装Oracle 11g依赖包
#yum install epel-release.noarch
#yum install gcc make binutilsgcc-c++ compat-libstdc++-33 elfutils-libelf-develelfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel –y

添加安装用户和用户组
#groupadd oinstall
#groupadd dba
#useradd -g oinstall -G dba oracle
#passwd oracle
#id oracle
如显示类似以下信息则表示添加用户和用户组成功
uid=1001(oracle) gid=1001(oinstall) 组=1001(oinstall),1002(dba)

修改内核参数
#vi /etc/sysctl.conf
添加以下内容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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
其中shmmax是单个共享内存段的最大值,一般设置为本机物理内存的一半,单位为byte,可根据自己的实际情况做相应调整
使新内核参数生效
#sysctl -p
修改用户的限制文件
#vi /etc/security/limits.conf
添加以下内容
oracle soft nproc 65535
oracle hard nproc 65535
oracle soft nofile 65535
oracle hard nofile 65535

修改/etc/pam.d/login文件
#vi /etc/pam.d/login
添加以下内容
session required /lib64/security/pam_limits.so
session required pam_limits.so

修改/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
使之生效
#source /etc/profile

创建安装目录和设置文件权限(根据服务器硬盘空间,自己选择安装目录)
[root@localhost ~]# mkdir -p /home/oracle/product/11gR2
[root@localhost ~]# chown -R oracle:oinstall /home/oracle
[root@localhost ~]# mkdir /home/oraInventory
[root@localhost ~]# chown -R oracle:oinstall /home/oraInventory

设置oracle用户环境变量
#su - oracle
此处注意,切换用户时切记要加"-",加-会拥有目标用户的环境变量,不加"-"则没有,详细的可自行网上搜索找解答
$vi .bash_profile
添加如下内容
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11gR2
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export LANG=AMERICAN_AMERICA.ZHS16GBK

使配置生效
$source .bash_profile

$hostnamectl set-hostname oracle

#解压Oracle数据库(/home/oracle/路径下)
$unzip linux.x64_11gR2_database_1of2.zip
$unzip linux.x64_11gR2_database_2of2.zip
[oracle@oracle ~]$ ls -lrt
total 4
drwxr-xr-x 8 oracle oinstall 4096 Aug 21 2009 database
-rw-r--r-- 1 oracle oinstall 1239269270 Aug 21 2009 linux.x64_11gR2_database_1of2.zip
-rw-r--r-- 1 oracle oinstall 1111416131 Aug 21 2009 linux.x64_11gR2_database_2of2.zip
drwxr-xr-x 3 oracle oinstall 4096 Jan 8 13:35 oracle

编辑静默安装响应文件
$cp -R /home/oracle/database/response /home/oracle
$cd /home/oracle/response
$vi db_install.rsp
需要设置的选项如下
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/home/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/home/oracle/product/11gR2
ORACLE_BASE=/home/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
DECLINE_SECURITY_UPDATES=true

安装数据库软件
$cd /home/oracle/database
$./runInstaller -silent -force -ignorePrereq -responseFile /home/oracle/response/db_install.rsp

.....
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run

/home/oraInventory/orainstRoot.sh
/home/oracle/product/11gR2/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.
Oracle开始在后台静默安装,如果提示Successfully则表示安装成功

按照要求执行脚本,打开终端,以root用户登录,执行脚本
/home/oraInventory/orainstRoot.sh
/home/oracle/product/11gR2/root.sh

以oracle用户登录,执行
$netca /silent /responsefile /home/oracle/response/netca.rsp

通过netstat命令查看1521端口是否在监听中
$netstat -tnulp | grep 1521

vi /home/oracle/response/dbca.rsp
设置以下参数(参数有多个,只修改第一处,密码为oracle用户密码)
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION =/home/oracle/oradata
RECOVERYAREADESTINATION=/home/oracle/fast_recovery_area
CHARACTERSET = "ZHS16GBK"
TOTALMEMORY = "28000"
其中TOTALMEMORY = "6400"为6400MB,一般设置为物理内存的80%

进行静默配置
$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/response/dbca.rsp
注意,如果直接进行上面命令的执行会报如下错误:The file "/home/oracle/oradata/Seed_Database.dfb" containing the datafiles information is not found. Please specify a valid file.
所以需要拷贝Seed_Database.dfb文件到/home/oracle/oradata/路径下
[oracle@oracle ~]$ find -name Seed_Database.dfb
./product/11gR2/assistants/dbca/templates/Seed_Database.dfb
./database/stage/Components/oracle.rdbms.install.seeddb/11.2.0.1.0/1/DataFiles/Expanded/filegroup1/Seed_Database.dfb
[oracle@oracle ~]$ cp ./product/11gR2/assistants/dbca/templates/Seed_Database.dfb oradata/orcl/
然后再执行$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/response/dbca.rsp命令
Enter SYS user password:

Enter SYSTEM user password:

Copying database files

1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

建库后进行实例进程检查
$ps -ef | grep ora_ | grep -v grep

查看监听状态
$lsnrctl status

登录查看实例状态
$sqlplus / as sysdba
SQL> select status from v$instance;
如显示
STATUS
------------
OPEN
则表示实例是启动状态

查看数据库编码
SQL> select userenv('language') from dual;
查看数据库版本
SQL> select * from v$version;

sqlplus / as sysdba
startup
shutdown immediate

lsnrctl status
lsnrctl start
lsnrctl stop

centos7mini静默安装oracle11gr2的更多相关文章

  1. rhel 5.8下静默安装oracle11gr2

    1.图形界面下录制脚本如下: #-------------------------------------------------------------------------------# Do ...

  2. Oracle安装部署之rhel 5.8下静默安装oracle11gr2

    1.图形界面下录制脚本如下: #-------------------------------------------------------------------------------# Do ...

  3. Linux CentOS7.5静默安装Oracle11gR2

    网上有很多安装教程,但大多不够完整,参照了一些教程,实测安装成功,整理出来分享给大家! 一.官方最低要求配置 内存:1G(官方最低要求1G) 硬盘:40G(企业版安装所需4.29G和1.7G数据文件) ...

  4. oracle11gR2静默安装

    oracle11G静默安装过程——linux环境 1.操作系统及Oracle版本 Linux版本:CentOS release 6.8 (Final) Oracle版本:Oracle Database ...

  5. CentOS6.5上Oracle11gR2静默安装

    一.环境准备环境 操作系统:CentOS release 6.5 (Final) 内核版本:2.6.32-431.el6.x86_64 物理内存:2G(必须大于1G) swap分区:3G(必须大于3G ...

  6. linux下的oracle11gR2静默安装,经验分享

    说明: 1.我的linux是64位的redhat6.5,安装的oracle版本是11.2.0的. 2.我这是自己安装的linux虚拟机,主机名为ora11g,ip为192.168.100.122 3. ...

  7. oracle11g-R2静默安装报错[INS-32013]解决方案

    问题描述: oracle静默安装很强大...,参数搞不对.安装就扯dan了....这个报错搞了一个下午.终于搞定了如释负重.... 如果当初选择仅仅安装oracle软件就没多事情.想一步完成(数据库软 ...

  8. CentOS 6.2 X64上64位Oracle11gR2 静默安装,静默设置监听,静默建库经验

    1 安装前环境:  操作系统:CetnOS6.2x64 最小化安装,已配置好网络IP:172.16.2.182,物理内存8GB,硬盘100GB.  已下载: Linux.x64_11gR2_datab ...

  9. RHEL7.5 静默安装(silent mode)oracle11gr2数据库软件

    如果没有图形界面多可怕,或者图形界面安装总报些奇怪的错误多可怕,静默安装数据库软件了解一下 修改主机名.关闭selinux [root@localhost ~]$ sed -i '3,$d' /etc ...

随机推荐

  1. Mac新系统常用设置

    一.MAC OS整个系统的隐藏文件显示可见,在终端下输入以下命令defaults write com.apple.finder AppleShowAllFiles -bool true 二. 在MAC ...

  2. 【Bootstrap】 typeahead自动补全

    typeahead 这篇文章记录了我在使用typeahead的一些问题,不是很全,但是基本够用. Bootstrap提供typeahead组件来完成自动补全功能. 两种用法: 直接给标签添加属性 &l ...

  3. RabbitMQ 学习日记

    RabbitMQ三种Exchange模式(fanout,direct,topic)的性能比较 http://www.rabbitmq.com/tutorials/tutorial-one-dotnet ...

  4. 前端技术之--HTML

    1.一套规则,浏览器认识的规则. 2.开发者: 学习Html规则 开发后台程序: - 写Html文件(充当模板的作用) ****** - 数据库获取数据,然后替换到html文件的指定位置(Web框架) ...

  5. manjaro安装及设置

    因我的笔记本(联想的拯救者)昨晚打开后什么都还没做就被更新系统“抢走”了画面导致按什么都不管用 所以就想起能不能不用win系统,都知道linux比win稳定,so....就找到了manjaro.以下是 ...

  6. python实现Hbase

    1. 下载thrift 作用:翻译python语言为hbase语言的工具 2. 运行时先启动hbase 再启动thrift,最后在pycharm中通过happybase包连接hbase 在hbase目 ...

  7. Boredom

    Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winte ...

  8. tar 压缩归档

    压缩归档 掌握归档的定义:归档(archiving)就是将许多文件(或目录)打包成一个文件. 了解归档的目的:归档的目的就是方便备份.还原及文件的传输操作. 掌握tar命令的功能:将多个文件(也可能包 ...

  9. 按比例缩放DIV

    class ResponsiveDiv extends React.Component { constructor(props) { super(props); this.state = { widt ...

  10. Android源代码下载 “Gerrit下载源代码”

    repo init -u ssh://jenkins@gerrit.y:29419/manifest -m k86A.xml 使用-m参数指定具体使用的是k86A.mxl文件 步骤1. curl ht ...