oracle软件静默安装程序,【oracle】静默安装 oracle 11gr2

【序言】

oracle 提供了静默安装方法在不适用图形界面的情况下安装 oracle 软件 ,创建db,配置netca,快速完成oracle 的部署。

在以下情形中可以使用静默安装

a OUI 的 GUI 界面远程交互比较慢 .

b 数据库服务器无法使用图形界面访问.

c 批量部署oracle (标准环境统一情况下可以使用oracle 的relink ,这样更加快速).

本文主要讲述基本安装步骤,不涉及oracle 安装完成之后的运维规范: 监控,备份,定时日志清理,基础运维配置。

一 准备工作1.linux检查安装包是否全

rpm -q --queryformat \"%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils \

compat-libstdc++-33 compat-db control-center elfutils-libelf elfutils-libelf-devel gcc \

gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ \

libstdc++-devel make sysstat unixODBC glibc-headers unixODBC-devel \

oracleasm oracleasmlib oracleasm-support \

pdksh sysstat xscreensaver | grep not | grep -v grep | awk '{print "yum install -y " $2 }'

如果有未安装的rpm ,则需要手动安装。

注意:其中oracleasm oracleasmlib oracleasm-support可以去oracle官方asm lib网站下载

2.OS参数修改

a 修改/etc/sysctl.conf 文件 添加如下内容:

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 48719476736

kernel.shmmni = 4096

kernel.sem = 250 32000 200 200

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 1048586

net.core.rmem_max = 4194304

执行:

/sbin/sysctl -p

b修改/etc/security/limits.conf 添加如下内容:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536 c修改 /etc/pam.d/login 添加如下内容:

session required pam_limits.so

d 修改 /etc/profile

if [ $USER = "oracle" ] ; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

3创建oracle属组并添加oracle 用户

groupadd -g 501 oinstall

groupadd -g 502 dba

groupadd -g 601 asmadmin

groupadd -g 602 asmdba

groupadd -g 603 asmoper

useradd -u 1101 -g oinstall -G dba  oracle

创建oracle软件安装目录

mkdir -p /opt/app/oracle

chown -R oracle:oinstall /opt/app/oracle

chmod -R 775 /opt

4 Oracle环境变量

---oracle .bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/opt/rac/oracle/opatch/OPatch

export PATH

umask 022

export ORACLE_BASE=/opt/app/oracle

export ORACLE_HOME=$ORACLE_BASE/11.2.0/product/db

export ORACLE_SID=orcl

export TNS_ADMIN=$ORACLE_HOME/network/admin

export ORA_NLS10=$ORACLE_HOME/nls/data

export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

export PS1=$LOGNAME@`hostname`:'$PWD>'

export SQLPATH=$ORACLE_HOME/sqlplus/admin:/home/oracle/admin/sql

alias ohome="cd $ORACLE_HOME"

alias tf="tail -f /opt/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log"

alias sql='sqlplus "/"'

alias sqln="sqlplus /nolog"

alias rm='rm -i --'

ulimit -u 16384 -n 63536 #linux

esc="033["

echo " "

echo " "

echo -e "${esc}31;1m******************************************************************${esc}0m"

echo -e "${esc}31;1m***This is PRODUCT , Please be careful of your operation!***${esc}0m"

echo -e "${esc}31;1m******************************************************************${esc}0m"

echo " "

echo " "

二   安装

1 此步骤很重要,如果忽略1 ,最终会提示inventory 文件目录非空 导致静默安装失败 文章末尾会加以说明

vim /etc/oraInst.loc

inventory_loc=/u01/app/oraInventory

inst_group=oinstall

2 静默安装 11.2.0.1 采用 debug模式安装 ,如果有异常则更容易发现错误原因。

./runInstaller -silent -debug -force -noconfig -IgnoreSysPreReqs \

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0 \

oracle.install.option=INSTALL_DB_SWONLY \

DECLINE_SECURITY_UPDATES=true \

UNIX_GROUP_NAME=oinstall \

