linux安装Oracle11G的详细教程

本文档详细介绍了如何在Linux系统上下载、安装和配置Oracle11g数据库,包括关闭SELinux和防火墙,安装依赖包,创建用户和用户组,修改系统参数,设置安装目录,执行静默安装,配置监听程序,启动监听程序以及创建数据库实例。整个过程清晰易懂,适合系统管理员参考。
摘要由CSDN通过智能技术生成

下载Orcle11G

可以直接去官网下载,但是比较慢,下面是百度网盘链接

​​​​​​oracle11g的安装包-Oracle文档类资源-CSDN下载

解压安装包

把两个安装包:linux.x64_11gR2_database_1of2.zip和linux.x64_11gR2_database_2of2.zip上传到服务器上。

我在服务器建立了software目录,安装包放入这个目录下。

unzip  linux.x64_11gR2_database_1of2.zip  

unzip linux.x64_11gR2_database_2of2.zip

解压后会产生一个database的目录。

其他安装准备

关闭selinux

 vim /etc/selinux/config

关闭防火墙

安装Oracle 11g依赖包

yum install 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 –y

创建用户和用户组

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle

passwd oracle

-g 设置的是用户的主用户组。 这些信息记录在/etc/passwd中。事实上系统确认一个用户的主用户组的时候是根据/etc/passwd中的信息,而跟/etc/group无关。

-G 设置的是用户附加组,记录在/etc/group中。 

修改内核参数等配置文件

vim /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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 = 1048576

其中kernel.shmmax = 1073741824为本机物理内存(2G)的一半,单位为byte。

修改oracle用户的文件打开数和进程数:

vim /etc/security/limits.conf

oracle           soft    nproc          4096
oracle           hard    nproc          16384
oracle           soft    nofile         4096
oracle           hard    nofile         65536
oracle           soft    stack          10240

具体操作还是查看下面这篇文章,很详细!

linux安装Oracle11G - 淼淼之森 - 博客园

CentOS7安装Oracle11g—静默安装_liang墨竹的博客-CSDN博客_centos安装oracle

创建安装目录

mkdir -p /data/app/database_new/product/11.2.0
mkdir /data/app/database_new/oradata

mkdir /data/app/database_new/inventory

mkdir /data/app/database_new/fast_recovery_area

chown -R oracle:oinstall /data/app/database_new

chmod -R 775 /data/app/database_new


编辑oracle的.bash_profile文件

export ORACLE_BASE=/data/app/database_new
export ORACLE_SID=osstest
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK


采取静默安装方式,打开解压后的安装文件

./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp  -ignorePrereq

出现以下时,说明安装成功:
/data/app/database_new/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用户执行

sh /data/app/database_new/product/11.2.0/dbhome_1/root.sh

Check /data/app/database_new/product/11.2.0/dbhome_1/install/root_iom143_2022-06-21_11-04-43.log for the output of root script

配置监听程序

cd /data/app/database_new/product/11.2.0/dbhome_1/bin

./netca  /silent /responseFile /home/oracle/database/response

显示以下配置成功:
Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/database/response
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0


启动监听程序:
进入目录

cd /db/app/oracle/product/11.2.0/db_1/bin
./lsnrctl start
./lsnrctl status

创建数据库实例
 

 ./dbca -silent -responseFile /home/oracle/database/response/dbca.rsp

若数据库创建完成。

有关详细信息, 请查看以下位置的日志文件: /data/oracle/cfgtoollogs/dbca/orcl/orcl.log。

会显示数据库信息(自己设置的):

全局数据库名:orcl.cloud

系统标识符 (SID):orcl

  • 4
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大宇进阶之路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值