centos8 安装oracle 11gR2

一、准备

先装jdk1.8

安装oracle-rdbms-server-11gR2-preinstall 包

a 进入yum 配置目录

  [root@rac1 ~]# cd /etc/yum.repos.d/

b 下载yum 配置

[root@rac1 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol7.repo

c 安装oracle-rdbms-server-11gR2-preinstall包

[root@rac1 ~]# yum install oracle-rdbms-server-11gR2-preinstall

其他依赖包

dnf install libnsl(不安会有jdk错误)

其他可能需要的包:

yum -y install xz wget gcc-c++ ncurses ncurses-devel \
cmake make perl openssl openssl-devel gcc* libxml2 \
libxml2-devel curl-devel libjpeg* libpng* freetype* \
make gcc-c++ cmake bison perl perl-devel perl perl-devel \
glibc-devel.i686 glibc-devel libaio readline-devel \
zlib.x86_64 zlib-devel.x86_64 libcurl-* net-tool* \
sysstat lrzsz dos2unix telnet.x86_64 iotop unzip \
ftp.x86_64 xfs* expect vim psmisc openssh-client* \
libaio bzip2 epel-release automake binutils bzip2 \
elfutils expat gawk gcc ksh less make openssh-server \
rpm sysstat unzip unzip cifs-utils libXext.x86_64 \
glibc.i686 binutils compat-libstdc++-33 \
elfutils-libelf elfutils-libelf-devel \
expat gcc gcc-c++ glibc glibc-common \
glibc-devel glibc-headers libaio \
libaio-devel libgcc libstdc++ libstdc++-devel \
make sysstat unixODBC unixODBC-devel libnsl

创建用户

oracle无法用root安装,这里创建用户oracle

useradd oracle

passwd oracle

赋予root权限:

修改 /etc/sudoers:
## Allow root to run any commands anywhere
root    ALL=(ALL)     ALL
oracle  ALL=(ALL)     ALL

/home/oracle下建文件夹oracle_11g

设置环境变量:

 

修改/home/oracle下的.bashrc

#vim  /home/oracle/.bashrc

export ORACLE_BASE="/home/oracle/oracle_11g/app/oracle"

export ORACLE_HOME="/home/oracle/oracle_11g/app/oracle/product/11.2.0/dbhome_1"

export PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_SID=orcl

export NLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8"

export PATH

刷新:source .bashrc

二、安装

跳出图形界面安装:

需要用Xmanager

create and config a database

server class

single instance database installation

advanced install

simplified Chinese

Enterprise edition

路径:上面设定好的ORACLE_BASE和ORACLE_HOME

centos8 安装oracle 11gR2

Inventory路径:

centos8 安装oracle 11gR2

general purpose

centos8 安装oracle 11gR2

实例orcl orcl

centos8 安装oracle 11gR2

memory 

centos8 安装oracle 11gR2

unicode

centos8 安装oracle 11gR2

centos8 安装oracle 11gR2

centos8 安装oracle 11gR2

centos8 安装oracle 11gR2

centos8 安装oracle 11gR2

2020@xxxx

centos8 安装oracle 11gR2

不能有特殊字符

centos8 安装oracle 11gR2

centos8 安装oracle 11gR2

centos8 安装oracle 11gR2

安装过程可能遇到的问题:

ins_net_client.mk   错误

没装 make cmake gcc g++等,找上面的依赖包装上

ins_precomp.mk错误:

log里:/usr/lib64/libaio.so.1: undefined reference to `__stack_chk_fail@GLIBC_2.4'

把libaio.so.1替换为新的:https://www.cnblogs.com/jinzhenshui/p/9366002.html    注意替换libaio.so.1.0.1 ,查看软连接libaio.so.1要链接到新的so文件上

ins_ctx.mk错误:

log里:

找不到libstdc++.so.5  :   libstdc++.so.5 在compat-libstdc++-33 里: # yum install compat-libstdc++-33

然后替换libstdc++.so.5 .0.7       https://www.cnblogs.com/jinzhenshui/p/9365787.html

yum 安装时出现 Couldn t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
 

ins_emagent.mk错误:

logs:

db_home1/sysman/lib//libnmectl.a(nmectlt.o): In function `nmectlt_genSudoProps':
nmectlt.c:(.text+0x84): undefined reference to `B_DestroyKeyObject'
nmectlt.c:(.text+0x8d): undefined reference to `B_DestroyKeyObject'
nmectlt.c:(.text+0x96): undefined reference to `B_DestroyKeyObject'
nmectlt.c:(.text+0x9f): undefined reference to `B_DestroyKeyObject'

解决:

vim  /home/oracle/oracle_11g/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
#找到如下内容后

    $(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL)
进行修改为如下
     $(SYSMANBIN)emdctl:
        $(MK_EMAGENT_NMECTL) -lnnz11

 

centos8 安装oracle 11gR2

三、创建用户

创建表空间:

create tablespace cjk_tablespace datafile '/home/oracle/oracle_11g/app/oracle/oradata/orcl/cjk_data.dbf' size 30G autoextend on maxsize unlimited;

create tablespace bzk_tablespace datafile '/home/oracle/oracle_11g/app/oracle/oradata/orcl/bzk_data.dbf' size 30G autoextend on maxsize unlimited;

create tablespace bfk_tablespace datafile '/home/oracle/oracle_11g/app/oracle/oradata/orcl/bfk_data.dbf' size 30G autoextend on maxsize unlimited;

创建用户:

create user usr_cjk identified by xxxx2020 default tablespace cjk_tablespace;

grant connect,resource to usr_cjk;

create user usr_bzk identified by xxxx2020 default tablespace bzk_tablespace;

grant connect,resource to usr_bzk;

create user usr_bfk identified by xxxx2020 default tablespace bfk_tablespace;

grant connect,resource to usr_bfk;

上一篇:ORACLE--DBA常用查询


下一篇:oracle 查看表空间