签到成功

知道了

CNDBA社区CNDBA社区

Redhat 8.5下安装Oracle 19C-基于ASM 的单实例

2022-01-09 23:13 1956 0 原创 oracle
作者: hbhe0316

1 设置/etc/hosts文件

[root@asm01 tmp]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.200 asm01
[root@asm01 tmp]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.5 (Ootpa)

2.关闭防火墙http://www.cndba.cn/hbhe0316/article/103919http://www.cndba.cn/hbhe0316/article/103919

[root@asm01 ~]# systemctl stop firewalld.service
[root@asm01 ~]# systemctl disable firewalld.service

关闭selinux

[root@asm01 ~]# sed -i  "s/SELINUX=enforcing/SELINUX=disabled/"  /etc/selinux/config
[root@asm01 ~]# setenforce 0

添加用户和组

http://www.cndba.cn/hbhe0316/article/103919

 [root@asm01 oracle]# mkdir -p /u01/app/19.3.0/grid
 [root@asm01 oracle]# mkdir -p /u01/app/grid
 [root@asm01 oracle]# mkdir -p /u01/app/oracle/product/19.3.0/db_1
 [root@asm01 oracle]# chown -R grid:oinstall /u01
 [root@asm01 oracle]# chown -R oracle:oinstall /u01/app/oracle
 [root@asm01 oracle]# chmod -R 775 /u01/

配置oracle环境变量http://www.cndba.cn/hbhe0316/article/103919

ORACLE_SID=testdb;export ORACLE_SID
ORACLE_UNQNAME=testdb;export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022

设置grid用户

[root@asm01 tmp]# vi /home/grid/.bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3.0/grid
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp
umask 022
export PATH

修改资源限制

[root@asm01 oracle]# cat >> /etc/security/limits.conf <<EOF
grid  soft  nproc  2047
grid  hard  nproc  16384
grid  soft   nofile  1024
grid  hard  nofile  65536
grid  soft   stack  10240
grid  hard  stack  32768

oracle  soft  nproc  2047
oracle  hard  nproc  16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536
oracle  soft  stack  10240
oracle  hard  stack  32768
oracle soft memlock 3145728
oracle hard memlock 3145728
EOF

设置PAMhttp://www.cndba.cn/hbhe0316/article/103919

[root@asm01 oracle]# cat >> /etc/pam.d/login <<EOF
session required pam_limits.so
EOF

配置NOZEROCONFhttp://www.cndba.cn/hbhe0316/article/103919http://www.cndba.cn/hbhe0316/article/103919

[root@asm01 oracle]# echo "NOZEROCONF=yes"  >>/etc/sysconfig/network

修改内核参数

[root@asm01 oracle]# cat >> /etc/sysctl.d/sysctl.conf <<EOF  
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
EOF
[root@asm01 oracle]# sysctl -p

安装rpm包

[root@asm01 tmp]# cat /etc/yum.repos.d/rhel85.repo 
[AppStream]
name=base
baseurl=ftp://192.168.56.199/pub/rhel85/AppStream
enabled=1
gpgcheck=0

[base]
name=base
baseurl=ftp://192.168.56.199/pub/rhel85/BaseOS
enabled=1
gpgcheck=0
dnf install -y bc    
dnf install -y binutils
dnf install -y compat-libstdc++-33
dnf install -y elfutils-libelf
dnf install -y elfutils-libelf-devel
dnf install -y fontconfig-devel
dnf install -y glibc
dnf install -y glibc-devel
dnf install -y ksh
dnf install -y libaio
dnf install -y libaio-devel
dnf install -y libXrender
dnf install -y libXrender-devel
dnf install -y libX11
dnf install -y libXau
dnf install -y libXi
dnf install -y libXtst
dnf install -y libgcc
dnf install -y librdmacm-devel
dnf install -y libstdc++
dnf install -y libstdc++-devel
dnf install -y libxcb
dnf install -y make
dnf install -y net-tools # Clusterware
dnf install -y nfs-utils # ACFS
dnf install -y python # ACFS
dnf install -y python-configshell # ACFS
dnf install -y python-rtslib # ACFS
dnf install -y python-six # ACFS
dnf install -y targetcli # ACFS
dnf install -y smartmontools
dnf install -y sysstat
dnf install -y unixODBC
dnf install -y libnsl2
dnf install -y libnsl2.i686
dnf install -y libnsl
[root@asm01 tmp]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules 
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB174cb4b5-a7312766",SYMLINK+="asm-diskb",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB65f6fcc8-df908d40",SYMLINK+="asm-diskc",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB11e87c4d-48cf117f",SYMLINK+="asm-diskd",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VBffcae079-d1122272",SYMLINK+="asm-diske",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd?",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB41e00855-d80aa9bd",SYMLINK+="asm-diskf",OWNER="grid",GROUP="asmadmin",MODE="0660"

[root@asm01 tmp]# /sbin/udevadm trigger --type=devices --action=change
[root@asm01 tmp]# ls /dev/asm*
/dev/asm-diskb  /dev/asm-diskc  /dev/asm-diskd  /dev/asm-diske  /dev/asm-diskf

安装GRID

[grid@asm01 tmp]$ unzip -d /u01/app/19.3.0/grid/ /tmp/LINUX.X64_193000_grid_home.zip
[root@asm01 ~]# rpm -ivh /u01/app/19.3.0/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm
[root@asm01 ~]# yum install libXp*.i686 libXt*.i686 libXtst  libXrender-0.9.10 -y
[root@asm01 tmp]# su - grid
[grid@asm01 ~]$ cd /u01/app/19.3.0/grid/
[grid@asm01 grid]$ export DISPLAY=192.168.56.1:0.0
[grid@asm01 grid]$ export CV_ASSUME_DISTID=RHEL7.9
[grid@asm01 grid]$ ./gridSetup.sh











[root@asm01 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@asm01 ~]# /u01/app/19.3.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/19.3.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/asm01/crsconfig/roothas_2022-01-09_10-10-18PM.log

LOCAL ADD MODE 
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE 
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node asm01 successfully pinned.
2022/01/09 22:10:35 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

asm01     2022/01/09 22:11:32     /u01/app/grid/crsdata/asm01/olr/backup_20220109_221132.olr     724960844     
2022/01/09 22:11:33 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

安装Oracle软件

http://www.cndba.cn/hbhe0316/article/103919

[root@asm01 root]# su - oracle
[oracle@asm01 oracle]$ unzip -d /u01/app/oracle/product/19.3.0/dbhome_1/ /tmp/LINUX.X64_193000_db_home.zip
[oracle@asm01 ~]$ cd /u01/app/oracle/product/19.3.0/dbhome_1/
[oracle@asm01 oracle]$ export DISPLAY=192.168.56.1:0.0
[oracle@asm01 oracle]$ export CV_ASSUME_DISTID=RHEL7.9
[oracle@asm01 dbhome_1]$ ./runInstaller








http://www.cndba.cn/hbhe0316/article/103919

[root@asm01 tmp]#  /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19.3.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA - Standalone Mode) is available at :
    /u01/app/oracle/product/19.3.0/dbhome_1/bin/tfactl

Note :
1. tfactl will use TFA Service if that service is running and user has been granted access
2. tfactl will configure TFA Standalone Mode only if user has no access to TFA Service or TFA is not installed

http://www.cndba.cn/hbhe0316/article/103919

[oracle@asm01 dbhome_1]$ dbca














版权声明:本文为博主原创文章,未经博主允许不得转载。

Linux,oracle

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1039835次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