hbhe0316
作者hbhe03162021-12-31 17:02
数据库管理员, IBM

redhat 8.5安装Oracle 19.3

字数 5848阅读 2429评论 0赞 0

一、前期配置
1.配置/etc/hosts文件

[root@node01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.200 node01

2.关闭selinux

[root@node01 ~]#  sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
[root@node01 ~]# cat /etc/selinux/config | grep "SELINUX=" | grep -v "#"
SELINUX=disabled
[root@node01 ~]# setenforce 0

3.关闭防火墙

[root@node01 ~]# systemctl stop firewalld.service 
[root@node01 ~]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

4.配置/etc/sysctl.conf文件

[root@node01 ~]# cat /etc/sysctl.conf | grep -v "#"
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
[root@node01 ~]# sysctl -p

5.配置/etc/security/limits.conf文件

[root@node01 ~]# cat /etc/security/limits.conf | grep -v "#"
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

6.安装rpm包

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

7.创建用户和组

groupadd -g 1002 oinstall
groupadd -g 1003 dba
groupadd -g 1004 oper
useradd -u 1002 -g oinstall -G dba,oper oracle
passwd oracle

8.创建目录

mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

9.设置环境变量
切换到oracle用户下执行vim .bash_profile编辑.bash_profile文件添加以下内容:

[oracle@node01 ~]$ vim .bash_profile
ORACLE_SID=orcl;export ORACLE_SID  
ORACLE_UNQNAME=orcl;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/dbhome_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT
export NLS_LANG=AMERICAN_AMERICA.UTF8
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

执行命令生效
oracle[@node01 ~]$ source .bash_profile

二、安装数据库软件

[root@node01 u01]# chown oracle:oinstall /tmp/LINUX.X64_193000_db_home.zip 
[root@node01 software]# su - oracle
[oracle@node01 ~]$ unzip -d /u01/app/oracle/product/19.3.0/dbhome_1/ /tmp/LINUX.X64_193000_db_home.zip
[root@node01 ~]$ yum install libXp*.i686 libXt*.i686 libXtst libnsl.so.1 libXrender-0.9.10 -y
切换到Oracle用户进去Oracle Home目录执行./runInstaller安装Oracle 18c数据库软件
[oracle@node01 dbhome_1]$ cd /u01/app/oracle/product/19.3.0/dbhome_1/
[oracle@node01 dbhome_1]$  export CV_ASSUME_DISTID=RHEL7.9
[oracle@node01 dbhome_1]$ ./runInstaller

`

[root@node01 ~]# /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@node01 ~]# /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]: 
   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.
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

三、创建数据库

[oracle@node01 dbhome_1]$ dbca

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广