INVENTORY_LOCATION=/u01/app/oraInventory \

SELECTED_LANGUAGES=en,zh_CN,zh_TW \

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db \

ORACLE_BASE=/u01/app/oracle \

oracle.install.db.InstallEdition=EE \

oracle.install.db.isCustomInstall=false \

oracle.install.db.DBA_GROUP=dba \

oracle.install.db.OPER_GROUP=dba

安装完成显示如下信息:

7f8c40a0aa97a75e0508647cd6d2b64a.png

安装完成之后 系统会提示我们用root用户运行如下两个脚本 。

sh /u01/app/oracle/oraInventory/orainstRoot.sh

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

附上oracle软件静默安装的参数含义如下:

-silent       表示以静默方式安装,不会有任何提示

-force        表示允许安装到一个非空目录

-noconfig     表示不运行配置助手netca

-responseFile 表示使用哪个响应文件,必需使用绝对路径

oracle.install.responseFileVersion  响应文件模板的版本,该参数不要更改

oracle.install.option               安装模式选项,本例只安装oracle软件,该参数不要更改

DECLINE_SECURITY_UPDATES            是否需要在线安全更新,设置为false,该参数不要更改

UNIX_GROUP_NAME oracle              用户用于安装软件的组名

INVENTORY_LOCATION                  oracle 产品清单目录

SELECTED_LANGUAGES                  oracle 运行语言环境,一般包括引文和简繁体中文

ORACLE_HOME                         oracle安装目录

ORACLE_BASE                         oracle基础目录

oracle.install.db.InstallEdition    安装版本类型,一般是企业版

oracle.install.db.isCustomInstall   是否定制安装,默认Partitioning,OLAP,RAT都选上。根据自己的需要选择组件。

oracle.install.db.customComponents  定制安装组件列表:除了以上默认的,可加上Label Security和Database Vault

oracle.install.db.DBA_GROUP         oracle 用户用于授予osdba权限的组名

oracle.install.db.OPER_GROUP        oracle 用户用于授予osoper权限的组名

3 静默安装db

安装完成oracle软件之后还没创建db,我们可以继续使用静默方式创建数据库。

dbca -silent -responseFile /u01/app/software/database/dbca.rsp

dbca.rsp 文件内容如下:根据自己的场景进行修改。

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0"

OPERATION_TYPE = "createDatabase"

[CREATEDATABASE]

GDBNAME = "orcl"

SID = "orcl"

TEMPLATENAME = "New_Database.dbt"

SYSPASSWORD = "xxxxxxx"

SYSTEMPASSWORD = "xxxxxxx"

SYSMANPASSWORD = "xxxxxxx"

DBSNMPPASSWORD = "xxxxxxx"

DATAFILEDESTINATION ="/u01/app/oracle/oradata"

STORAGETYPE=FS

CHARACTERSET = "AL32UTF8"

DATABASETYPE = "MULTIPURPOSE"

AUTOMATICMEMORYMANAGEMENT = "FALSE"

TOTALMEMORY =8192

静默安装的过程如下:

cb6befa486226a9be4d6badab06de265.png

4 配置网络监听

这一步我没有使用netca的默认方式,而是直接编辑了$ORACLE_HOME/network/admin/ 下的*.ora 文件。

根据需求编辑好了之后启动监听。

lsnrctl start

5 登陆数据库

26dcff7c0613b0793afb4c2bac6f04b6.png

三 遇到的问题问题一 相信这个问题也是很多人也会遇到

[FATAL] [INS-32035] Unable to create a new central inventory at the specified location.

CAUSE: The central inventory location provided is not empty.

ACTION: Please provide another location for the inventory, or clean up the current location.

解决方法:

使用root vim /etc/oraInst.doc 加入

inventory_loc=/u01/app/oraInventory

inst_group=oinstall

问题二

