系统 IP 安装软件
centos7.8 192.168.100.101 Oracle11g
1.在/etc/hosts文件中添加主机名、关闭selinux、关闭防火墙
[root@centos ~]# vi /etc/hosts
192.168.100.101 centos
[root@centos ~]# vi /etc/selinux/config
SELINUX=disabled
[root@centos ~]# systemctl stop firewalld
[root@centos ~]# systemctl disable firewalld
2.上传安装包

安装包可自行提取
链接:https://pan.baidu.com/s/1chTrmweSGNRE7-Z-PJm_Bg
提取码:01ig

[root@centos soft]# ls
p13390677_112040_Linux-x86-64_1of7.zip  p13390677_112040_Linux-x86-64_2of7.zip
3.解压Oracle安装包
[root@centos soft]# unzip p13390677_112040_Linux-x86-64_1of7.zip -d /tmp && unzip p13390677_112040_Linux-x86-64_2of7.zip -d /tmp
等待解压完成后,会在目录下生产一个database文件夹,里面有Oracle 11g安装文件

4.安装依赖包
[root@centos ~]# yum install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel –y
5.添加用户和用户组
[root@centos ~]# groupadd oinstall
[root@centos ~]# groupadd dba
[root@centos ~]# useradd -g oinstall -G dba oracle
[root@centos ~]# passwd oracle #这里密码设置为oracle
[root@centos ~]# id oracle
uid=1000(oracle) gid=1000(oinstall) 组=1000(oinstall),1001(dba)
6.修改内核参数配置文件
添加以下内容
[root@centos ~]# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576[root@centos ~]# sysctl -p其中kernel.shmmax = 2147483648为本机物理内存的一半,单位为byte,我这里是4G内存
7.修改用户的限制文件
[root@centos ~]# vi /etc/security/limits.conf
添加以下内容
oracle           soft    nproc           2047
oracle           hard    nproc           16384
oracle           soft    nofile          1024
oracle           hard    nofile          65536
oracle           soft    stack           10240修改/etc/pam.d/login文件
[root@centos ~]# vi /etc/pam.d/login
添加以下内容
session  required   /lib64/security/pam_limits.so
session  required   pam_limits.so修改/etc/profile文件
[root@centos ~]# vi /etc/profile
添加以下内容
if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fi
fi
[root@centos ~]# source /etc/profile
8.创建安装目录和设置文件权限
[root@centos ~]# mkdir -p /u01/app/oracle/product/11.2.0
[root@centos ~]# mkdir /u01/app/oracle/oradata
[root@centos ~]# mkdir /u01/app/oracle/inventory
[root@centos ~]# mkdir /u01/app/oracle/fast_recovery_area
[root@centos ~]# chown -R oracle:oinstall /u01/app/oracle
[root@centos ~]# chmod -R 775 /u01/app/oracle
[root@centos ~]# dd if=/dev/zero of=/home/swapfile bs=1M count=512
[root@centos ~]# mkswap /home/swapfile
[root@centos ~]# swapon /home/swapfile
[root@centos ~]# vi /etc/fstab     #追加
/home/swapfile swap swap defaults 0 0
9.设置oracle用户环境变量
[root@centos ~]# su - oracle
[oracle@centos ~]$ vi .bash_profile
添加内容如下:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=jcms        #其中实例名自建
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH[oracle@centos ~]$ source .bash_profile
10.编辑静默安装响应文件
[oracle@centos ~]$ cp -R /tmp/database/response/ .
[oracle@centos ~]$ cd response/
[oracle@centos response]$ vi db_install.rsp
29 oracle.install.option=INSTALL_DB_SWONLY
37 ORACLE_HOSTNAME=centos
42 UNIX_GROUP_NAME=oinstall
49 INVENTORY_LOCATION=/u01/app/oracle/inventory
86 SELECTED_LANGUAGES=en,zh_CN
91 ORACLE_HOME=/u01/app/oracle/product/11.2.0
96 ORACLE_BASE=/u01/app/oracle
107 oracle.install.db.InstallEdition=EE
154 oracle.install.db.DBA_GROUP=dba
160 oracle.install.db.OPER_GROUP=dba
400 DECLINE_SECURITY_UPDATES=true
11.根据响应文件静默安装Oracle 11g
[oracle@centos response]$ cd /tmp/database/
[oracle@centos database]$ ./runInstaller -silent -responseFile /home/oracle/response/db_install.rsp -ignorePrereq
执行开始会有一点时间没反应,稍等会就ok了,Oracle在后台静默安装。安装过程中,如果提示[WARNING]不必理会,此时安装程序仍在后台进行,如果出现[FATAL],则安装程序已经停止了。

