静默安装Oracle11g(无图形化界面)

准备工作

已经通过安装oracle-rdbms-server-11gR2-preinstall包把环境准备好。

[oracle@centos ~]$ rpm -aq|grep oracle
oracle-rdbms-server-11gR2-preinstall-1.0-15.el6.x86_64

解压包

unzip p13390677_112040_Linux-x86-64_1of7.zip 
unzip p13390677_112040_Linux-x86-64_2of7.zip 

创建安装目录

sudo mkdir -p /u01/app/oracle
sudo mkdir -p /u01/app/oraInventory
sudo chown -R oracle:oinstall /u01/app/oracle
sudo chmod -R 775 /u01/app/oracle

创建oraInst.loc

sudo echo "inventory_loc=/u01/app/oraInventory" > /etc/oraInst.loc
sudo echo "inst_group=oinstall" >> /etc/oraInst.loc

配置oracle用户环境变量

在文件/home/oracle/.bash_profile里添加下面内容(具体值根据实际情况修改)

umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATH
export LC_ALL="en_US"
export LANG="en_US"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

使之生效
. .bash_profile
或
source ~/.bash_profile

复制响应文件模板

mkdir -p /u01/etc
[oracle@centos ~]$ cp  database/response/* /u01/etc
sed -e '/oracle.install.option/coracle.install.option=INSTALL_DB_SWONLY' \
-e '/^DECLINE_SECURITY_UPDATES/cDECLINE_SECURITY_UPDATES=true' \
-e '/UNIX_GROUP_NAME/cUNIX_GROUP_NAME=oinstall' \
-e '/INVENTORY_LOCATION=/cINVENTORY_LOCATION=\/u01\/oracle\/oraInventory' \
-e '/^SELECTED_LANGUAGES/cSELECTED_LANGUAGES=en,zh_CN' \
-e '/ORACLE_HOSTNAME/cORACLE_HOSTNAME=centos.oracle' \
-e '/ORACLE_HOME/cORACLE_HOME=\/u01\/app\/oracle\/product\/11.2.0\/dbhome_1' \
-e '/ORACLE_BASE=/cORACLE_BASE=\/u01\/app\/oracle' \
-e '/oracle.install.db.InstallEdition=/coracle.install.db.InstallEdition=EE' \
-e '/oracle.install.db.isCustomInstall=/coracle.install.db.isCustomInstall=true' \
-e '/oracle.install.db.DBA_GROUP=/coracle.install.db.DBA_GROUP=dba' \
-e '/oracle.install.db.OPER_GROUP=/coracle.install.db.OPER_GROUP=dba' \
database/response/db_install.rsp > /u01/etc/db_install.rsp

diff  database/response/db_install.rsp  /u01/etc/db_install.rsp

别忘了把hostname的解析加入到/etc/hosts里面,不然会出现:

SEVERE: [FATAL] PRVF-0002 : Could not retrieve local nodename.

安装数据库软件

database/runInstaller -silent -responseFile /u01/etc/db_install.rsp
......
The installation of Oracle Database 11g was successful.
Please check '/u01/oracle/oraInventory/logs/silentInstall2020-07-27_02-42-41PM.log' for more details.

As a root user, execute the following script(s):
	1. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
[oracle@centos ~]$ sudo /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_centos.oracle_2020-07-27_14-52-01.log for the output of root script

配置监听

[oracle@centos ~]$ netca /silent /responsefile /u01/etc/netca.rsp

alter system set local_listener="(address=(protocol=tcp)(host=192.168.87.117)(port=1521))";

创建数据库

我的博客里面有手工创建数据库的脚本,在install的分类中。

姚远ACE CSDN认证博客专家 ACE 华为云 MVP
Oracle ACE,华为云 MVP,Oracle10g,12c OCM; MySQL 5.6,5.7,8.0 OCP;CCNA; EMC Certified; IBM P Certified; RHCE; SQLServer 764; DB2 Certified; TOEIC 890;获得过两次国家部级科技进步奖;发明过两项计算机专利。微信:yaoyuanace 邮箱:yaoyuanace(at)qq.com
已标记关键词 清除标记
相关推荐
<p> <b><span style="background-color:#FFE500;">【超实用课程内容】</span></b> </p> <p> <br /> </p> <p> <br /> </p> <p> 本课程内容包含讲解<span>解读Nginx的基础知识,</span><span>解读Nginx的核心知识、带领学员进行</span>高并发环境下的Nginx性能优化实战,让学生能够快速将所学融合到企业应用中。 </p> <p> <br /> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><br /> </b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><span style="background-color:#FFE500;">【课程如何观看?】</span></b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> PC端:<a href="https://edu.csdn.net/course/detail/26277"><span id="__kindeditor_bookmark_start_21__"></span></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 移动端:CSDN 学院APP(注意不是CSDN APP哦) </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 本课程为录播课,课程永久有效观看时长,大家可以抓紧时间学习后一起讨论哦~ </p> <p style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <br /> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <strong><span style="background-color:#FFE500;">【学员专享增值服务】</span></strong> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b>源码开放</b> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 下载方式:电脑登录<a href="https://edu.csdn.net/course/detail/26277"></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a>,播放页面右侧点击课件进行资料打包下载 </p> <p> <br /> </p> <p> <br /> </p> <p> <br /> </p>
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页