脑残网友真多 發表於 2019-6-15 12:54:00

Centos下安装Oracle12c

<h3>总结一次安装oracle的折腾血泪史<br>环境准备</h3>
<ul>
<ul>
<li>centos7</li>
<li>虚拟机VMware Workstation Pro14</li>
<li>IP:192.168.245.128(根据实际情况)</li>
<li>4G物理内存,8G虚拟内存,处理器2</li>
<li>Oracle的安装文件夹不低于15G</li>
<li>为虚拟机分配两个以上的处理器</li>
<li>磁盘SSD</li>
<li>远程登陆:Xshell</li>
<li>软件包:oracle12c&nbsp; 12.2.0.1</li>
<li>数据库下载地址:https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html</li>
<li><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615121839409-1099273043.jpg"><br data-filtered="filtered"><strong>以上虚拟机配置都不是硬性要求,除去安装目录大小,为了安装体验<br><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615121712100-800849595.jpg"></strong></li>







</ul>







</ul>
<ul>
<li>
<h3>安装前准备<br>以root用户登陆</h3>







</li>
<li>关闭防火墙及selinux防火墙
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">systemctl disable firewalld.service
systemctl stop firewalld.service</span></pre>
</div>
<pre><code class="hljs css"><span class="hljs-selector-tag"><span class="hljs-selector-tag"><span class="hljs-selector-tag"><span class="hljs-selector-class"><span class="hljs-selector-tag"><span class="hljs-selector-tag"><span class="hljs-selector-tag"><span class="hljs-selector-class"><span class="hljs-selector-tag">或用以下指令<br></span></span></span></span></span></span></span></span></span></code></pre>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">systemctl stop firewalld
systemctl disable firewalld</span></pre>
</div>
</li>
<li>修改主机名(该步骤非必需,也可在安装centos时指定主机名)
<div class="cnblogs_code">
<pre>vim /etc/<span style="color: rgba(0, 0, 0, 1)">hostname
oracle</span></pre>
</div>
<p>或进入centos界面</p>
<div class="cnblogs_code">
<pre>进入目录 /etc/hostname ,双击打开 hostname<br>修改即可</pre>
</div>
<p>&nbsp;</p>
</li>
<li>修改hosts文件
<div class="cnblogs_code">
<pre>vim /etc/<span style="color: rgba(0, 0, 0, 1)">hosts
</span><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">245.128</span> oracle   <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">直接在配置文件末行添加即可</span></pre>
</div>
<p>或者以root用户登陆界面,进入 /etc/ ,双击打开 hosts<br>在行末添加</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">245.128</span> oracle   </pre>
</div>
</li>
<li>重启虚拟机
<pre><code class="hljs">reboot</code></pre>
</li>
</ul>
<h2>安装Oracle 12c</h2>
<h3>软件环境依赖包包安装</h3>
<div class="cnblogs_code">
<pre>yum install binutils -<span style="color: rgba(0, 0, 0, 1)">y
yum install compat</span>-libcap1 -<span style="color: rgba(0, 0, 0, 1)">y
yum install compat</span>-libstdc++-<span style="color: rgba(128, 0, 128, 1)">33</span> -<span style="color: rgba(0, 0, 0, 1)">y
yum install compat</span>-libstdc++-<span style="color: rgba(128, 0, 128, 1)">33</span>.i686 -<span style="color: rgba(0, 0, 0, 1)">y
yum install glibc </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install glibc.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install glibc</span>-devel -<span style="color: rgba(0, 0, 0, 1)">y
yum install glibc</span>-devel.i686 -<span style="color: rgba(0, 0, 0, 1)">y
yum install ksh </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libaio </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libaio.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libaio</span>-devel -<span style="color: rgba(0, 0, 0, 1)">y
yum install libaio</span>-devel.i686 -<span style="color: rgba(0, 0, 0, 1)">y
yum install libX11 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libX11.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libXau </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libXau.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libXi </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libXi.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libXtst </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libXtst.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libgcc </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libgcc.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libstdc</span>++ -<span style="color: rgba(0, 0, 0, 1)">y
yum install libstdc</span>++.i686 -<span style="color: rgba(0, 0, 0, 1)">y
yum install libstdc</span>++-devel -<span style="color: rgba(0, 0, 0, 1)">y
yum install libstdc</span>++-devel.i686 -<span style="color: rgba(0, 0, 0, 1)">y
yum install libxcb </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install libxcb.i686 </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install make </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install nfs</span>-utils -<span style="color: rgba(0, 0, 0, 1)">y
yum install net</span>-tools -<span style="color: rgba(0, 0, 0, 1)">y
yum install smartmontools </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install sysstat </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install unixODBC </span>-<span style="color: rgba(0, 0, 0, 1)">y
yum install unixODBC</span>-devel -y</pre>
</div>
<h3>内核参数调整(双斜杠即//为注释,不用写到配置文件内)</h3>
<pre><code class="hljs cpp">输入指令 vim /etc/sysctl.conf ,或者进入界面找到sysctl.conf ,手动添加即可</code></pre>
<div class="cnblogs_code">
<pre><code class="hljs cpp">
fs.aio-max-nr = <span class="hljs-number">1048576         <span class="hljs-comment">//异步IO请求数目 推荐值是:1048576 其实它等于 1024*1024 也就是 1024K 个
fs.file-max = <span class="hljs-number">6815744         <span class="hljs-comment">//打开的文件句柄的最大数量,防止文件描述符耗尽的问题
kernel.shmall = <span class="hljs-number">2097152         <span class="hljs-comment">//共享内存总量 页为单位,内存除以4K所得
kernel.shmmax = <span class="hljs-number">4294967295
kernel.shmmni = <span class="hljs-number">4096
kernel.sem = <span class="hljs-number">250 <span class="hljs-number">32000 <span class="hljs-number">100 <span class="hljs-number">128
<span class="hljs-comment">//SEMMSL: 每个信号集的最大信号数量 SEMMNS:用于控制整个 Linux 系统中信号的最大数 <br>//SEMOPM: 内核参数用于控制每个 semop 系统调用可以执行的信号操作的数量 SEMMNI :内核参数用于控制整个 Linux 系统中信号集的最大数量
net.ipv4.ip_local_port_range = <span class="hljs-number">9000 <span class="hljs-number">65500<span class="hljs-comment">//用于向外连接的端口范围
net.core.rmem_default = <span class="hljs-number">262144 <span class="hljs-comment">//套接字接收缓冲区大小的缺省值
net.core.rmem_max = <span class="hljs-number">4194304   <span class="hljs-comment">//套接字接收缓冲区大小的最大值
net.core.wmem_default = <span class="hljs-number">262144 <span class="hljs-comment">//套接字发送缓冲区大小的缺省值
net.core.wmem_max = <span class="hljs-number">1048576   <span class="hljs-comment">//套接字发送缓冲区大小的最大值</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre>
</div>
<pre><code class="hljs cpp"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment">sysctl -p    <span class="hljs-comment">//不属于配置文件内容,重新加载配置文件</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre>
<p><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-number"><span class="hljs-comment"><span class="hljs-comment"><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615123322219-1790709896.jpg"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p>&nbsp;</p>
<h3>用户和组</h3>
<div class="cnblogs_code">
<pre>groupadd oinstall<br>groupadd dba<br>groupadd oper<br><em id="__mceDel">useradd -g oinstall -G dba,oper oracle</em></pre>
<pre>passwd oracle                                     //创建oracle用户密码
mkdir -p /orc/app/<span>oracle
chown -R oracle:oinstall /orc/app/<span>
chmod -R 777 /orc/app/oracle/</span></span></pre>
</div>
<h3>Oracle用户环境配置</h3>
<div class="cnblogs_code">
<pre>vim /home/oracle/<span style="color: rgba(0, 0, 0, 1)">.bash_profile
umask </span><span style="color: rgba(128, 0, 128, 1)">022</span><span style="color: rgba(0, 0, 0, 1)">
ORACLE_BASE</span>=/orc/app/<span style="color: rgba(0, 0, 0, 1)">oracle
ORACLE_HOME</span>=/orc/app/oracle/product/<span style="color: rgba(128, 0, 128, 1)">12.2</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>/dbhome_1/<span style="color: rgba(0, 0, 0, 1)">
ORACLE_SID</span>=<span style="color: rgba(0, 0, 0, 1)">orcl
NLS_LANG</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">SIMPLIFIED CHINESE_CHINA</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">.UTF8
PATH</span>=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/<span style="color: rgba(0, 0, 0, 1)">bin
LANG</span>=zh_CN.UTF-<span style="color: rgba(128, 0, 128, 1)">8</span><span style="color: rgba(0, 0, 0, 1)">
export PATH LANG NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID</span></pre>
</div>
<p><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615123754612-302039977.jpg"></p>
<h3>Oracle用户资源限制</h3>
<pre>vim /etc/pam.d/<span>login同上,可进入界面复制粘贴</span></pre>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">
session    required   </span>/lib/security/<span style="color: rgba(0, 0, 0, 1)">pam_limits.so
session    required   pam_limits.so</span></pre>
</div>
<p><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615123921583-857778637.jpg"></p>
<h3>改文件限制</h3>
<pre><code class="hljs cpp">vim /etc/security/limits.conf</code></pre>
<div class="cnblogs_code">
<pre>oracle      soft    nproc         <span style="color: rgba(128, 0, 128, 1)">2047</span>       <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">单用户可使用的进程数量</span>
oracle      hard    nproc         <span style="color: rgba(128, 0, 128, 1)">16384</span><span style="color: rgba(0, 0, 0, 1)">
oracle      soft    nofile          </span><span style="color: rgba(128, 0, 128, 1)">1024</span>       <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">用户可打开的文件数量</span>
oracle      hard    nofile          <span style="color: rgba(128, 0, 128, 1)">65536</span><span style="color: rgba(0, 0, 0, 1)">
oracle      soft    stack         </span><span style="color: rgba(128, 0, 128, 1)">10240</span>      <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">堆栈设置
</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">该配置文件中均为注释文件,只需在末行添加即可</span></pre>
</div>
<h3>改profile</h3>
<pre><code class="hljs bash">vim /etc/profile </code></pre>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">if</span> [ $USER = <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">oracle</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> ]
then
</span><span style="color: rgba(0, 0, 255, 1)">if</span> [ $SHELL = <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">/bin/ksh</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> ]
then
   ulimit </span>-p <span style="color: rgba(128, 0, 128, 1)">16384</span>                  <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">缓冲区大小</span>
   ulimit -p <span style="color: rgba(128, 0, 128, 1)">65536</span>
<span style="color: rgba(0, 0, 255, 1)">else</span><span style="color: rgba(0, 0, 0, 1)">
ulimit </span>-u <span style="color: rgba(128, 0, 128, 1)">16384</span> -n <span style="color: rgba(128, 0, 128, 1)">65536</span>         <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">进程数文件数</span>
<span style="color: rgba(0, 0, 0, 1)">fi
fi                                    </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">配置文件末行直接添加</span></pre>
</div>
<h3>修改为宽容模式</h3>
<pre>文件路径: /etc/selinux/config<br><br>SELINUX=permissive</pre>
<h3>oracle安装<br><br>注:下载好的Oracle要放到/orc/app/oracle目录下,并使用 unzip指令解压缩,/orc/app/oracle/下是2个目录:product和database。解压后的安装文件放在database下。<br>安装的时候需要注意下进入方式,从界面进入 oracle 用户,打开终端输入<br>(进入xshell远程访问,会提示颜色什么禁止安装,所以使用进入界面的方式)</h3>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">suoracle
cd </span>/orc/app/<span style="color: rgba(0, 0, 0, 1)">oracle
unzip linuxx64_12201_database.zip </span><span style="color: rgba(0, 0, 0, 1)">
cd </span>/orcl/app/oracle/<span style="color: rgba(0, 0, 0, 1)">database
.</span>/runInstaller</pre>
</div>
<pre><code class="hljs bash"><span class="hljs-keyword">图形更新</span></code></pre>
<p><span class="hljs-keyword"><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615124745056-1139014371.png"></span></p>
<p><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615124806214-1669563816.png"></p>
<p><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615124817551-1618261384.png"></p>
<p><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615124825834-1570455550.png"></p>
<p><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615124832254-635233143.png"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4>安装过程中弹窗的处理方法</h4>
<p><img src="https://s1.51cto.com/images/blog/201807/11/e20bbe88d955d61f7311066f85a34633.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk="></p>
<pre><code class="hljs coffeescript">/orc/app/oraInventory/orainstRoot.sh
<span class="hljs-regexp">/orc/app/oracle/product/12.2.0/dbhome_1/root.sh   //重新打开新的终端,以root用户运行</span></code></pre>
<p><img src="https://s1.51cto.com/images/blog/201807/11/11b0bc7de20e4e9954d6da96ecfbe029.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk="></p>
<ul>
<li>
<h3>web界面管理</h3>
</li>
<li>在安装完成的界面上指出了管理地址<br data-filtered="filtered"><img src="https://s1.51cto.com/images/blog/201807/11/36cd354ec258d779acad6978a36d6ca4.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk="></li>
<li>web界面使用flash插件,从flash官网下载最新的rpm插件
<pre><code class="hljs css"><span class="hljs-selector-tag">rpm <span class="hljs-selector-tag">-ivh <span class="hljs-selector-tag">flash-player-npapi-26<span class="hljs-selector-class">.0<span class="hljs-selector-class">.0<span class="hljs-selector-class">.131-release<span class="hljs-selector-class">.x86_64<span class="hljs-selector-class">.rpm<br><img src="https://img2018.cnblogs.com/blog/1082024/201906/1082024-20190615125136852-296868527.jpg"><br></span></span></span></span></span></span></span></span></code></pre>
</li>
<li>在登陆界面使用账户密码登陆
<pre><code class="hljs">账户:sys
密码是在安装数据库是设置的口令</code></pre>
</li>
<li>
<pre>如果打不开,在火狐狸浏览器输入https://oracle:5050/em<br>弹出的页面会有安全提示,将<em id="__mceDel">https://oracle:5050/em添加到Exception,即可,<br>也可尝试 火狐浏览器 设置项,有个 Block.....</em></pre>
<p>&nbsp;</p>
</li>
<li>
<p><img src="https://s1.51cto.com/images/blog/201807/11/ba688e1ae07e4518759979524a7a4091.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk="></p>
</li>
</ul>
<p>参考自:</p>
<p>https://blog.51cto.com/13643643/2140547<br>https://oracle-base.com/articles/12c/oracle-db-12cr2-installation-on-oracle-linux-6-and-7</p><br><br>
来源:https://www.cnblogs.com/boentouch/p/11027250.html
頁: [1]
查看完整版本: Centos下安装Oracle12c