Oracle 21C下载和安装

2天前 7.6k 0

Oracle 21C下载和安装-1

Oracle 21C安装包下载地址

https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

Oracle 21C下载和安装-2

Oracle 21C文档位置

https://docs.oracle.com/en/database/oracle/oracle-database/index.html

Oracle 21C下载和安装-3

Database Installation Guide for Linux

https://docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/database-installation-guide-linux.pdf

准备安装环境:

操作系统版本:Redhat 7.6

cd /home/oracle

touch install_db01.sh

chmod a+x install_db01.sh

vim install_db01.sh

    #!/bin/bash
    SPATH=/soft
    DATAPATH=/oradata
    FS_TYPE=ext4
    ORABASE=/oracle/product
    FNAME=LINUX.X64_213000_db_home.zip
    MT_PT=/oracle
    ORAlnven=/oracle
    TPATH=/home/oracle
    ORAHOME=/oracle/product/21.3/db

    mem=$(free -g | grep Mem | awk {'print $2'})
    shm=$((mem*1024*1024*819))
    mall=$((shm/4096))
    sga=$((mem*512))M
    pga=$((mem*153))M
    cpu=$(cat proc/cpuinfo | grep process|wc -l)
    install_database_log=$TPATH/install_database.log
    install_database_rsp_file=$TPATH/install_database.rsp
    #
    ##############################################################
    ## Step 2: create oracle path
    ##############################################################
    env_info(){
    echo "Os:" `cat etc/system-release`
    echo `grep MemTotal proc/meminfo`
    grep SwapTotal proc/meminfo
    df -h tmp
    free -g
    df -h dev/shm
    echo "Processor architecture: " `uname -m`
    }

    mk_path(){
    mkdir -p "$MT_PT"
    mkdir -p "$DATAPATH"
             }
    ##############################################################
    ## Step 3: Change os properties
    ##############################################################
    change_os(){
    if [[ -f usr/lib/systemd/system/ctrl-alt-del.target ]]; then
    rm -f usr/lib/systemd/system/ctrl-alt-del.target
    init q
    systemctl stop firewalld
    systemctl stop avahi-daemon
    systemctl stop bluetooth
    systemctl disable firewalld
    systemctl disable avahi-daemon
    systemctl disable bluetooth
    echo "OS has been changed"
    else
    echo "OS has been changed!!!!"
    fi
    }

    add_user(){
    id oracle
    if [[ $? == 0 ]]; then
    echo "Oracle user has been add!!!!!!"
    else
    #user and group
    groupadd -g 301 oinstall
    groupadd -g 300 dba
    groupadd -g 303 oper
    groupadd -g 307 backupdba
    groupadd -g 308 dgdba
          groupadd -g 309 kmdba
    useradd -m -d /home/oracle -u 500 -g oinstall -G dba,oper,backupdba,dgdba,kmdba oracle
    mkdir -p $ORAHOME
    chown -R oracle:oinstall /oracle
    echo 'oracle' | passwd oracle --stdin
    cp /etc/profile /etc/profile_org
    cat /etc/profile
    if [ \$USER = "oracle" ]; then
    if [ \$SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
    fi


    export HISTTIMEFORMAT="%F %T "
    export HISTSIZE=10000
    eof
    cat /home/oracle/.bash_profile
    export ORACLE_BASE=/oracle/product
    export ORACLE_HOME=$ORAHOME
    export PATH=\$PATH:\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$ORACLE_HOME/suptools/oratop
    export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$LD_LIBRARY_PATH
    export ORACLE_SID=$DBNAME
    alias cdo='cd \$ORACLE_HOME'
    alias cdb='cd \$ORACLE_HOME/dbs'
    alias cdn='cd \$ORACLE_HOME/network/admin'
    alias cdal='cd \$ORACLE_BASE/diag/rdbms/*/$DBNAME/trace'
    alias sqp='sqlplus / as sysdba'
    eof
    echo "User has been changed"
    fi
    }


    change_param(){
    if [[ $(cat /etc/sysctl.conf | grep 'oracle parameter' |wc -l) == 1 ]]; then
    echo "Parameter has been changed!!!!!!"
    else
    cp /etc/sysctl.conf /etc/sysctl.conf_orig
    cat /etc/sysctl.conf
    ##oracle parameter
    kernel.shmmni = 4096
    kernel.shmall = $mall
    kernel.shmmax = $shm
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    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 = 1048586
    net.ipv4.ipfrag_high_thresh = 16777216
    net.ipv4.ipfrag_low_thresh = 15728640
    kernel.panic_on_oops = 1
    kernel.randomize_va_space = 0
    vm.min_free_kbytes= 524288 
    vm.swappiness =10
    eof
    sysctl -p
          
    cat /etc/security/limits.conf
    ##oracle parameter
    * - memlock unlimited
    * soft memlock unlimited
    * hard memlock unlimited
    oracle soft nproc 16384
    oracle hard nproc 16384
    oracle soft nofile 65536
    oracle hard nofile 65536
    oracle soft stack 10240
    eof
    sed -i -e "s/4096/16384/g" /etc/security/limits.d/20-nproc.conf
    cp /etc/pam.d/login /etc/pam.d/login_orig
    echo "session required pam_limits.so" >> /etc/pam.d/login
    echo "RemoveIPC=no" >> /etc/systemd/logind.conf
    systemctl daemon-reload
    systemctl restart systemd-logind
    echo "Parameter has been changed"
    fi
    }
    disable_thp(){
    if [[ $(cat /etc/default/grub | grep 'transparent_hugepage=never' |wc -l) == 1 ]]; then
    echo "THP has been disabled !!!!!!!"
    else
    cp /etc/default/grub /etc/default/grub_orig
    cat /etc/default/grub
    sed -i 's#rhgb quiet#rhgb quiet transparent_hugepage=never NUMA=off#' /etc/default/grub
    #普通启动方式
    grub2-mkconfig -o /boot/grub2/grub.cfg
    #efi模式
    # grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
    if [[ $? != 0 ]]; then
    echo "THP change failed, Please manual change!"
    else
    echo "THP has been disabled!!!"
    fi
    fi
    }


    unzip_soft(){
    chown oracle:oinstall $SPATH/$FNAME
    echo "Begin unzip......"
    su - oracle -c "unzip -qo $SPATH/$FNAME -d $ORAHOME"
    }


    env_info
    mk_path
    change_os
    add_user
    change_param
    unzip_soft

    nohup ./install_db01.sh > 01.log &

    开始安装数据库:

    su - oracle

    [oracle@cjc db]$ pwd

    /oracle/product/21.3/db

    [oracle@cjc db]$ ./runInstaller 

    Oracle 21C下载和安装-4

    Oracle 21C下载和安装-5

    Oracle 21C下载和安装-6

    Oracle 21C下载和安装-7

    Oracle 21C下载和安装-8

    Oracle 21C下载和安装-9

    Oracle 21C下载和安装-10

    Oracle 21C下载和安装-11

    Oracle 21C下载和安装-12

    Oracle 21C下载和安装-13

    Oracle 21C下载和安装-14

    Oracle 21C下载和安装-15

    Oracle 21C下载和安装-16

    Oracle 21C下载和安装-17

    Oracle 21C下载和安装-18

    Oracle 21C下载和安装-19

    [oracle@cjc db]$ source /home/oracle/.bash_profile

    [oracle@cjc db]$ sqlplus -v

    SQL*Plus: Release 21.0.0.0.0 - Production

    Version 21.3.0.0.0

    [oracle@cjc db]$ netca

    Oracle 21C下载和安装-20

    Oracle 21C下载和安装-21

    Oracle 21C下载和安装-22

    [oracle@cjc db]$ dbca

    Oracle 21C下载和安装-23

    Oracle 21C下载和安装-24

    Oracle 21C下载和安装-25

    Oracle 21C下载和安装-26

    Oracle 21C下载和安装-27

    Oracle 21C下载和安装-28

    Oracle 21C下载和安装-29

    Oracle 21C下载和安装-30

    Oracle 21C下载和安装-31

    Oracle 21C下载和安装-32

    Oracle 21C下载和安装-33

    Oracle 21C下载和安装-34

    Oracle 21C下载和安装-35

    Oracle 21C下载和安装-36

    Oracle 21C下载和安装-37

    Oracle 21C下载和安装-38

    Oracle 21C下载和安装-39

    Oracle 21C下载和安装-40

    Oracle 21C下载和安装-41

    Oracle 21C下载和安装-42

    Oracle 21C下载和安装-43

    Oracle 21C下载和安装-44

    Oracle 21C下载和安装-45

    Oracle 21C下载和安装-46

    Oracle 21C下载和安装-47

    Oracle 21C下载和安装-48

    EM:

    https://CJC:5500/em

    Oracle 21C下载和安装-49

    Oracle 21C下载和安装-50

    Oracle 21C下载和安装-51

    Oracle 21C下载和安装-52

    Oracle 21C下载和安装-53

    Oracle 21C下载和安装-54

    Oracle 21C下载和安装-55

    Oracle 21C下载和安装-56

    Oracle 21C下载和安装-57

    Oracle 21C下载和安装-58

    Oracle 21C下载和安装-59

    Oracle 21C下载和安装-60

    Oracle 21C下载和安装-61

    #####chenjuchao 2021-08-27 18:00#####

    Oracle 21C下载和安装-62

    相关文章

    OCP 4.x 特性解读:可观测性、高可用和易用性全面升级
    第 55 期:MySQL 频繁 Crash 怎么办?
    openGauss学习笔记-217 openGauss性能调优-确定性能调优范围-硬件瓶颈点分析-内存
    Oracle 19C PDB迁移报错 ORA-17628: error 65338 returned by remote Oracle server
    【ORACLE】Oracle数据库并发控制、多版本控制、数据库独立性与应用性能优化
    Oracle 基础数据库服务新增 AMD VM 标准 E5 Flex 配置

    发布评论