可以在以下位置找到本次安装会话的日志:
/u01/app/oracle/inventory/logs/installActions…log
可以切换终端执行top命令查看后台进程一直是在安装的,/u01目录也在不断增大

按照要求新打开终端,以root身份登录,执行脚本:

[root@centos ~]# sh /u01/app/oracle/inventory/orainstRoot.sh
[root@centos ~]#  sh /u01/app/oracle/product/11.2.0/root.sh

12.以静默方式配置监听
[oracle@centos database]$ netca /silent /responsefile /home/oracle/response/netca.rsp正在对命令行参数进行语法分析:
参数"silent" = true
参数"responsefile" = /home/oracle/response/netca.rsp
完成对命令行参数进行语法分析。
Oracle Net Services 配置:
完成概要文件配置。
Oracle Net 监听程序启动:
正在运行监听程序控制: /u01/app/oracle/product/11.2.0/bin/lsnrctl start LISTENER
监听程序控制完成。
监听程序已成功启动。
监听程序配置完成。
成功完成 Oracle Net Services 配置。退出代码是0成功运行后,在/u01/app/oracle/product/11.2.0/network/admin/中生成listener.ora和sqlnet.ora
通过netstat命令可以查看1521端口正在监听。
[oracle@centos database]$ netstat -tnulp | grep 1521
tcp        0      0 0.0.0.0:1521            0.0.0.0:*               LISTEN      4861/tnslsnr
13.以静默方式建立新库,同时也建立一个对应的实例。
[oracle@centos database]$ vi /home/oracle/response/dbca.rsp
78 GDBNAME = "jcms"
170 SID = "jcms"
211 SYSPASSWORD = "oracle"
221 SYSTEMPASSWORD = "oracle"
252 SYSMANPASSWORD = "oracle"
262 DBSNMPPASSWORD = "oracle"
360 DATAFILEDESTINATION = /u01/app/oracle/oradata
370 RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area
418 CHARACTERSET = "ZHS16GBK"
553 TOTALMEMORY = "3276"其中TOTALMEMORY = "3276" 为3276MB,物理内存4G*80%
14.进行静默配置
[oracle@centos database]$ dbca -silent -responseFile /home/oracle/response/dbca.rsp
复制数据库文件
1% 已完成
3% 已完成
11% 已完成
18% 已完成
37% 已完成
正在创建并启动 Oracle 实例
40% 已完成
45% 已完成
50% 已完成
55% 已完成
56% 已完成
60% 已完成
62% 已完成
正在进行数据库创建
66% 已完成
70% 已完成
73% 已完成
85% 已完成
96% 已完成
100% 已完成
有关详细信息, 请参阅日志文件 "/u01/app/oracle/cfgtoollogs/dbca/jcms/jcms.log"。查看监听状态
[oracle@centos database]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-APR-2022 12:44:44Copyright (c) 1991, 2013, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                03-APR-2022 12:24:09
Uptime                    0 days 0 hr. 20 min. 35 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/centos/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)   (KEY=EXTPROC1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos)(PORT=1521)))
Services Summary...
Service "jcms" has 1 instance(s).Instance "jcms", status READY, has 1 handler(s) for this service...
Service "jcmsXDB" has 1 instance(s).Instance "jcms", status READY, has 1 handler(s) for this service...
The command completed successfully登录查看实例状态
[oracle@centos database]$  sqlplus / as sysdba
SQL> select status from v$instance;STATUS
------------
OPEN
15.创建用户表空间,给予权限,用plsql工具连接
SQL> CREATE TABLESPACE test_data LOGGING DATAFILE '/u01/app/oracle/oradata/jcms/jcms01.dbf'  SIZE 32M  AUTOEXTEND ON  NEXT 32M MAXSIZE 2048M EXTENT MANAGEMENT LOCAL;
Tablespace created.
SQL> CREATE USER jcms IDENTIFIED BY 12345678 DEFAULT TABLESPACE TEST_DATA ;User created.
SQL> GRANT dba TO jcms;Grant succeeded.


命令验证:

16.Oracle开机自启动设置
1.修改/u01/app/oracle/product/11.2.0/bin/dbstart
[oracle@centos ~]$ vi /u01/app/oracle/product/11.2.0/bin/dbstart
将ORACLE_HOME_LISTNER=$1修改为ORACLE_HOME_LISTNER=$ORACLE_HOME2.修改/u01/app/oracle/product/11.2.0/bin/dbshut
[oracle@centos ~]$ vi /u01/app/oracle/product/11.2.0/bin/dbshut
将ORACLE_HOME_LISTNER=$1修改为ORACLE_HOME_LISTNER=$ORACLE_HOME3.修改/etc/oratab文件
将jcms:/u01/app/oracle/product/11.2.0:N中最后的N改为Y,成为jcms:/u01/app/oracle/product/11.2.0:Y4.输入命令dbshut和dbstart测试
[oracle@centos ~]$ dbshut
Processing Database instance "jcms": log file /u01/app/oracle/product/11.2.0/shutdown.log
[oracle@centos ~]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-APR-2022 14:53:34Copyright (c) 1991, 2013, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listenerTNS-12560: TNS:protocol adapter errorTNS-00511: No listenerLinux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)   (HOST=centos)(PORT=1521)))
TNS-12541: TNS:no listenerTNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@centos ~]$ ps -ef |grep ora_ |grep -v grep
[oracle@centos ~]$
Oracle监听停止,进程消失[oracle@centos ~]$ dbstart
Processing Database instance "jcms": log file /u01/app/oracle/product/11.2.0/startup.log
[oracle@centos ~]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-APR-2022 14:55:50Copyright (c) 1991, 2013, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                03-APR-2022 14:55:06
Uptime                    0 days 0 hr. 0 min. 43 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/centos/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos)(PORT=1521)))
Services Summary...
Service "jcms" has 1 instance(s).
Instance "jcms", status READY, has 1 handler(s) for this service...
Service "jcmsXDB" has 1 instance(s).
Instance "jcms", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@centos ~]$ ps -ef |grep ora_ |grep -v grep
oracle    24136      1  0 14:55 ?        00:00:00 ora_pmon_jcms
oracle    24140      1  0 14:55 ?        00:00:00 ora_psp0_jcms
oracle    24144      1  1 14:55 ?        00:00:00 ora_vktm_jcms
oracle    24150      1  0 14:55 ?        00:00:00 ora_gen0_jcms
oracle    24154      1  0 14:55 ?        00:00:00 ora_diag_jcms
oracle    24158      1  0 14:55 ?        00:00:00 ora_dbrm_jcms
oracle    24162      1  0 14:55 ?        00:00:00 ora_dia0_jcms
oracle    24166      1  0 14:55 ?        00:00:00 ora_mman_jcms
oracle    24170      1  0 14:55 ?        00:00:00 ora_dbw0_jcms
oracle    24174      1  0 14:55 ?        00:00:00 ora_lgwr_jcms
oracle    24178      1  0 14:55 ?        00:00:00 ora_ckpt_jcms
oracle    24182      1  0 14:55 ?        00:00:00 ora_smon_jcms
oracle    24186      1  0 14:55 ?        00:00:00 ora_reco_jcms
oracle    24190      1  0 14:55 ?        00:00:00 ora_mmon_jcms
oracle    24194      1  0 14:55 ?        00:00:00 ora_mmnl_jcms
oracle    24198      1  0 14:55 ?        00:00:00 ora_d000_jcms
oracle    24202      1  0 14:55 ?        00:00:00 ora_s000_jcms
oracle    24224      1  0 14:55 ?        00:00:00 ora_qmnc_jcms
oracle    24332      1  0 14:55 ?        00:00:00 ora_q000_jcms
oracle    24336      1  0 14:55 ?        00:00:00 ora_q001_jcms
oracle    24340      1  0 14:55 ?        00:00:00 ora_cjq0_jcms
Oracle监听启动,进程启动5.切换到root账户建立自启动脚本
[root@centos ~]# vi /etc/rc.d/init.d/oracle
#!/bin/bash# oracle: Start/Stop Oracle Database 11g R2
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database Management System.
#. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0
ORACLE_USER=oracle
case "$1" in
'start')if [ -f $LOCKFILE ]; thenecho $0 already running.exit 1fi
echo -n $"Starting Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
touch $LOCKFILE;;
'stop')
if [ ! -f $LOCKFILE ]; thenecho $0 already stopping.exit 1
fi
echo -n $"Stopping Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
rm -f $LOCKFILE
;;
'restart')
$0 stop
$0 start
;;
'status')
if [ -f $LOCKFILE ]; thenecho $0 started.elseecho $0 stopped.
fi
;;
*)
echo "Usage: $0 [start|stop|status]"
exit 1
esac
exit 0[root@centos ~]# chmod 755 /etc/rc.d/init.d/oracle
[root@centos ~]# chkconfig oracle on
[root@centos ~]# chkconfig --list oracle
oracle          0:关 1:关 2:开 3:开 4:开 5:开 6:关service oracle start/stop/restart测试
[root@centos ~]# service oracle stop
Stopping oracle (via systemctl):                           [  确定  ]
[root@centos ~]# service oracle status
/etc/init.d/oracle stopped.reboot重启查看Oracle监听和实例进程均能自动启动