[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.

CAUSE: The Central Inventory is located in the Oracle base.

ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.

解决方法:

如提示所言 Inventory 目录安装在了$ORACLE_BASE 目录下了,所以调整Inventory目录不在$ORACLE_BASE 目录下,即可解决问题。

oraInventory 存放Oracle软件安装的目录信息,Oralce的安装和升级都需要用到这个目录,删除或丢失oraInventory目录的内容就会导致安装/升级失败。Oracle官方文档对oraInventory的说明:

All Oracle software installations rely on this directory.

Ensure that you back it up regularly.

Do not delete this directory unless you have completely removed

all Oracle software from the system.

oraInventory 目录的位置是由oraInst.loc 文件决定的:

/etc/oraInst.loc                (AIX and Linux Platform)

/var/opt/oracle/OraInst.loc (Solaris and HP-UX platform)

四 小结

说些题外话 因为项目的原因需要安装一套oracle 系统,谷歌,度娘 静默安装 等关键词,大多数文章基本都千篇一律。真不知道写文章的人是否真正安装成功?论坛上说学习称赞的人是否动手验证过?

纸上来得终觉浅 ,绝知此事要躬行。

做一个靠谱的人,更要做一个技术上靠谱的dba。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/440450.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【2050 Programming Competition - 2050 一万人码 】非官方部分题解(HDU)

1001 开场白 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 12147 Accepted Submission(s): 3502 Problem Description 来自世界各地的年青人在 https://2050.org.cn 握手团聚, 他们是航空…

oracle数据库建表视频,Oracle数据库的创建表全

CREATE TABLE "库名"."表名" ("FEE_ID" VARCHAR2(10 BYTE) constraint ABS_FEE_ID primary key,--主键,必须要有序列"BANK_GROUP_ID" VARCHAR2(5 BYTE),"ABS_PRODUCT_ID" VARCHAR2(30 BYTE))TABLESPACE "表…

oracle的脚本语言是什么意思,Oracle中的sql脚本语言中的循环语句介绍

--sql脚本语言的循环介绍&#xff1a;--1.goto循环点。declarex number;beginx:0;--变量初始化&#xff1b;<>--设置循环点。x:x1;dbms_output.put_line(x);--循环体if x<9 then --进入循环的条件。goto repeat_loop; --用goto关键字引导进入循环。end i…

【poj题集整理】【存下来并不会看】

主要是整理起来自己用的。网上有多个版本。 初级: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算…

oracle排名怎么去除空值影响,Oracle排序中null值处理方法讲解

1、缺省处理oracle在order by 时缺省认为null是最大值&#xff0c;所以如果是asc升序则排在最后&#xff0c;desc降序则排在最前2、使用nvl函数nvl函数可以将输入参数为空时转换为一特定值&#xff0c;如nvl(employee_name,’张三’)表示当employee_name为空时则返回’张三’&a…

【ZOJ - 3870】Team Formation(异或,思维)

题干&#xff1a; For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student. He has found that if two students with skill lev…

oracle dump enq hw,经典故障分析 - ASSM引发的索引争用与 enq HW -contentio

作者介绍&#xff1a;孙加鹏 云和恩墨技术顾问六年Oracle技术顾问经验&#xff0c;所服务的行业包括电信运营商、金融业、制造业等。擅长Oracle的故障诊断、高可用架构、升级迁移等。目前主要服务于上海金融类客户。1故障概述2017年07月24日11:58左右&#xff0c;客户核心数据库…

【ZOJ - 3946】Highway Project(最短路子图,维护双权值,贪心,最小树形图)

题干&#xff1a; Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capital as fast as possible. Thus, he proposed the highway project. The Marjar Empire has N cities (including…

oracle 主键约束复制,Oracle主键及约束

Oracle主键Primary Key包含非空约束及唯一约束。添加主键的语句alter table table_nameadd constraint cons_name primary key(col_name);查看主键是否被创建成功select dbms_metadata.get_ddl(‘OBJECT_TYPE‘,‘NAME‘,‘SCHEMA‘) from dual;OBJECT_TYPE (TABLE,PARTITION,I…

【ZOJ - 3956】Course Selection System(01背包)

题干&#xff1a; There are n courses in the course selection system of Marjar University. The i-th course is described by two values: happiness Hi and credit Ci. If a student selects m courses x1, x2, ..., xm, then his comfort level of the semester can be…

oracle 账户 锁定 密码忘记了,Oracle System密码忘记 密码修改、删除账号锁定lock

运行cmd命令行录入 sqlplus /nolog 无用户名登录conn /as sysdba 连接到数据本地数据alter user system identified by password; 修改System 密码 为passwordD:\oracle\ora92\bin>sqlplus /nologSQL*Plus: Release 9.2.0.1.0 - Production on 星期四 8月 16 11:32:22 …

【计蒜客 - 2019南昌邀请赛网络赛 - K】MORE XOR(数学,找规律,打表)

Given a sequence of nn numbers a_1, a_2, \cdots, a_na1​,a2​,⋯,an​ and three functions. Define a function f(l,r)f(l,r) which returns \oplus a[x]⊕a[x] (l \le x \le rl≤x≤r). The \oplus⊕ represents exclusive OR. Define a function g(l,r)g(l,r) which r…

oracle编译失效物化视图,使用“不存在”的Oracle物化视图

启用快速刷新很棘手,有许多奇怪的限制和无用的错误消息.在这种情况下,您需要创建物理化视图日志WITH ROWID,使用()连接语法,并为每个表添加ROWID.create table tablea(my_id number primary key,a number);create table tableb(my_id number primary key,b number);create mate…

【计蒜客 - 2019南昌邀请赛网络赛 - M】Subsequence(字典树,dp预处理)

题干&#xff1a; Give a string SS and NN string T_iTi​ , determine whether T_iTi​ is a subsequence of SS. If ti is subsequence of SS, print YES,else print NO. If there is an array \lbrace K_1, K_2, K_3,\cdots, K_m \rbrace{K1​,K2​,K3​,⋯,Km​} so th…

Linux把文件移动到容器外,Docker容器与主机之间拷贝文件的方法

一般情况下&#xff0c;我们在启动Docker容器的时候可以使用-v参数映射宿主机的文件或者目录到容器里&#xff0c;这样的话&#xff0c;在宿主机相关目录下的文件修改会自动在容器里生效。但是&#xff0c;如果我们已经启动了一个容器的话&#xff0c;就只能使用下面的这种方式…

【计蒜客 - 2019南昌邀请赛网络赛 - H】Coloring Game(找规律,思维dp)

题干&#xff1a; David has a white board with 2 \times N2N grids.He decides to paint some grids black with his brush.He always starts at the top left corner and ends at the bottom right corner, where grids should be black ultimately. Each time he can mov…

linux打包tar包命令,Linux压缩打包方法连载之一:tar命令

Linux压缩打包方法有很多种&#xff0c;以下讲了tar命令的概念&#xff0c;同时文列举了多种范例供大家查看&#xff0c;希望对大家有所帮助....tar命令[rootlinux ~]# tar [-cxtzjvfpPN] 文件与目录 ....参数&#xff1a;-c &#xff1a;建立一个压缩文件的参数指令(create 的…

【计蒜客 - 2019南昌邀请赛网络赛 - I】Max answer(单调栈,RMQ)

题干&#xff1a; Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the smallest value in the interval. Now she is planning to find the max value of the intervals in her arr…

linux联想电脑wifi密码,联想笔记本Y7000—ubuntu16.4无法开启wifi的解决办法

一、问题描述本人使用的是联想游戏本Y7000&#xff0c;默认装入Win10系统&#xff0c;然当装入Ubuntu16.04双系统时&#xff0c;会出现无线硬件开关关闭的问题&#xff0c;当然也就无法连网。使用rfkill list all会出现如下提示0:ideapad_wlan: Wireless LANSoft blocked: noHa…

【HDU - 6514】Monitor(二维差分,前缀和)

题干&#xff1a; Monitor Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 163840/163840 K (Java/Others) Total Submission(s): 872 Accepted Submission(s): 145 Problem Description Xiaoteng has a large area of land for growing crops, and the land…