首页 > 数据库 >oracle linux 7.9 静默安装oracle 11g

oracle linux 7.9 静默安装oracle 11g

时间:2023-06-13 13:11:06浏览次数:54  
标签:11g config db install linux oracle root u01

搭建虚拟机步骤配置ip,步骤省略。

 下载linux 版本 11g Oracle 安装包,通过sftp上传到虚拟机。

oracle11.2.4安装包及补丁包链接如下:

链接:https://pan.baidu.com/s/1TaVNOqXCoSjsJJZ-ADLkmw
提取码:ycxi

前两个zip包为oracle ,第三个为grid安装包,只安装数据,则下载1和2即可,如需搭建集群则需下载1,2,3安装包

 

 

sftp上传

登录linux配置本地光盘源,转移/etc/yum.repos.d/目录下所有文件,新建/etc/yum.repos.d/cr.repo文件

[base]
name=cr7
baseurl=file:///mnt
gpgcheck=0
enabled=1

配置后,执行yum list 

 

联网环境也可使用oracle官方源,使用命令下载:

 wget  http://public-yum.oracle.com/public-yum-ol7.repo


安装net-tools,安装net-tools,只是为了使用ifconfig 命令,命令如下:

 yum install net-tools* -y


安装unzip ,解压oracle安装包使用unzip命令:


yum install unzip -y

 

安装oracle 依赖包

yum install -y binutils*
yum install -y compat-libcap1*
yum install -y gcc*
yum install -y gcc-c++*
yum install -y glibc*
yum install -y glibc-devel*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y libstdc++-devel*
yum install -y libXi*
yum install -y libXtst*
yum install -y make*
yum install -y sysstat*
yum install -y elfutils-libelf-devel*

 新建oracle 用户组

/usr/sbin/groupadd -g 1000 oinstall
/usr/sbin/groupadd -g 1020 asmadmin
/usr/sbin/groupadd -g 1021 asmdba
/usr/sbin/groupadd -g 1022 asmoper
/usr/sbin/groupadd -g 1031 dba
/usr/sbin/groupadd -g 1032 oper
useradd -u 1101 -g oinstall -G dba,asmdba,oper oracle
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
passwd oracle (修改oracle 密码为oracle)

 

更改/data 目录为/u01

 