oracle11g静默安装相关推荐

  1. oracle11G静默安装脚本(for_linux)

    #!/bin/bash echo "初始化安装脚本" <<COMMENT注:author:whjCREATED: 2020.04.24oracle版本:11.2.0.4 ...

  2. oracle11gR2静默安装

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

  3. 路漫漫远修兮-centos7 oracle 11g 静默安装教程

    1.背景:新服务器上安装oracle11g 数据库 2.下载:现在官网只有最新版本19c或者21c版本下载,可以通过此连接搜索下载,这里需要注册账号,按照提示来就好: https://edeliver ...

  4. 在centos7中静默安装oracle11g

    Centos7静默安装Oracle11G r2 I'm coming !!! 如题,进行操作吧!!!!! 环境准备 软件包在此提取码:vt9f 步骤 安装yum源 在这里用的是阿里云的yum源 [ro ...

  5. 凯歌Java百家号_centos7下静默安装oracle11G图解配置 1

    前言: 本文是<centos7下静默安装oracle11G图解配置>中第一篇.因linux下安装Oracle太过繁琐,如果写在一篇文章中,太长了.本文主要讲解安装前环境配置. Centos ...

  6. 阿里云centos6静默安装oracle11G

    阿里云centos6静默安装oracle11G,亲身安装,详细步骤,百分之99.9999的成功 https://download.csdn.net/download/cowbin2012/103578 ...

  7. 阿里/腾讯云静默安装Oracle11G超级详细教程

    阿里/腾讯云linux安装Oracle11G 本教程使用的环境是: 1H2G Centos7.6 64bit 检查硬件环境 内存要求>1GB(最好是2GB),交换内存大于物理内存的1.5倍,硬盘 ...

  8. 【笔记】CentOS 6-7 静默安装Oracle11g

    一.关闭防火墙 关闭selinux ,编辑 /etc/selinux/config文件,设置SELINUX= enforcing 为SELINUX=disabled vim /etc/selinux/ ...

  9. aix oracle11g 静默安装包,10g for AIX 静默安装

    1 操作系统检查 版本:oslevel -s 位数:lslpp -L | /usr/bin/grep bos.64bit (软件位数) getconf KERNEL_BITMODE  (硬件位数) 2 ...

最新文章

  1. 【中台】“中台”概念究竟是什么?制造业企业需要拥抱吗?
  2. 那些离开工业界,回归学术界的AI科学家们!
  3. git生成SSH-Key
  4. 如何让程序跑起来――第三章
  5. tp3 默认模块 默认方法_您需要了解的有关默认方法的所有信息
  6. 《Java程序设计》学期总结
  7. 算术编码原理与实现【转载】
  8. final finalize finally比较
  9. java获取反射机制的三种方式
  10. c#初学者记录(1)
  11. so运行出错:只包含了头文件,未同时编译cpp
  12. 浮点型变量的误差问题
  13. Linux的运行级别/模式
  14. 软件工程实践 Blog17
  15. Windows下在MSDos窗口下打开指定目录
  16. Fingerprint
  17. Unity2D中逐帧动画的制作
  18. 噜噜噜啦啦啦啦啦啾啾啾~
  19. 山海关与老龙头 逃不掉的寂寞与人群
  20. win10动态壁纸怎么设置_教程丨WIN10系统下设置固定IP或动态IP

热门文章

  1. 一文搞定计算机网络面试题
  2. 模版方法模式--旅游签证
  3. java-01背包(动态规划)
  4. JavaScript - V8
  5. 企业邮箱登录入口,邮箱登陆登录入口有哪些?
  6. 52数学能力测评历年真题及答案(五年级)
  7. 情怀——推荐梁晓声新作《未死的沙威》
  8. 信息安全文章搜索引擎技术原理
  9. C语言求圆锥体积的程序,计算圆锥体积c++程序.doc
  10. iOS 审核总被拒?如何提升 iOS 审核通过率!