[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. jquery 第四章

    1.回顾 节点.append(内容) 节点.prepend(内容) 节点.remove() 节点.attr("属性","值") 节点.css("样式& ...

  2. vs2017 winform打包

    如果没有Visual Studio Installer 说明没有安装打包插件 安装打包插件:Microsoft Visual Studio 2017 Installer Projects 工具 --& ...

  3. 分享腾讯云的Linux服务器连接速度很慢的解决心得(原创)

    最近发觉连接服务器非常慢,之前没有出现过这种情况. 我在这个腾讯云的服务器上弄了很多虚拟服务器,估计是数据量太大 造成了冗余数据较多的原因,咨询了下腾讯云的小哥, 给我了个明确的回复: 您反馈Xshe ...

  4. Linux下如何查看系统启动时间和运行时间以及安装时间

    1.uptime命令输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.00 2.查看/proc/uptime文件计算 ...

  5. springmvc的ModelMap,前台取值

    利用 ${user.id}或者‘${user.id}’都是可以直接获取到的,不过前提是在jsp页面的script脚本中,而在引用的js文件中是不可以使用的,因为${}是jsp的el标签. 利用 ${u ...

  6. C# 集合已修改 可能无法执行枚举操作 zz

    今天编写程序时 修改了list集合 在foreach时报 “集合已修改:可能无法执行枚举操作.”错误. 首先想到的是没有锁定集合对象. 增加了 private readonly object sync ...

  7. vue中Prop父子传值方法

    在用vue做项目的过程中感觉很好玩,特做下笔记... 父组件中: <template> <div> <fpdx-modal :zbArr="polygonArr ...

  8. MBA 拓展训练总结

    1. 拓展训练,大家绑腿跑 沟通时间极短, 规则制定不完善, 对方'王者队'沟通很好, 女队练习的同时, 男队边观看边练习, 效率很高, 由于之前王者输的比较多, 总结很多, 所以执行力也占优了, 我 ...

  9. eclipse部分常用快捷键

    -------------eclipse常用快捷键------------- 1.alt+?或alt+/:自动补全代码或者提示代码 2.ctrl+o:快速outline视图 3.ctrl+shift+ ...

  10. 隐藏状态栏,toolbar前面空格问题,editText圆角

    EditText圆角: 一.在drawable下面添加xml文件rounded_editview.xml 复制代码 代码如下: <?xml version="1.0" enc ...