首页 > 数据库 >linux静默安装oracle11g

linux静默安装oracle11g

时间:2022-11-30 16:57:43浏览次数:48  
标签:complete database 静默 export ORACLE install linux oracle oracle11g

目录

linux静默安装oracle11g

1、环境准备

1.1下载安装包

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip 
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

1.2、安装rz依赖

yum install lrzsz -y

1.3、关闭selinux

vi /etc/selinux/config

设置SELINUX=disabled

1.4、关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

1.5、安装oracle依赖

yum install -y gcc make binutils gcc-c++ compat-libstdc++-33elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat unixODBC unixODBC-devel pcre-devel

1.6、创建用户以及用户组

groupadd -g 54321 oinstall
useradd -u 54321 -g oinstall oracle
passwd oracle

1.7、创建oracle安装目录

root用户执行

mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
mkdir -p /u01/oradata
chown -R oracle:oinstall /u01
chmod -R 775 /u01

2、更改系统环境

2.1、修改系统内核配置

vi /etc/sysctl.conf

追加:

#Oracle

#Oracle

# oracle-database-preinstall-19c setting for fs.file-max is 6815744
fs.file-max = 6815744

# oracle-database-preinstall-19c setting for kernel.sem is '250 32000 100 128'
kernel.sem = 250 32000 100 128

# oracle-database-preinstall-19c setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# oracle-database-preinstall-19c setting for kernel.shmall is 1073741824 on x86_64
kernel.shmall = 1073741824

# oracle-database-preinstall-19c setting for kernel.shmmax is 4398046511104 on x86_64
kernel.shmmax = 4398046511104

# oracle-database-preinstall-19c setting for kernel.panic_on_oops is 1 per Orabug 19212317
kernel.panic_on_oops = 1

# oracle-database-preinstall-19c setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# oracle-database-preinstall-19c setting for net.core.rmem_max is 4194304
net.core.rmem_max = 4194304

# oracle-database-preinstall-19c setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# oracle-database-preinstall-19c setting for net.core.wmem_max is 1048576
net.core.wmem_max = 1048576

# oracle-database-preinstall-19c setting for net.ipv4.conf.all.rp_filter is 2
net.ipv4.conf.all.rp_filter = 2

# oracle-database-preinstall-19c setting for net.ipv4.conf.default.rp_filter is 2
net.ipv4.conf.default.rp_filter = 2

# oracle-database-preinstall-19c setting for fs.aio-max-nr is 1048576
fs.aio-max-nr = 1048576

# oracle-database-preinstall-19c setting for net.ipv4.ip_local_port_range is 9000 65500
net.ipv4.ip_local_port_range = 9000 65500

修改后刷新配置:

sysctl -p

2.2、设定oracle用户的环境变量

oracle用户编辑 ~/.bash_profile 文件

vi ~/.bash_profile

需要更改指定实例名

export ORACLE_UNQNAME

export ORACLE_SID

export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=dbserver24.localdomain
export ORACLE_UNQNAME=cpicdev #标识
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cpicdev #实例名

export DATA_DIR=/u01/oradata
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LANG="en_US.UTF-8"
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
export NLS_DATA_FORMAT="yyyy-mm-dd hh24:mi:ss"

使环境变量生效(最好重启机器,确保所有配置生效)

source ~/.bash_profile

3、安装数据库

3.1、解压文件

oracle用户执行

cd /u01/package/
unzip /u01/package/linux.x64_11gR2_database_1of2.zip
unzip /u01/package/linux.x64_11gR2_database_2of2.zip

3.2、静默安装软件

在oracle用户执行(使用图形安装需要直接用oracle用户登录,用su到oracle用户出现问题)(一行的)

/u01/package/database下执行:

./runInstaller -waitforcompletion -silent -ignorePrereq 
-responseFile /u01/package/database/response/db_install.rsp 
oracle.install.option=INSTALL_DB_SWONLY 
ORACLE_HOSTNAME=${ORACLE_HOSTNAME} 
UNIX_GROUP_NAME=oinstall 
INVENTORY_LOCATION=${ORA_INVENTORY} 
SELECTED_LANGUAGES=en,zh_CN,zh_TW 
ORACLE_HOME=${ORACLE_HOME} 
ORACLE_BASE=${ORACLE_BASE} 
oracle.install.db.InstallEdition=SE 
oracle.install.db.isCustomInstall=true 
oracle.install.db.OSBACKUPDBA_GROUP=dba 
oracle.install.db.OSDGDBA_GROUP=dba  
oracle.install.db.OSKMDBA_GROUP=dba 
oracle.install.db.DBA_GROUP=oinstall 
oracle.install.db.OPER_GROUP=oinstall 
DECLINE_SECURITY_UPDATES=true 
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false  