[root@localhost ~]# umount  /data
[root@localhost ~]#
[root@localhost ~]# mv /data/ /u01
[root@localhost ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Jun 13 06:54:52 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/ol-root     /                       xfs     defaults        0 0
/dev/mapper/ol-data     /data                       xfs     defaults        0 0
UUID=913737af-8c35-474c-a23a-e9fcacd182f2 /boot                   xfs     defaults        0 0
/dev/mapper/ol-swap     swap                    swap    defaults        0 0
[root@localhost ~]# vi  /etc/fstab
[root@localhost ~]#
[root@localhost ~]# mount /dev/mapper/ol-data /u01
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             1.8G     0  1.8G   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                1.8G  8.8M  1.8G   1% /run
tmpfs                1.8G     0  1.8G   0% /sys/fs/cgroup
/dev/mapper/ol-root   26G  1.9G   25G   7% /
/dev/sda1           1014M  184M  831M  19% /boot
tmpfs                365M     0  365M   0% /run/user/0
/dev/sr0             4.6G  4.6G     0 100% /mnt
/dev/mapper/ol-data   40G  2.5G   38G   7% /u01
[root@localhost ~]# ls /u01/
p13390677_112040_Linux-x86-64_1of7.zip  p13390677_112040_Linux-x86-64_2of7.zip
[root@localhost ~]#

  

 解压oracle 安装包

[root@localhost u01]# unzip p13390677_112040_Linux-x86-64_1of7.zip && unzip p13390677_112040_Linux-x86-64_2of7.zip 
[root@localhost u01]#
[root@localhost u01]#
[root@localhost u01]# du -sh database/
2.5G    database/
[root@localhost u01]# 

解压后再次执行:

 

chown -R oracle:oinstall /u01
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

系统参数修改

修改,两个文件/etc/sysctl.conf,和/etc/security/limits.conf(两节点都需要修改)

/etc/sysctl.conf添加如下

kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
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 = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304

修改完毕执行sysctl -p。

/etc/security/limits.conf 添加如下

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

 

修改主机名,修改hosts文件对应,如下

[root@ora01 ~]# cat /etc/hostname
ora01
[root@ora01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.11.128 ora01
[root@ora01 ~]#

  

 

编辑oracle 静默安装文件

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=ora01
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
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=ZHS16GBK
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=512
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
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.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

 

切换到Oracle开始执行静默安装

/u01/database/runInstaller   -ignoreSysPrereqs  -silent  -showProgress -responseFile /u01/database/response/db_install.rsp

执行进度如下图所示:

 执行root脚本

[oracle@ora01 ~]$ /u01/app/oraInventory/orainstRoot.sh
This script must be executed as root
[oracle@ora01 ~]$ exit
logout
[root@ora01 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@ora01 ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Check /u01/app/oracle/product/11.2.0/db_1/install/root_ora01_2023-06-13_00-42-04.log for the output of root script
[root@ora01 ~]# tail -f  /u01/app/oracle/product/11.2.0/db_1/install/root_ora01_2023-06-13_00-42-04.log
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Finished product-specific root actions.

 

配置oracle 环境变量

export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=orcl    
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022

创建数据库

编辑dbca.rsp 配置文件

[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl"
SID = "orcl"
NODELIST=ora01
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
CHARACTERSET = "ZHS16GBK"
NATIONALCHARACTERSET= "UTF8"

 

执行创建数据库

dbca -silent -responsefile /u01/database/response/dbca.rsp

[oracle@ora01 ~]$ dbca -silent -responsefile /u01/database/response/dbca.rsp
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/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
[oracle@ora01 ~]$

  

创建监听

编辑监听配置文件netca.rsp

 

[GENERAL]
RESPONSEFILE_VERSION="11.2"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}

  

执行监听创建命令如下命令行:

[oracle@ora01 ~]$  netca -silent -responsefile /u01/database/response/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /u01/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control:
      /u01/app/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@ora01 ~]$

查看监听状态

 

[oracle@ora01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 13-JUN-2023 01:02:31

Copyright (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                13-JUN-2023 01:01:37
Uptime                    0 days 0 hr. 0 min. 53 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora01)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora01 ~]$

  

测试连接数据库

 

[oracle@ora01 ~]$ sqlplus system/[email protected]:1521/orcl

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 13 01:04:20 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

  

 

标签:11g,config,db,install,linux,oracle,root,u01
From: https://www.cnblogs.com/wenxiao1-2-3-4/p/17477121.html

相关文章

  • c++ linux基础学习第一课
    课程目标:1.shell命令解析器shell就是命令解析器,将用户命令翻译成内核能够识别的指令。shell常用的快捷键:tab:补齐命令,补齐文件(包括目录和文件)ctrl+a光标移动到头部,ctrl+e光标移动到尾部2.linux下主要目录:/bin保存着二进制文件、可执行程序和shell命令/sbins是superu......
  • ORACLE如何找出视图依赖的对象和视图嵌套层数
    之前写过一篇文章“SQLServer如何找出视图依赖的对象和视图嵌套层数”,这里我介绍一下Oracle数据库中如何找出视图的依赖对象以及视图嵌套层数关系。主要通过DBA_DEPENDENCIES这个系统视图(这个系统视图中包含有对象的依赖关系数据)。另外,我们使用了Oracle的树形查询(层级查询)来展示......
  • 【Linux】CentOS防火墙操作:开启端口、开启、关闭、配置
    ......
  • Linux打包C++应用deb脚本
    目录结构├──CMakeLists.txt├──README.md├──scripts│  └──build_deb.sh├──src│  └──app.cpp└──VERSION打包脚本#!/bin/bashPROJECT_NAME="my-app"PROJECT_PATH=$(cd"$(dirname${BASH_SOURCE[0]})";cd..;pwd)MAINTAINER="jojo......
  • linux系统nfs搭建-cnblog
    Linux系统nfs搭建首先介绍一下NFS:​ NFS(NetworkFileSystem)即网络文件系统,是FreeBSD支持的文件系统中的一种,它允许网络中的计算机之间通过TCP/IP网络共享资源。在NFS的应用中,本地NFS的客户端应用可以透明地读写位于远端NFS服务器上的文件,就像访问本地文件一样。1、虚拟机nfs环......
  • #yyds干货盘点#linux之curl使用技巧
    获取页面内容>curlhttps://json.im显示HTTP头>curl-Ihttps://json.imHTTP/1.1200OKServer:openrestyDate:Fri,04Jun202107:38:32GMTContent-Type:text/htmlContent-Length:12864Last-Modified:Thu,29Apr202101:39:01GMTConnection:keep-aliveVa......
  • Linux shell 之 for循环变量有空格的问题——IFS变量
    在使用shell的for循环时,如果循环的字符串中间有空格,那么循环时会自动分割,下面是解决的方法 1只需要更改shell分隔符即可2在for循环之前修改IFS变量,示例:3OLDIFS="$IFS"#备份旧的IFS变量4IFS=$'\n'#修改分隔符为换行符56foriin`cataaa`#aaa文件......
  • Oracle 分组统计,按照天、月份周和自然周、月、季度和年
     1.按天selectto_char(t.STARTDATE+15/24,'YYYY-MM-DD')as天,sum(1)as数量fromHOLIDAYtgroupbyto_char(t.STARTDATE+15/24,'YYYY-MM-DD')--ORDERby天NULLSLAST; selecttrunc(t.STARTDATE,'DD')as天,sum(1)as数量from......
  • Linux驱动开发
      本文为一个简单的字符设备驱动,涉及驱动编写、测试程序编写、Makefile编写、驱动加载/卸载,运行于Linux虚拟机,不涉及底层配置。撰写本文的主要目的为记录一下驱动的开发流程,参考了正点原子的驱动开发指南。 驱动代码  创建文件夹1_chrdevbase/,下属APP/与Driver/两个......
  • oracle中rownum和row_number()
     oracle中rownum和row_number() row_number()over(partitionbycol1orderbycol2)表示根据col1分组,在分组内部根据col2排序,而此函数计算的值就表示每组内部排序后的顺序编号(组内连续的唯一的)。与rownum的区别在于:使用rownum进行排序的时候是先对结果集加入伪劣rownum然后......