./runInstaller -waitforcompletion -silent -ignorePrereq -responseFile /u01/package/database/response/db_install.rsp oracle.install.option=INSTALL_DB_SWONLY ORACLE_HOSTNAME=${ORACLE_HOSTNAME} UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=${ORA_INVENTORY} SELECTED_LANGUAGES=en,zh_CN,zh_TW ORACLE_HOME=${ORACLE_HOME} ORACLE_BASE=${ORACLE_BASE} oracle.install.db.InstallEdition=SE oracle.install.db.isCustomInstall=true oracle.install.db.OSBACKUPDBA_GROUP=dba oracle.install.db.OSDGDBA_GROUP=dba  oracle.install.db.OSKMDBA_GROUP=dba oracle.install.db.DBA_GROUP=oinstall oracle.install.db.OPER_GROUP=oinstall DECLINE_SECURITY_UPDATES=true SECURITY_UPDATES_VIA_MYORACLESUPPORT=false  

成功如下:

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 670901 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 7934 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-11-29_05-44-21PM. Please wait ...You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2022-11-29_05-44-21PM.log
The following configuration scripts need to be executed as the "root" user. 
 #!/bin/sh 
 #Root scripts to run

/u01/app/oracle/product/11.2.0/dbhome_1/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.

使用root用户执行:生成/etc/oratab

/u01/app/oracle/product/11.2.0/dbhome_1/root.sh

3.2.1可能会出现的问题:

邮件问题,加上:

DECLINE_SECURITY_UPDATES=true 

组内执行权限问题:

User is not a member of the following chosen OS groups: [null, null]

oracle.install.db.DBA_GROUP=oinstall 
oracle.install.db.OPER_GROUP=oinstall 

有些强制参数问题:

Target environment do not meet some mandatory requirements.

-ignorePrereq 

3.3、安装实例

oracle用户执行(一行的)

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE -characterSet AL32UTF8 -sysPassword Sinosoft_908 -systemPassword Sinosoft_908 -databaseType MULTIPURPOSE -totalMemory 2000 -storageType FS -datafileDestination "${DATA_DIR}"  -redoLogFileSize 50  -emConfiguration NONE

安装完成后提示:

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/insapi/insapi.log" for further details.

3.4、将动态参数写入到静态参数文件中

参数将会写在 $ORACLE_HOME/dbs 目录下

sqlplus / as sysdba

SQL> create pfile from spfile;

3.5、启动监听

lsnrctl status
lsnrctl start

4、cat: /etc/oratab: No such file or directory

find -name root.sh

sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

标签:complete,database,静默,export,ORACLE,install,linux,oracle,oracle11g
From: https://www.cnblogs.com/lgxdev/p/16938985.html

相关文章

  • linux迁移oracle数据库实例
    目录linux迁移oracle数据库实例1、expdp全库导出数据库实例1.1、选取实例1.2登录管理员用户,查询导出的目录文件,DIRECTORY1.3全库导出命令2、import导入库中创建新的实例,承......
  • Linux下用rm误删除文件的三种恢复方法
    Linux下用rm误删除文件的三种恢复方法对于rm,很多人都有惨痛的教训。我也遇到一次,一下午写的程序就被rm掉了,幸好只是一个文件,第二天很快又重新写了一遍。但是很多人可能......
  • Multiple Ways to Change Terminal Shell in Linux All In One
    MultipleWaystoChangeTerminalShellinLinuxAllInOneLinuxchangeterminalshellmethodsAllIinOne$cat/etc/shells#/etc/shells:validloginshel......
  • linux下awk命令详解
    awk是行处理器:相比较屏幕处理的优点,在处理庞大文件时不会出现内存溢出或是处理缓慢的问题,通常用来格式化文本信息awk处理过程: 依次对每一行进行处理,然后输出awk命令......
  • Linux - 安装 jenkins
    一、下载ant官方下载地址: https://jenkins.io/zh/download/jenkins中文网地址: http://www.jenkins.org.cn/djenkins安装包下载地址: http://mirrors.jenkins-ci.org/war......
  • Linux中&&和&,|和||用法及区别详解!
    在使用Linux命令时,我们往往可以一行执行多条命令,或者有条件的执行下一条命令,对于刚接触Linux命令时,特殊符号绝对是最困扰的事情之,本篇文章将为大家详细介绍下&&和&,|和||的......
  • linux服务器出厂测试抓包
    注:适用于超微x86_64主板,已测阿里龙蜥8.4,华为欧拉20.03,centos7,centos8,细节部分根据自己实际情况调整[root@test~]#catTheServer_test_supermicro_x86_64.shBaseboard......
  • 初学者需掌握的12条基本 Linux 命令
    对于初学者来说,在Linux中使用命令行进行操作,很容易就会出错,有时候这种错误会带来灾难性的后果。比如,让你尝试删除某个文件夹的时候,使用了rm-rf*,而恰巧,你当前在根路径下........
  • VMware虚拟机上安装Linux系统
    VMware虚拟机上安装Linux系统......
  • 性能测试中常用的linux命令
    在做性能测试中有没有遇到分析需求的情况,如果有,下面这几个命令就能帮助到您啦,我们直奔主题1.grep 作用:搜索工具 用法:grep“搜索的关键词” 2.awk 作用:分析工......